如何播放AMR音频文件? [英] How to play an AMR audio file?
问题描述
我正在尝试播放.amr文件.
func prepareAudio() {
do {
self.audioPlayer = try AVAudioPlayer(contentsOfURL: NSURL(fileURLWithPath: NSBundle.mainBundle().pathForResource("welcome", ofType: "amr")!))
self.audioPlayer.play()
} catch {
print("Error")
}
}
输出
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
AMR编解码器已从3.2版的iOS中删除(我认为).啊,不是4.3(谢谢Eric D.).我唯一找到的参考文献是在开发论坛(需要登录)./p>
奇怪的是,在iOS 4.3中删除了 outPut
The AMR codec was removed from iOS in version 3.2 (I think). Ah no, 4.3 (thanks, Eric D.). The only reference I ever found to this was in the dev forums (login required). The strange thing is, while 这篇关于如何播放AMR音频文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!kAudioFormatAMR
时,看起来kAudioFormatAMR_WB
是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
kAudioFormatAMR
was removed in iOS 4.3, it looks like kAudioFormatAMR_WB
was added to OSX 10.10 (Yosemite).