I set up an AVAudioRecorder instance the following way when my view loads:
AVAudioSession *audioSession = [AVAudioSession sharedInstance];
audioSession.deleg
You may need to set the AVAudioSession category back to playback mode:
NSError *_error = nil;
[[AVAudioSession sharedInstance] setCategory: AVAudioSessionCategoryPlayback error:&_error];
if (_error) {
// handle error here
}
This should also avoid the problem where the audio will not play with the mute switch toggled on.