Audio session interrupted when unplugging a mic (iPod Touch 2G)
Audio session interrupted when unplugging a mic (iPod Touch 2G)
- Subject: Audio session interrupted when unplugging a mic (iPod Touch 2G)
- From: Zachary Kulis <email@hidden>
- Date: Wed, 17 Mar 2010 21:43:22 -0400
I've come across some strange behavior with the iPod Touch 2G when
disconnecting an external microphone. I'm using the Remote IO unit, and
I've implemented both an audio route change callback and an audio
session interruption callback (using the C API).
When I start the iPod with a mic disconnected, I activate the
kAudioSessionCategory_MediaPlayback category, and everything works fine.
When I connect a headset, the audio route change callback is invoked,
and I perform the following steps:
1) Stop and dispose of the Remote IO instance
2) Change the audio session category to kAudioSessionCategory_PlayAndRecord
3) Reconfigure the Remote IO appropriately (enable input callback)
4) Reactivate the audio session and start the Remote IO
In this case, everything works fine--audio continues to play through the
headphones when the headset is connected. When I disconnect the headset,
I repeat the same steps as above, except that the audio session category
is set to kAudioSessionCategory_MediaPlayback and recording is disabled
on the Remote IO.
The odd thing is, audio starts to play for a short time (about 500 ms)
through the iPod's external speaker. Then, the audio session
interruption callback is invoked with the interruption state set to
kAudioSessionBeginInterruption. The audio stops playing and I never
receive another audio session interruption callback indicating that the
interruption has ended. Also, I can repeat the process in succession and
get the same results each time (namely, that the interruption callback
is invoked with a "begin" interruption state each time that the headset
is connected and then disconnected in succession).
Does anyone know what might be causing this issue? Once it happens, I
can no longer get audio to play through any of the audio output
interfaces (i.e., line out, headphones, or the speaker).
Thanks very much,
Zach
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden