I have an audio application that I want to run when an application such as Pandora is running (iOS). I am doing the following to allow Pandora audio to be mixed with my application (this works great):
if audio.supportsSessionProperty == true then audio.setSessionProperty(audio.MixMode, audio.AmbientMixMode) end local isOtherAudioPlaying = false if audio.supportsSessionProperty == true then if not(audio.getSessionProperty(audio.OtherAudioIsPlaying) == 0) then isOtherAudioPlaying = true end end
Typically I start Pandora first then I start my application. The issue is that I am not able to adjust the volume of Pandora. When my clip of audio plays I would like to bring down the volume of Pandora then restore the volume when my audio clip is done. My audio clips typically are no longer than 5 seconds.
As a general test, without even trying to assign my audio to a specific audio channel I just tried to adjust the master volume by doing the following:
audio.setVolume(0.10)
This didn’t have any affect on the volume for Pandora. All of my testing is being done directly on my iPhone device. I have read through the bulk of the corona audio documentation, so I was surprised that I wasn’t to get this to work. Any help would be greatly appreciated.
To prevent my application from stopping when the iPhone goes into sleep mode I am doing the following (this works great as well):
-- Prevent device from going into sleep mode system.setIdleTimer(false)
Regards,
Steve