我正在尝试播放一个.amr文件。
func prepareAudio() {
do {
self.audioPlayer = try AVAudioPlayer(contentsOfURL: NSURL(fileURLWithPath: NSBundle.mainBundle().pathForResource("welcome", ofType: "amr")!))
self.audioPlayer.play()
} catch {
print("Error")
}
}outPut
ERROR: >aq> 327: AudioConverterNew from AudioQueueNew returned 'fmt?'
io: 1 ch, 8000 Hz, Float32
client: 1 ch, 8000 Hz, 'samr' (0x00000000) 0 bits/channel, 0 bytes/packet, 2400 frames/packet, 0 bytes/frame发布于 2015-12-20 12:11:55
iOS在3.2版中删除了AMR编解码器(我认为)。不,4.3 (谢谢,Eric D.)。我找到的唯一引用是在dev论坛中(需要登录)。
奇怪的是,虽然kAudioFormatAMR是在iOS 4.3中删除的,但看起来kAudioFormatAMR_WB是加入OSX 10.10 (约塞米蒂)。
https://stackoverflow.com/questions/34379968
复制相似问题