如何在iPhone上播放AMR音频文件

发布于 2024-12-21 05:36:55 字数 730 浏览 3 评论 0原文

我尝试使用 AVAudioPlayerMPMoviePlayer 播放 AMR 文件,但无法播放它们。对于 AMR 文件,AVAudioPlayer 播放方法始终返回 NO,并且 MPMoveiPlayer 会尽快发布 MPMoviePlayerPlaybackDidFinishNotification正如它所演奏的那样。甚至尝试用 webview 玩 AMR 但没有成功。

还有其他方法可以播放 AMR 文件吗?根据这篇文章关于不同设备上的AMR音频文件播放问题< /a> iOS4.3以上不支持AMR,但是邮件应用如何播放AMR文件呢?

我尝试使用 ExtAudioFileAMR 转换为 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

不喜欢何必死缠烂打 2024-12-28 05:36:55

即使这是一个老问题,我仍然没有答案。

相反,我的方法是提前转换为 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文