I have a strange issue where an iOS app that I have developed works fine when I build and run it from XCode on the device. However, on restarting the device and running the app, I get no audio at all. If I subsequently kill the app and restart it from the device, I start getting audio again. I initially thought it was an Interruption Handler issue, but am not sure any more. Any help would be appreciated!
Here's my interruption handler just in case.
static void MyInterruptionListener (void *inUserData,
UInt32 inInterruptionState) {
printf ("Interrupted! inInterruptionState=%ld\n", inInterruptionState);
pediViewController *pediController = (__bridge pediViewController*)inUserData;
switch (inInterruptionState) {
case kAudioSessionBeginInterruption:
CheckError (AudioOutputUnitStop (pediController.effectState.rioUnit),
"Couldn't start RIO unit");
case kAudioSessionEndInterruption:
// TODO: doesn't work!
CheckError(AudioSessionSetActive(true),
"Couldn't set audio session active");
CheckError (AudioOutputUnitStart (pediController.effectState.rioUnit),
"Couldn't start RIO unit");
break;
default:
break;
};
}