• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: where to start with converting an mp3 file to pcm
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: where to start with converting an mp3 file to pcm


  • Subject: Re: where to start with converting an mp3 file to pcm
  • From: Brian Willoughby <email@hidden>
  • Date: Mon, 19 Sep 2011 19:57:57 -0700

Agreed that expanding MP3 audio to an uncompressed files gains nothing. Agreed that ExtAudioFile is the best API for the original task. Also agreed that CAF is the best format choice unless you need Windows compatibility.

However, CAF is more than just a container file format. IMA4 is 4- to-1 compressed and surely has to be lossy, so you're better off using the 'native' sample format of CAF (I don't know whether there is a unique name for the native sample format of CAF, but it certainly isn't IMA4). CAF is also a container format, just like IFF/ FORM is the chunk container format for AIFF and RIFF is the chunk container format for WAV. CAF happens to use 64-bit chunks instead of 32-bit chunks.

IMA4 is just the typical example for Apple sample source, but even they do not recommend using it for production code.

Brian Willoughby
Sound Consulting


On Sep 19, 2011, at 15:30, Steven Winston wrote:
ExtAudioFile is definitely a good candidate to do this too.  I pointed
at Audio Queue due to the existing online doc.

I'd also point out that .caf is a container format;  I think what
you'd want is IMA4.

On Mon, Sep 19, 2011 at 3:21 PM, Chris Adamson <email@hidden> wrote:
Agreed with Steven that the premise seems dubious in the first place.

That said, directly using the Audio Conversion functions would be more direct than an Audio Queue, although it's not as easy to find good docs or sample code. We do have an example in the book. You'd then have to write the PCM sample buffers to a file with Audio File Services.

The cleanest way to do it would be with an ExtAudioFile, which would give you MP3-to-PCM conversion and file I/O to the container of your choice(*) in one fell swoop.

(*) - if your app is the only thing that's ever going to read the converted files, I'd argue that .caf would be superior to .aiff or .wav.

--Chris

On Sep 19, 2011, at 5:06 PM, Steven Winston wrote:
Erm... why do you want to expand the file to PCM on the user's hard
drive? Why not keep it as mp3? You get the same quality as the fact
that it was mp3 at some point means there's already a degradation of
signal all you could possibly get is less time decoding it in
software; but nearly every device I can think of has hardware mp3
decoders; so that doesn't make sense either.
In any case; it's actually quite trivial to do. You can use offline
render from audio queue services. Documentation for that is online.


On Mon, Sep 19, 2011 at 1:59 PM, Morgan Packard <email@hidden> wrote:
Hello list,
I'd like to ship my app with mp3s and expand them to pcm files (aif or wav)
on the user's hard drive. I'd be grateful if anyone could point me toward
the most appropriate technologies for the job. Even better would be to point
me toward some sample code.
thanks!
-Morgan

_______________________________________________
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


  • Follow-Ups:
    • Re: where to start with converting an mp3 file to pcm
      • From: Morgan Packard <email@hidden>
References: 
 >where to start with converting an mp3 file to pcm (From: Morgan Packard <email@hidden>)
 >Re: where to start with converting an mp3 file to pcm (From: Steven Winston <email@hidden>)
 >Re: where to start with converting an mp3 file to pcm (From: Chris Adamson <email@hidden>)
 >Re: where to start with converting an mp3 file to pcm (From: Steven Winston <email@hidden>)

  • Prev by Date: Re: where to start with converting an mp3 file to pcm
  • Next by Date: iPad USB Audio Output
  • Previous by thread: Re: where to start with converting an mp3 file to pcm
  • Next by thread: Re: where to start with converting an mp3 file to pcm
  • Index(es):
    • Date
    • Thread