x


Sound effects too quiet

Hi Everyone,

I am trying to add sound effects to my game and have them playing, yet they are really quiet when compared to my background music.

The audio source is attached to my game control object, which also has the Audio listener attached to it. I have my background music playing from the audio source, then the Audio Clips use the same audio source.

The code is:

private var thisAudio : AudioSource; var fire : AudioClip;

function Start() { audio.Play(); thisAudio = audio; }

function Update()
{
    if(Input.GetButtonDown("Fire2"))
    {
        playSound(fire, 1.0);
    }
}

function playSound(sound : AudioClip, playLength : float)
{

        thisAudio.PlayOneShot(sound, playLength);


}

any help appreciated, thanks

more ▼

asked Aug 31 '10 at 08:24 PM

Christopher Winstanley gravatar image

Christopher Winstanley
63 7 7 10

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

To increase the volume of your sounds, you could do either of these:

  1. Change your sound effects to be stereo sounds (non-3D sounds). This makes them not vary in volume depending on distance. This might not be the best option if your sounds are coming from an object far away.
  2. Increase the audio source volume in the Inspector (make sure you increase the max volume also). This would be the best option of the two.

I hope this works for you!

more ▼

answered Aug 31 '10 at 08:37 PM

BinaryCaveman gravatar image

BinaryCaveman
792 6 10 22

What is the maximum volume? I have put it up to 100 as well as the volume. Can't really notice too much difference although I know the speaker on an iPhone is sucky

Sep 01 '10 at 10:01 AM Christopher Winstanley

The Maximum Volume is a Audio Source component property. See this page: http://unity3d.com/support/documentation/Components/class-AudioSource.html

Sep 01 '10 at 11:08 PM BinaryCaveman

Another option could be to lower the background music volume - you could use what I said above to increase the volume, but in the opposite direction (to something like 0.25).

Sep 01 '10 at 11:09 PM BinaryCaveman

No-one really explained this: The maximum volume is 1.0, that's why setting it to 100 made no difference.

Apr 07 at 04:48 AM Nition
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x1023
x169
x74

asked: Aug 31 '10 at 08:24 PM

Seen: 4571 times

Last Updated: Apr 22 at 06:06 PM