0
0

Using an external mic on an iPod Touch with FMOD recording works fine if the mic is plugged in before the application starts. I’m having some trouble in this situation:

Mic is plugged in and application starts.
– everything is working fine at this point.

User unplugs the mic.
– I capture the event via Apple’s AudioSessionAddPropertyListener function.
– When the event fires, I tell FMOD to disable recording and free record buffers.
– After recording is stopped and buffers are freed, this is printed by FMOD –
FMOD: handleInterruption : Audio has been interrupted by an external event… stopping output.

User plugs the mic back in.
– AudioSessionAddPropertyListener callback fires again.
– I ask FMOD to start recording again. This returns an error.
– This is printed by FMOD –
FMOD: OutputCoreAudio::recordStart : Cannot initialize audio device. (err: 0)

Is there some trick to this or additional information I need to be able to restart recording in this situation?

This is also notable: I can’t roll my device firmware back to test this but I swear this code was working in OS 3.0 beta 5. I recently upgraded to OS 3.0 GM.

  • You must to post comments
0
0

I am actually working on this exact situation at the moment. Once I am finished you won’t need to use the property listener. Recording will pause if there is no input device available (i.e. mic was unplugged) then it will resume when the mic is reattached.

I will let you know when this has been finished and is working properly.

  • You must to post comments
0
0

Thanks, keep me posted.

  • You must to post comments
0
0

By the way, I still will want to respond to the property listener as I want to display some notification UI to the user. Will that still be possible in the update?

  • You must to post comments
0
0

Ok I have implemented the changes, they will be available with our next release (probably towards the end of the week). The recording will pause when you unplug a recording device if there are no other recording devices available. It will un-pause when you reinsert a recording cable device. Recording will also pause (not stop) when an interruption occurs now (like a phone call or alarm).

You may still hook the property listener for route change information, just don’t perform any FMOD functions in that callback as it will all be handled now.

  • You must to post comments
0
0

I’m playing out of the looping record buffer as well – a live mic that plays its input through the speakers. Will I need to stop playback of the channel when the mic is disconnected and replay it when it is connected or will that be handled automatically?

For my app it’s important to keep the playback latency as low as possible so I may need to reset the playback head when it is reconnected to ensure that.

  • You must to post comments
0
0

Yes you will need to handle any channel logic. Basically what you will see is the system record position will stop incrementing (no further data will be written to it) until the device is plugged back in.

  • You must to post comments
0
0

Hi there – has this been updated?

  • You must to post comments
0
0

Yes, this has been implemented and is currently available.

  • You must to post comments
Showing 8 results
Your Answer

Please first to submit.