AVAudioEngine inputNode installTap crash when restarting recording

后端 未结 5 1990
猫巷女王i
猫巷女王i 2020-12-14 18:59

I am implementing Speech Recognition in my app. When I first present the view controller with the speech recognition logic, everything works fine. However, when I try presen

5条回答
  •  猫巷女王i
    2020-12-14 19:35

    You can replace this code:

    let recordingFormat = node.outputFormat(forBus: 0)
    

    with the following:

    let recordingFormat = AVAudioFormat(standardFormatWithSampleRate: 44100, channels: 1)
    

    This code fixed the problem.

提交回复
热议问题