Please help in the sound behavior in the storyboard ?

Hi All,

I have designed one simple storyboard app to test how sound works when moving from one scene to another and then start again.

I am able to kickoff the sound in the first round but it is not working in the second time when the scene is re-created. I noticed sometime the sound volume lowered in the second time,

My scene movement is working like that : main.lua --> splash.lua then if you click in any button you will go to level.lua. In level.lua you can go back to splash.lua and vise versa. There are two types of background music in each scene (splash and level) just to simulate different levels.

the sound is working fine from splash.lua but when you move to level.lua,it is stopped. 

I tried to do a lot of sound disposals but no luck. I am attached my project files if some can have a look and advice

Regards

Abdulaziz

Can someone help in this topic ? :wacko:

This Corona tutorial is a great resource for sound management:

http://www.coronalabs.com/blog/2013/06/04/tutorial-handling-cross-scene-audio/

I read a lot of sound articles but i am not able to understand how to switch sounds off/on moving from one scene to another using the storyboard.

i was able to play sound and stop it but not withing scene movement, 

Here’s my exitScene function, within which I stop sound:

function scene:exitScene( event ) storyboard.purgeAll() storyboard.removeAll() audio.stop(6) end

The (6) above is the channel I have specified to the sound that was playing in this particular scene. It works well enough for me. Try to explicitly assign channels to your music and stop them using the stop call above.

Dear Panc,

i will try that but what do you mean by :

storyboard.purgeAll()
storyboard.removeAll()

will these remove everything in all scenes ?

Here are the API definitions for the two functions:

http://docs.coronalabs.com/api/library/storyboard/purgeAll.html

http://docs.coronalabs.com/api/library/storyboard/removeAll.html

Essentially I’m unloading every module except for the one I’m currently in. I’ve been using it since the start of my storyboard utilization so I can’t say I’ve noticed an increase in performance, because I don’t have a control group to test against.

Can someone help in this topic ? :wacko:

This Corona tutorial is a great resource for sound management:

http://www.coronalabs.com/blog/2013/06/04/tutorial-handling-cross-scene-audio/

I read a lot of sound articles but i am not able to understand how to switch sounds off/on moving from one scene to another using the storyboard.

i was able to play sound and stop it but not withing scene movement, 

Here’s my exitScene function, within which I stop sound:

function scene:exitScene( event ) storyboard.purgeAll() storyboard.removeAll() audio.stop(6) end

The (6) above is the channel I have specified to the sound that was playing in this particular scene. It works well enough for me. Try to explicitly assign channels to your music and stop them using the stop call above.

Dear Panc,

i will try that but what do you mean by :

storyboard.purgeAll()
storyboard.removeAll()

will these remove everything in all scenes ?

Here are the API definitions for the two functions:

http://docs.coronalabs.com/api/library/storyboard/purgeAll.html

http://docs.coronalabs.com/api/library/storyboard/removeAll.html

Essentially I’m unloading every module except for the one I’m currently in. I’ve been using it since the start of my storyboard utilization so I can’t say I’ve noticed an increase in performance, because I don’t have a control group to test against.