如何在iPhone上播放AMR音频文件
我尝试使用 AVAudioPlayer
、 MPMoviePlayer
播放 AMR
文件,但无法播放它们。对于 AMR
文件,AVAudioPlayer
播放方法始终返回 NO
,并且 MPMoveiPlayer
会尽快发布 MPMoviePlayerPlaybackDidFinishNotification
正如它所演奏的那样。甚至尝试用 webview 玩 AMR
但没有成功。
还有其他方法可以播放 AMR
文件吗?根据这篇文章关于不同设备上的AMR音频文件播放问题< /a> iOS4.3以上不支持AMR
,但是邮件应用如何播放AMR
文件呢?
我尝试使用 ExtAudioFile
将 AMR
转换为 caf
文件,但收到错误代码 1718449215,我发现这意味着 kAudioFormatUnsupportedDataFormatError
。
I have tried using AVAudioPlayer
, MPMoviePlayer
to play AMR
files but unable to play them. AVAudioPlayer
play method always returns NO
for AMR
files and MPMoveiPlayer
post MPMoviePlayerPlaybackDidFinishNotification
as soon as it is played. Even tried to play play AMR
with webview but without success.
Is there any other way to play AMR
files. According to this post About AMR audio file playing issue on different devices iOS4.3 above does not support AMR
,but how can mail app can play AMR
files?
I tried converting AMR
to caf
file using ExtAudioFile
,but I am getting an error code 1718449215 which I found out that it means kAudioFormatUnsupportedDataFormatError
.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
即使这是一个老问题,我仍然没有答案。
相反,我的方法是提前转换为 Wave,使用 Github 中的以下库
https://github.com/justinjing/RecordWAVToAMRDemo/blob/master/AmrConvertAndRecord/VoiceConvert/VoiceConverter.mm
Even it is an old question, I still do not have an answer.
Instead, my way is converting to wave in advance, with the use of the following library from Github
https://github.com/justinjing/RecordWAVToAMRDemo/blob/master/AmrConvertAndRecord/VoiceConvert/VoiceConverter.mm