Hi, I just tried it out and it worked the first time I tried, but because it was kind of intermittent before, I tried again. The second time I saw the same error:
2010-07-20 10:14:39.353 AppName[1857:307] Denshion::CDAudioManager - Audio session interrupted
2010-07-20 10:14:39.356 AppName[1857:307] Denshion::CDAudioManager - Audio session set active 0 status = 0
... hung up the phone ...
2010-07-20 10:12:53.390 AppName[1837:307] Denshion::CDAudioManager - handled resign active
2010-07-20 10:12:58.457 AppName[1837:307] Denshion::CDAudioManager - Audio session resumed
2010-07-20 10:12:58.489 AppName[1837:307] Denshion::CDAudioManager - Audio session set active 1 status = 560161140
AudioStreamBasicDescription: 2 ch, 44100 Hz, 39;lpcm39; (0x00000C2C) 8.24-bit little-endian signed integer, deinterleaved
2010-07-20 10:12:58.495 AppName[1837:307] 10:12:58.495 <0x3e2b47c8> AUIOClient_StartIO failed (-12985)
I tried a few different methods of initializing SAE on my end - moving around the order of the calls, along with different modes:
#1: (failed 3 tries)
[[CDAudioManager sharedManager] setMode: kAMM_FxPlusMusicIfNoOtherAudio];
// note: no setResignBehavior used
SimpleAudioEngine *sae = [SimpleAudioEngine sharedEngine];
if(sae != nil) {
[sae preloadEffect:@"click_up.caf"];
[sae preloadEffect:@"click_down.caf"];
[sae preloadEffect:@"click_switch.caf"];
}
#2: (failed 3 tries)
[[CDAudioManager sharedManager] setMode: kAMM_FxPlusMusicIfNoOtherAudio];
[[CDAudioManager sharedManager] setResignBehavior:kAMRBStopPlay autoHandle:YES];
SimpleAudioEngine *sae = [SimpleAudioEngine sharedEngine];
if(sae != nil) {
[sae preloadEffect:@"click_up.caf"];
[sae preloadEffect:@"click_down.caf"];
[sae preloadEffect:@"click_switch.caf"];
}
This one output some additional debug info like so:
2010-07-20 10:14:39.353 AppName[1857:307] Denshion::CDAudioManager - Audio session interrupted
2010-07-20 10:14:39.356 AppName[1857:307] Denshion::CDAudioManager - Audio session set active 0 status = 0
... hung up the phone ...
2010-07-20 10:12:53.390 AppName[1837:307] Denshion::CDAudioManager - handled resign active
2010-07-20 10:12:58.457 AppName[1837:307] Denshion::CDAudioManager - Audio session resumed
2010-07-20 10:12:58.489 AppName[1837:307] Denshion::CDAudioManager - Audio session set active 1 status = 560161140
AudioStreamBasicDescription: 2 ch, 44100 Hz, 39;lpcm39; (0x00000C2C) 8.24-bit little-endian signed integer, deinterleaved
2010-07-20 10:12:58.495 AppName[1837:307] 10:12:58.495 <0x3e2b47c8> AUIOClient_StartIO failed (-12985)
... then my app39;s "applicationDidBecomeActive" debug messages ...
2010-07-20 10:27:20.793 AppName[1920:307] Denshion::CDAudioManager - Audio session set active 0 status = 0
2010-07-20 10:27:20.798 AppName[1920:307] Denshion::CDAudioManager - Other audio is not playing audio will be exclusive
2010-07-20 10:27:20.843 AppName[1920:307] Denshion::CDAudioManager - Audio session set active 1 status = 0
2010-07-20 10:27:20.897 AppName[1920:307] Denshion::CDAudioManager - Audio session set active 0 status = 0
2010-07-20 10:27:21.011 AppName[1920:307] Denshion::CDAudioManager - Audio session set active 1 status = 0
2010-07-20 10:27:21.015 AppName[1920:307] Denshion::CDAudioManager - audio manager handled become active
And then there was no audio again.
#3: (failed 3 tries)
[[CDAudioManager sharedManager] setMode: kAMM_FxOnly];
[[CDAudioManager sharedManager] setResignBehavior:kAMRBStopPlay autoHandle:YES];
SimpleAudioEngine *sae = [SimpleAudioEngine sharedEngine];
if(sae != nil) {
[sae preloadEffect:@"click_up.caf"];
[sae preloadEffect:@"click_down.caf"];
[sae preloadEffect:@"click_switch.caf"];
}
#4: This way seemed to work the most out of the 4 (failed 2 out of 4 tries)
[[CDAudioManager sharedManager] setMode: kAMM_FxOnly];
// note: no setResignBehavior used
SimpleAudioEngine *sae = [SimpleAudioEngine sharedEngine];
if(sae != nil) {
[sae preloadEffect:@"click_up.caf"];
[sae preloadEffect:@"click_down.caf"];
[sae preloadEffect:@"click_switch.caf"];
}
This worked fine twice, but on the third and fourth tries I got the same error (-12985).
Let me know if you want me to try any other configurations. Thanks!