I am trying to play an .amr file.
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
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 kAudioFormatAMR
was removed in iOS 4.3, it looks like kAudioFormatAMR_WB
was added to OSX 10.10 (Yosemite).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With