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

前端 未结 4 1424
-上瘾入骨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:37

    I'm gonna take a wild stab at this since no-one else has answered (EDIT: now there is) (I don't have much experience with Audio in iOS) but...

    Try changing

    [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryRecord error:nil];
    

    to

    [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayAndRecord error:nil];
    

提交回复
热议问题