Audio Fluctuation

Hello there,

I have this minor problem regarding my app sounds. Some of them fluctuates, meaning they start off with low sound and out of sudden they go full burst. I explicitly declare the volumes of the channel I use, let say

audio.setVolume(.2, {channel = 2})

tapButtonSound = audio.play(tapSound,{channel = 2}) 

but there are some instances that the tapButtonSound sound go crazy as hell, this is very annoying when your in headphones(I tried it and I merely fell of the chair).

The fluctuation usually occurs when I’m changing scenes (I use storyboard API)

Any help and comment that will enlighten me is very welcome,

Thanks,

Jam

just to make sure the sounds play fine in other audio tools?

Is this happening in the simulator or on device?  What type of audio file is it?  What are it’s specifications (stereo, mono?, bitrate in hz?)

Thanks for the reply Rob :slight_smile:

They play fine in other audio tools. It both happens on the device and simulator. Sound format is .wav. I don’t know what is the bitrate in Hz but on the details of the sound file it says 705kbps (tapSound only) and it’s in stereo.

The main culprit maybe is the audio.setVolume, because when I don’t set the volume they work fine, but low sound files could no be heard because of the background music is too loud. 

It could be the setVolume thing.   705kbits per second is kind of an odd bit rate, the are usually 8, 11.05, 22, 44 etc. 

or maybe the kbps of my sound file could be the reason, If you said it was odd.

I’ll look through it again. I more thing Rob, where should a put the setVolume? in main.lua? or everytime I call the sound? because thats what I’m doing. Maybe I’m doing a bad code structure regarding my sounds. By any chance do you know any audio guide or something? cuz I can’t find any on the forums.

Thanks again Rob :slight_smile:

The Audio guide is here:  http://docs.coronalabs.com/guide/media/audioSystem/index.html 

If you go to the Documentation link at the top (you have to be logged in to Coronalabs.com, not just the forums), there is a “Guides” link at the top that has all of the guides we have.

You should call setVolume when you need to change the volume.  Like maybe a slider on a setting screen.  or in main.lua if you know your background music is going to be too loud relative to the other sounds and you only want to lower the sound of that channel.  If you are getting this problem when trying to change the volume, please make sure the values you are passing to the setVolume function are what’s expected.  It’s a fractional number between 0 (off) and 1 (full blast).  But Corona SDK cannot play a sound louder than the device’s max volume setting.  If your device is at 50% volume, then our 1 will be 50%, 0.5 will be 25% etc.

Thanks Rob! I’ll look into this :slight_smile:

Maybe it is really my code has the problems.

just to make sure the sounds play fine in other audio tools?

Is this happening in the simulator or on device?  What type of audio file is it?  What are it’s specifications (stereo, mono?, bitrate in hz?)

Thanks for the reply Rob :slight_smile:

They play fine in other audio tools. It both happens on the device and simulator. Sound format is .wav. I don’t know what is the bitrate in Hz but on the details of the sound file it says 705kbps (tapSound only) and it’s in stereo.

The main culprit maybe is the audio.setVolume, because when I don’t set the volume they work fine, but low sound files could no be heard because of the background music is too loud. 

It could be the setVolume thing.   705kbits per second is kind of an odd bit rate, the are usually 8, 11.05, 22, 44 etc. 

or maybe the kbps of my sound file could be the reason, If you said it was odd.

I’ll look through it again. I more thing Rob, where should a put the setVolume? in main.lua? or everytime I call the sound? because thats what I’m doing. Maybe I’m doing a bad code structure regarding my sounds. By any chance do you know any audio guide or something? cuz I can’t find any on the forums.

Thanks again Rob :slight_smile:

The Audio guide is here:  http://docs.coronalabs.com/guide/media/audioSystem/index.html 

If you go to the Documentation link at the top (you have to be logged in to Coronalabs.com, not just the forums), there is a “Guides” link at the top that has all of the guides we have.

You should call setVolume when you need to change the volume.  Like maybe a slider on a setting screen.  or in main.lua if you know your background music is going to be too loud relative to the other sounds and you only want to lower the sound of that channel.  If you are getting this problem when trying to change the volume, please make sure the values you are passing to the setVolume function are what’s expected.  It’s a fractional number between 0 (off) and 1 (full blast).  But Corona SDK cannot play a sound louder than the device’s max volume setting.  If your device is at 50% volume, then our 1 will be 50%, 0.5 will be 25% etc.

Thanks Rob! I’ll look into this :slight_smile:

Maybe it is really my code has the problems.