I am working on an app that takes advantage of the video recorder of the iPhone 3GS, which is called by the UIImagePickerController with a mediaType of kUTTypeMovie and a sourceType of UIImagePickerControllerSourceTypeCamera (this basically makes the video camera come up instead of an image picker).
I would like to play a sound during the camera record. If I just have the picture picker or a picture camera, there is sound that plays throughout. But if I use the video camera, the sound starts, but fades out as the camera opens.
I started with just plain using AVAudioPlayer and experimenting with AudioSessions, but nothing gave me the required results. I then tried FMOD, but got the same results. So I’m thinking it is something within the UIImagePickerController that is silencing it.
My question for you, do you know of any way around this? Thanks!
- CuriousG asked 9 years ago
I do get the interrupt message. When the camera loads, I get:
FMOD: OutputCoreAudio::handleInterruption : Audio has been interrupted by an external event… stopping output.
FMOD: OutputCoreAudio::handleRouteChange : Audio route has change from ‘Speaker’ to ‘Speaker’ (Reason 4).
And then, when the camera quits, I get:
FMOD: OutputCoreAudio::handleRouteChange : Audio route has change from ‘SpeakerAndMicrophone’ to ‘Speaker’ (Reason 3).
FMOD: OutputCoreAudio::handleInterruption : External audio interruption has been resolved… restarting output.
I’m still investigating…
I would suggest linking with the logging version of FMOD. Look at the TTY output, if you see a message saying that FMOD output has stopped due to interruption then unfortunately there is nothing you can do.
The interruption API allows other application to take over control of the audio, if the movie camera is doing this then we can’t trump it. All that remains is log a feature request on the Apple bug tracker requesting audio mixing being allowed while recording movies.
I’ll give that a look and post up what I find. Hopefully there will be a message (what could I do if there’s no message?). I’ll also try to see if perhaps starting the audio after popping up the video recorder will do anything.
Please login first to submit.