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

查看:72
本文介绍了如何从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)

谢谢!

推荐答案

我正面临着同样的问题.不幸的是,没有iOS框架(AVFoundation,CoreMedia等)支持对MP3的编码.

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

类似问题的答案建议使用 Lame Encoder

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天全站免登陆