如何从iOS设备的iPod库导出mp3文件? [英] How can I export an mp3 file from an iOS device's iPod library?

查看:192
本文介绍了如何从iOS设备的iPod库导出mp3文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的iOS应用程序中,我正在尝试将iPod库中的 mp3 文件导出到设备上的应用程序文档目录。目前我正在尝试使用 AVAssetExportSession ,但它不适用于 mp3 文件。它适用于 m4a 文件。

In my iOS application I'm trying to export an mp3 file from the iPod library to the app's documents directory on the device. Currently I'm trying to use AVAssetExportSession but it's not working for mp3 files. It works well for m4a files.


  • 是否可以使用AVAssetExportSession导出mp3文件?

  • Is exporting an mp3 file possible using AVAssetExportSession?

AVAssetExportSession适当的 outputFileType 是什么? ( AVFileTypeAppleM4A 适用于m4a文件)

What is the appropriate outputFileType for AVAssetExportSession? (AVFileTypeAppleM4A works for m4a files)

谢谢!

推荐答案

我面临同样的问题。不幸的是,非框架(AVFoundation,CoreMedia等)不支持MP3编码。

I am facing the same problem. Unfortunately, non of the iOS frameworks (AVFoundation, CoreMedia, etc) support encoding to MP3.

类似的回答问题建议使用 Lame Encoder 另一个问题提到某些用户能够成功编译成iOS(我刚尝试过为LAME构建静态库并确认它有效......)。

An answer to a similar question suggest using the Lame Encoder, and another question mentions that some user was able to compile is successfully for iOS ("I have just attempted to build the static library for LAME and confirmed that it 'works'...").

另一种选择是使用FFMpeg。似乎有些用户已成功为iOS 4.3编译它(请参阅此参考)。

Another alternative would be to go with FFMpeg. It seems like some users have successfully compiled it for iOS 4.3 (see this reference).

考虑到您可能需要为MP3编码支付版税。此外,FFMpeg / Lame的许可证可能会阻止您在闭源应用程序中使用其代码。

Take into account that you may have to pay royalties for encoding MP3. Also, the licenses for FFMpeg/Lame may prevent you from using their code in a closed-source application.

祝你好运!

这篇关于如何从iOS设备的iPod库导出mp3文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆