changing audio session category
changing audio session category
- Subject: changing audio session category
- From: Paul Brossier <email@hidden>
- Date: Thu, 2 Sep 2010 03:24:58 +0200
Hello,
I am trying have a remote IO audio unit switch from PlayAndRecord to
MediaPlayback category when a headset is unplugged, and back to PlayAndRecord
when it is plugged. This is needed since starting a unit in PlayAndRecord fails
in iOS >= 3.1.
The aurioTouch example needs to be updated to switch categories. Also it still
disposes and recreate the audio unit in its property listener, which doesn't
seem required anymore.
I have several problems:
- depending on the load of the device, the property and interruption listeners
sometimes are not called at all. In some case, the ignored calls are
postponed and the listener is then called several times in a row.
- on unplugging the headset, the interruption listener gets a spurious
kAudioSessionBeginInterruption. It can be ignored by reactivating the
session when no microphone is present, but the sound is then paused for a few
seconds.
- while the above workaround somewhat works on an iPod2,1 running iOS 3.1.3,
on iOS 4.0.2 the call to AudioUnitRender fails after switching from
kAudioSessionCategory_MediaPlayback to kAudioSessionCategory_PlayAndRecord,
returning a kAudioUnitErr_CannotDoInCurrentContext error. Restarting the unit
doesn't help.
What is the correct approach to quickly switch from one category to another?
Why was it required to fail starting the unit in PlayAndRecord category without
microphone?
How can I ensure both property and interruption callbacks are called, no matter
what? Are they thread safe?
Is there a way to downgrade the firmware to test on several iOS version?
Thanks!
Paul
_______________________________________________
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