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

8 Answers

8

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!

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

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).

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

In addition to the other answers here you can also turn it up to 11 by adding an Audio Mixer to your AudioSource and increase the db output.

My app sound volume was fine until after I upgrade to Unity 5.0, it became inaudible…so need to make adjustments

In the Inspector > Audio Source >
Settings:

  1. ‘Spatial Blend’ to 0 (2D)
  2. ‘Stereo Pan’ to 0 (both left and right speakers can hear)

this is brilliant! thumbs up for u!

I increase inAudioClip’s volume by doing that :

            // create sample array
            float[] clipSampleData = new float[inAudioClip.samples]; 
            // fill sample array
            inAudioClip.GetData(clipSampleData, 0);  
            // for each samples
            for (int s = 0; s < clipSampleData.Length; s++) 
            { 
                // increase sample volume
                clipSampleData <strike>= clipSampleData ~~* multiplicationFactor; // to multiply the sound by 2 set "multiplicationFacteur = 2f;"~~</strike>

}

// save samples in audio clip
inAudioClip.SetData(clipSampleData, 0); // the volume of inAudioClip should be higher

Thanks, this worked for me. However, I had to change this: float[] clipSampleData = new float[clip.samples * clip.channels];

It is not possible in Audio Source component.

It is possible with Audio Mixer. It has values from -80db to +20db. Please take a look at the documentation :slight_smile:

Yes, you can chain two groups (one being the child of the other), each group having +20 dB. You will then have +40 dB at the output.

What fixed this problem for me was moving the audio listener to the same object or location as the audio source.

As a powerful video editor and converter, Avdshare Video Converter will easily increase the sound volume with simple settings.

Sometimes even with the volume in the highest level, it still sounds very slight. In this case, you may prefer to some professional tools or guides.

You may refer to the following step by step guide on How to Increase Audio Volume in MP3, MP4, WAV, WMA, WMV, MKV, VOB, MPG.

It will help you increase sound for almost all audio and video files.