views:

295

answers:

2

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 :-)

=================

P.S. Is it possible under Android? Thanks.

A: 

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.

Marcel J.
Just found some solutions. Pls refer to my answer below :)
Manca
+2  A: 

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

Manca