A few months ago I had Corona on a Windows XP machine and while testing audio and testing a mute button in the app, the sound stopped working in the simulator. In fact, the sound driver crashed completely. I got it to work again, but even with an updated driver, the sound on that machine is messed up in some applications. At that time I thought it was just a freak coincidence for the driver to crash while I was testing mute button code. I did try other apps in the simulator, but found out the whole system couldn’t output audio. As for hardware failure, I’m not going to blame Corona. It’s an old laptop, so it’s on its last legs anyway.
Now I work on a Windows 7 machine and a few weeks ago was fixing up audio bugs in my app, including testing the mute button again. Again, similar situation. The sound in the simulator just simply stopped. I updated the version of Corona to the latest build, but there is still no sound. I’ve tested with many apps (mostly samples that have some audio) and older versions of my own apps.
I don’t know if I can reproduce the bug, but I did make a mistake in my code in both situations. I didn’t know that audio.volume() by itself could mute all sounds. Rather I was using the following code where ever sounds were played:
if soundToggle then
audio.play(fooSound)
end
In the options menu in my app I have a button that toggles the soundToggle boolean.
Now I’m using the correct code within the buttons function:
if soundToggle then
audio.volume(1)
else
audio.volume(0)
end
It’s an odd bug. Even the first incorrect method I was using to mute the sounds should still work fine and not cause a sound crash. So far the audio and muting are working on the simulator on my Mac. [import]uid: 10622 topic_id: 26534 reply_id: 326534[/import]