将 .wav 文件转换为 .mp3

发布于 2024-10-15 07:06:29 字数 96 浏览 3 评论 0 原文

我想将以 .wav 文件格式保存的音频文件转换为 .mp3 格式的文件。

请建议我如何通过 Objective C 编码来实现这一点。

提前致谢。

I want to convert an audio file saved with .wav file format to a file with .mp3 format.

Please suggest that how can I achieve this through Objective C coding.

Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(5

莫多说 2024-10-22 07:06:30

我认为 AVFoundation 中没有为此提供 API。我想如果你使用 AVAssetWritter 您可以编写 *.m4a (AVFileTypeAppleM4A) 文件,这些文件是 *.acc。 (ACC 比 mp3 更轻、更好,因此是 mp3 的一个很好的替代品)

如果您使用 CoreAudio 可能会需要很多工作,但应该可以写入 mp3。两年前,我问过如何在 apple-lists 中使用 coreaudio 读取 mp3,我得到了使 talkHere 示例应用程序能够读取 *.mp3 的代码;)

也许,您感兴趣:新手尝试播放 mp3 文件而不是 wav 文件

I don't think there is an API in AVFoundation for that. I think If you use AVAssetWritter you can write *.m4a (AVFileTypeAppleM4A) files which are *.acc, I believe. (ACC are lighter and better than mp3, so a good alternative to mp3)

If you use CoreAudio probably is going to be a lot much work but it should be possible to write mp3. I asked how to read mp3 using coreaudio in apple-lists like 2 years ago and I got code that makes speakHere sample app able to read *.mp3 ;)

Perhaps, you are interested: Newbie trying to play mp3 files instead wav files

绅士风度i 2024-10-22 07:06:30

CoreAudio 框架有一个名为扩展音频文件服务 的 API,它可以从一种格式转换为另一种格式。请参阅此处: http://developer.apple.com/library/ios/#samplecode/iPhoneExtAudioFileConvertTest/Introduction/Intro.html#//apple_ref/doc/uid/DTS40009222-Intro-DontLinkElementID_2

CoreAudio framework has an API called Extended Audio File Services, which enables converting from one format to another. See here: http://developer.apple.com/library/ios/#samplecode/iPhoneExtAudioFileConvertTest/Introduction/Intro.html#//apple_ref/doc/uid/DTS40009222-Intro-DontLinkElementID_2

国际总奸 2024-10-22 07:06:30

继 sbooth 关于 LAME 的回答之后,StackOverflow 上有一篇单独的文章,为您提供了为库创建 .a 所需的信息:
如何我将lame编译为iPhone的armv6和armv7的静态库(.a)?

完成后,按照LAME的文档进行操作就可以了。

Following on to sbooth's answer about LAME, there's a separate post on StackOverflow that gives you what you need to create a .a for the library:
How can I compile lame as static library(.a) for armv6 and armv7 of iPhone?

Once you have done that, follow LAME's docs and you're set.

别想她 2024-10-22 07:06:29

您必须使用 LAME 来执行此操作。由于专利问题,Apple 不提供 MP3 编码器。

You'll have to use LAME to do this. Apple doesn't ship an MP3 encoder due to patent issues.

沧笙踏歌 2024-10-22 07:06:29

Take a look at the AVFoundation framework, especially the AVAssetWriter class. It’s very powerful, but it takes some time to digest. There is a nice blog entry by Chris Adamson on decoding songs from the iPod library to PCM. It’s exactly the other way you want it, but it’s a good start.

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