Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Getting PCM data from MP3/AAC/ALAC File
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting PCM data from MP3/AAC/ALAC File



Sorry to spam the list with already-answered questions.  Further poking around the list revealed that the answer lies on my own hard drive.  Kevin Avila's response to essentially the same question (May 1 2006) is quoted here for interest's sake.

The modern (and easy) way I would recommend to accomplish this task would be to use QuickTime 7's AudioExtraction APIs. Check out the ADC sample codes:


There is also some very good documentation on these APIs


The other method I would recommend is using CoreAudio's AudioConverter APIs.

sample: /Developer/Examples/CoreAudio/Services/AudioFileTools/
/Developer/Examples/CoreAudio/PublicUtility/CAAudioConverter

documentation: /Developer/Examples/CoreAudio/Documentation/AudioToolbox/AudioConverter/

Kevin Avila
DTS Audio Engineer
World Wide Developer Relations
Apple Computer, Inc.

Thanks Kevin!  Sorry list!

Daniel Staudigel

On Dec 17, 2008, at 3:14 PM, Daniel Staudigel wrote:

I am trying to get a PCM stream out of out of a generic audio file.  So far, I have tried:

1) Opening it with AudioFile, then trying to pipe it through a the appropriate AudioConverter, using AudioBufferFillComplexBuffer.  This fails either silently (when trying to play the PCM data), or crashes because of a buffer overrun during the conversion step

2) Opening it with ExtAudioFile with the Client format set to be the desired PCM data.  This fails either by playing completely garbled noise (not white noise, which is what I'd expect if it were playing MP3/AAC data as if it were PCM), or by playing nothing, or crashing in a similar buffer-overrun situation as above.

Poking around the lists I saw a reference to an old piece of sample code (ConvertFile?) that I can't get ahold of anymore.  Does anybody have this, or something similar?

This seems like it should be easy.  I am not familiar with CoreAudio or AudioToolbox, but I've spent enough hours on this that I am reaching out for help!

Cheers,

Daniel Staudigel

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Getting PCM data from MP3/AAC/ALAC File (From: Daniel Staudigel <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.