iPhone SDK:是否可以处理本地库中的音频文件

发布于 2024-09-10 14:02:32 字数 1157 浏览 3 评论 0原文

好吧,我会尽力不让它成为一个“我只想要代码”的问题...

我最近正在开发一个项目,该项目需要对本地音乐文件(例如 iTunes 库)进行一些音频信号处理。整个工作包括:

  1. 获取音频文件的PCM数据(通常来自iTunes库); <--AudioQueue(?)
  2. 将PCM数据写入新文件(苹果似乎不允许直接修改音乐曲目); <--CoreAudio(?)
  3. 做一些处理和修改,如过滤器、操纵器等。 <-- 将用C++开发
  4. 播放处理后的曲目。 <--RemoteIO

问题是,在浏览了一些博客和讨论之后:

http://lists.apple.com/archives/coreaudio-api/2009/Aug/msg00100.htmlhttp://atastypixel.com/blog/using-remoteio-audio-unit/

http://osdir.com/ml/coreaudio-api/2009-08/msg00093.html

以及官方示例代码,我感觉 CoreAudio SDK 允许我们仅对从麦克风录制的语音演示应用音频处理

我的问题是:

  1. 我可以从 iTunes 库曲目而不是麦克风输入获取原始数据吗?
  2. 如果第一个问题是“否”,有没有办法“欺骗”SDK,让它认为它是从麦克风输入获取数据,而不是从 iTunes 获取数据? (我之前在 C# 中做过一些类似的“黑客”工作 XD)
  3. 如果整个处理不起作用,任何人都可以提供一些替代想法吗?

任何帮助将不胜感激。非常感谢:-)

谢谢。

Well, I will try best not to make it as a 'I just want the code' question...

I'm recently working on a project which requires some audio signal processing from local music files (e.g. iTunes Library). The whole work includes:

  1. Get the PCM data of an audio file (normally from iTunes library); <--AudioQueue (?)
  2. Write the PCM data to a new file (it seems that Apple does not allow direct modification on music tracks); <--CoreAudio(?)
  3. Do some processing and modification, like filters, manipulators, etc. <-- Will be developed in C++
  4. Play the processed track. <--RemoteIO

The problem is, after going through some blogs and discussions:

http://lists.apple.com/archives/coreaudio-api/2009/Aug/msg00100.html, http://atastypixel.com/blog/using-remoteio-audio-unit/

http://osdir.com/ml/coreaudio-api/2009-08/msg00093.html

as well as the official sample codes, I got a feeling that the CoreAudio SDK allow us to apply audio processing only on voice demos recorded from Mic.

My question is that:

  1. Can I get raw data from iTunes library tracks instead of Mic input?
  2. If the first question is 'No', is there a way to 'fool' the SDK to let it think it is getting data from Mic input, not from iTunes? (I have done some similar 'hacking' stuff in C# before XD)
  3. If the whole processing just doesn't work, can anyone provide some alternative ideas?

Any help will be appreciated. Thank you very much :-)

Thanks.

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

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

发布评论

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

评论(3

穿越时光隧道 2024-09-17 14:02:32

昨天刚发现一些很酷的东西。

从 iPhone 媒体库到 PCM 样本,需要经过数十个令人困惑、可能有损的步骤

(http://www .subfurther.com/blog/?p=1103

还有 MIT 的类库:

TSLibraryImport:Objective-C 类 + 用于在 iOS4 中从用户的 iPod 库导入文件的示例代码

http://bitbucket.org/artgillespie/tslibraryimport/changeset/a81838f8c78a

希望他们有所帮助!

干杯,

曼卡

Just found something really cool yesterday.

From iPhone Media Library to PCM Samples in Dozens of Confounding, Potentially Lossy Steps

(http://www.subfurther.com/blog/?p=1103

And also a class library by MIT:

TSLibraryImport: Objective-C class + sample code for importing files from user's iPod Library in iOS4.

(http://bitbucket.org/artgillespie/tslibraryimport/changeset/a81838f8c78a

Hope they help!

Cheers,

Manca

绝影如岚 2024-09-17 14:02:32

1) 不可以。Apple 不允许直接访问歌曲的 PCM 数据。否则你可以创建音乐共享应用程序,这不符合苹果的利益。

2) 不可以。由于Apple 的代码审批机制,黑客攻击和获得批准是不可能的。

3)我能想到的唯一选择是你必须在PC/Mac上完成处理部分,然后将其传输到iPhone。或者您必须将文件存储在您自己的应用程序文件夹中 - 您应该能够通过 CoreAudio 加载和处理这些文件。

1) No. Apple does not allow direct access to PCM data of songs. Otherwise you could create music-sharing apps, which is not in Apple's interests.

2) No. Hacking and getting approved is impossible due to Apple's code approval mechanism.

3) The only alternative I could think of is that you have to do the processing part on PC/Mac and then transfer it to the iPhone. Or you would have to store the files in your own applications folder - you should be able to load and process these via CoreAudio.

短暂陪伴 2024-09-17 14:02:32

我知道这个线程很旧但是...这对你有用吗,曼卡?这个应用程序获得批准了吗?

编辑:刚刚发现了自 iOS 4.1 以来引入的 AVAssetReader 类,应该会有所帮助

I know this thread is old but... did this work for you, Manca? And did this app get approved?

EDIT: just discovered the AVAssetReader class, introduced since iOS 4.1, should help

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