OSStatus error 2003334207 when using AVAudioPlayer

前端 未结 7 1232
野的像风
野的像风 2021-01-17 13:10

I am trying to play an MP3 file (works when played via VLC/iTunes) when a button is pressed. Here is my code:

     var audioPlayer: AVAudioPlayer!
     @IBAc         


        
相关标签:
7条回答
  • 2021-01-17 13:41

    In my case I was having the same issue and I found out that I needed to set this before start recording

    try AVAudioSession.sharedInstance().setCategory(AVAudioSessionCategoryPlayAndRecord)
    

    Hope it helps anyone

    0 讨论(0)
提交回复
热议问题