This is my method:
-(void) playOrRecord:(UIButton *)sender {
if (playBool == YES) {
NSError *error = nil;
NSString *filePath = [[NSBundle
If anywhere in your code you have this setup:
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:nil];
Change it to:
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayAndRecord error:nil];
Setting the wrong AVAudioSession category will cause record/play to fail.