xcode: How to save audio file after recording audio using AVFoundation

后端 未结 3 998
别跟我提以往
别跟我提以往 2021-02-02 04:29

I browsed through all kinds of post related to this topic but the answers just do not really help. I used this tutorial to implement recording of audio files and playback. What

3条回答
  •  闹比i
    闹比i (楼主)
    2021-02-02 05:18

    The problem is that when you tell XCode (in the viewDidLoad method) to [recorder prepareToRecord]; it gets rid of the previously recorded audio file. Eliminate that piece of code in the "if" statement and your audio file WILL be saved when you exit and come back in to the app.

提交回复
热议问题