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:
,得到一个错误,哪个文件不存在.