iOS - Playback of recorded audio fails with OSStatus error -43 (file not found)

前端 未结 4 1412
-上瘾入骨i
-上瘾入骨i 2021-01-03 03:54

I set up an AVAudioRecorder instance the following way when my view loads:

AVAudioSession *audioSession = [AVAudioSession sharedInstance];
audioSession.deleg         


        
4条回答
  •  醉梦人生
    2021-01-03 04:44

    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.

提交回复
热议问题