I found a related topic here http://forums.coronalabs.com/topic/40965-getting-an-audio-error-in-terminal-regarding-channel-0/, however it didn’t really answer my question so I figured I’d bring it up again.
I have 2 questions. My app has a main menu with background music. Then you can start a new game and I stop the background music and start game music. I have the menu music set to channel 10 and the in-game music set to channel 1. I also have a few other sounds (button clicks, error sounds, and victory music) that play.
So the first question I have is about disposing sounds. I obviously don’t want to use up a ton of memory, but I wasn’t sure if i needed to dispose of the sounds if they’re consistently being used. For instance, if I’m using button clicks on the main menu, then go into a new game where there are also buttons that make sounds, and an in-game menu that also has buttons, when should I dispose of these sounds? After every time they’re called, or just in between scenes?
What about the music? Both musics use LoadStream, and they’re set on loops for the appropriate pages they play on. When I exit the game, I do an audio.stop(1), but should I also nil it out and dispose it? Should I do the same for the main menu music?
The second part is related to the streaming music. I’ve been messing around with it and no matter how I set things, the same error occurs. When I load the game for the first time, the main menu music stops, the in-game music starts. Then if I leave the game, the music flips back over again like it should. When I re-enter the game again, the music does not start back up, but instead throws an error that the “Requested channel 0 is in use”. Is that because I did not dispose of things properly the first time?
I can post code sections if it helps. But I think my main issue is I wasn’t sure how/when to dispose of music and sounds if they’re being called up a lot.