wierd sound when app starts.

my app have sound and music,

but when the app starts, it will give a wierd sound for a split of a second. it sounds like the sound starts when i declare it and then they stop the sound, i just audio.stream and audio.loadSound, 1 file each.

if i make a timer for 1000, it will not give me this wierd sound. and this only happens on IOS device, on Android without the timer works fine.

only me notice this? or i did something wrong?

local sounds\_files={ background=audio.loadStream("sounds/music.mp3"), button= audio.loadSound("sounds/button.wav"), }

That doesn’t sound right.  You could call audio.setVolume(0) before you load your files and then reset it after.

thanks adrianm for the tip, i will try. but still it seams more than a workaround for the problem like i did with the timer than a proper solution, because it works well on simulator/android devices, and not on IOS. some times it only make the click sound only first time i run the app, second time will not do it…which is more wierd.

well tried everything but the bug still there. and worst now after i upgraded corona, the timer workaround don’t work. and the 

audio.setVolume(0) or setMaxVolume(0) or with both don’t work. it only happen once, the first time the app runs. i will try to isolate the code and make a bug report if it’s the case. but corona staff could look around the audio code…since this only happen on IOS device and not on android or any Mac or Windows build.

There was a fix in 3060 that addressed some audio issues:

  • iOS, Core: fixing issue when audio failed to load under certain conditions (splash screen, app being suspended, etc)

Are you using a build later than 3060 or before?

 

Rob

I’m using version 3068, and problem is still there. but very hard to detect because if i strip down the code to a bare minimum (only declare the files and play them) the problem disappear. with exact same files. if the code gets complicated it will appear. the rest of the code there is nothing about sound, its only about creating images and displaying them. it seams like the code tries to do lots of things same time, and in the sound department when things are going it messes something.

well with simple code i managed to replicate the problem. i just needed to put the splash screen on build.settings and the “click” sound at the beginning of the app appears.

i don’t think its related to splash screen, and i don’t know if it’s related to build.settings, because i did replicate the problem without splash screen, and with plugins in build.settings. and i also could reproduce the problem without plugins and without splash screen, only with my code.

i sent a bug report with all the files needed to replicate the problem (with splash screen, its easier to reproduce). hope you will figure it out.

some sound files can “hide” the problem. if the sound file doesn’t start with a sound at 0.00s the click sound wont happen.

I didn’t see a bug report come in. Please email it to support AT coronalabs.com

Is there a reason you’re trying to play a sound that early?

Rob

sent the bug report to the email you requested.

i just want to play a background sound when my app starts. is that asking to much? i don’t want a sound before splash screen or during it.

the problem is that i ear a clicking sound before the splash screen (and it should not happen that). it seams that the music starts, closes 1 split of a second later…then it shows the splash screen…and when app starts it starts the music like it should.

i don’t have this problem on android, simulator or windows builds, only on IOS builds. and sometimes only first time i run the app which is more strange. but is a loud sound and it’s annoying.

if the sound file have an initial second of silence it will “hide” the problem, but it’s still there…but you don’t ear it. in this case i can’t change the sound file because it’s not mine, and i can’t change it. what i can and i will is credit the author of the music.

The reason I ask, is that there’s a lot of magic in the “First frame”. You could put your sound in a short timer (to force it into the 2nd frame and see if that solves the problem.

Rob

@carlos… don’t sweat the details… just mute sounds on load or delay loading of streams.  

Personally I don’t even attempt to load audio until a major chunk of my game is loaded and then I fade sound in over 10 seconds. No one like an app “shouting at them” immediately.

adrianm, i did setVolume to 0…it didnt’ resolved the problem.

Rob, if you read my first post i said i used a timer…but now (after upgrade corona) that problem still exist even with 1000 delay timer.

the music on the background is not harsh it’s a background music…and like a background music it can be muted on the app.

the click noise happens before any of my code kicks off. it is before splash screen. my code starts with a blank file only for copy database to tempory directory for r/w. prepare a bunch of other data, only then i pass to main main screen where i declare my music and play it if on my database is true. so i give plenty of time to the app to do it’s “magic”. 

like i said this only happens in IOS and with a couple of lines i could reproduce the problem.

not trying to offend anyone, because i really appreciate from my heart the work corona staff and members from this community do for others, but this problem remember me a joke about a person that gone to the doctor and asked him…“doctor, if i press here it hurts”. doctor response: “well, don’t press it”…

regards, carlos :wink:

p.s: bug report {8488245}

That doesn’t sound right.  You could call audio.setVolume(0) before you load your files and then reset it after.

thanks adrianm for the tip, i will try. but still it seams more than a workaround for the problem like i did with the timer than a proper solution, because it works well on simulator/android devices, and not on IOS. some times it only make the click sound only first time i run the app, second time will not do it…which is more wierd.

well tried everything but the bug still there. and worst now after i upgraded corona, the timer workaround don’t work. and the 

audio.setVolume(0) or setMaxVolume(0) or with both don’t work. it only happen once, the first time the app runs. i will try to isolate the code and make a bug report if it’s the case. but corona staff could look around the audio code…since this only happen on IOS device and not on android or any Mac or Windows build.

There was a fix in 3060 that addressed some audio issues:

  • iOS, Core: fixing issue when audio failed to load under certain conditions (splash screen, app being suspended, etc)

Are you using a build later than 3060 or before?

 

Rob

I’m using version 3068, and problem is still there. but very hard to detect because if i strip down the code to a bare minimum (only declare the files and play them) the problem disappear. with exact same files. if the code gets complicated it will appear. the rest of the code there is nothing about sound, its only about creating images and displaying them. it seams like the code tries to do lots of things same time, and in the sound department when things are going it messes something.

well with simple code i managed to replicate the problem. i just needed to put the splash screen on build.settings and the “click” sound at the beginning of the app appears.

i don’t think its related to splash screen, and i don’t know if it’s related to build.settings, because i did replicate the problem without splash screen, and with plugins in build.settings. and i also could reproduce the problem without plugins and without splash screen, only with my code.

i sent a bug report with all the files needed to replicate the problem (with splash screen, its easier to reproduce). hope you will figure it out.

some sound files can “hide” the problem. if the sound file doesn’t start with a sound at 0.00s the click sound wont happen.

I didn’t see a bug report come in. Please email it to support AT coronalabs.com

Is there a reason you’re trying to play a sound that early?

Rob

sent the bug report to the email you requested.

i just want to play a background sound when my app starts. is that asking to much? i don’t want a sound before splash screen or during it.

the problem is that i ear a clicking sound before the splash screen (and it should not happen that). it seams that the music starts, closes 1 split of a second later…then it shows the splash screen…and when app starts it starts the music like it should.

i don’t have this problem on android, simulator or windows builds, only on IOS builds. and sometimes only first time i run the app which is more strange. but is a loud sound and it’s annoying.

if the sound file have an initial second of silence it will “hide” the problem, but it’s still there…but you don’t ear it. in this case i can’t change the sound file because it’s not mine, and i can’t change it. what i can and i will is credit the author of the music.