有没有办法在IOS swift中播放.amr文件?

Aby*_*hew 5 iphone ios swift ios8

我有一些amr格式的音频文件,我无法转换为任何其他格式,有没有办法在IOS中使用swift播放这些文件(AVFoundation)

我试过这段代码

var audioPlaying = AVAudioPlayer()
audioPlaying = AVAudioPlayer(contentsOfURL: NSURL(fileURLWithPath:
       NSBundle.mainBundle().pathForResource("music", ofType: "mp3")!), error: nil)
audioPlaying.play()
Run Code Online (Sandbox Code Playgroud)

但是当我使用"amr"in时ofType:,得到一个错误,哪个文件不存在.

Bha*_*vin 3

AMRApple不再支持格式(自iOS 4.3)。

如果你想播放录制一个,你必须使用一些工具(如opencore-amr库)来改变格式