Bijoy Thangaraj
Bijoy Thangaraj

Reputation: 5546

Convert .mp3 file to .wav or .caf in code in iOS

I am retrieving an MP3 file from the iPod Library and saving it to the application's Documents directory. I need to convert it to .wav or .caf so that I can use OpenAL or any other library to change the pitch of the audio.

Can this be done? Any assistance with code will be greatly appreciated.

Upvotes: 1

Views: 2523

Answers (1)

USS1994
USS1994

Reputation: 614

Take a look at the AVAssetWriter class. Also, check out this link, its not exactly what you want, but its a start.

http://www.subfurther.com/blog/2010/12/13/from-ipod-library-to-pcm-samples-in-far-fewer-steps-than-were-previously-necessary/

Note that it might be difficult to gain access to the user's actual file as that would require reaching out of your app's sandbox - something Apple doesn't allow.

Upvotes: 1

Related Questions