OSStatus error 2003334207 when using AVAudioPlayer

前端 未结 7 1248
野的像风
野的像风 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条回答
  •  梦毁少年i
    2021-01-17 13:28

    I also got this problem, after checking up the audio file url, found that it is stored in Cache directory. so audio player probably couldn't find audio file according to your "url".

    please ensure, the url path is under Document directory.

提交回复
热议问题