• 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
Examples for AudioFileStream and AudioConverter?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Examples for AudioFileStream and AudioConverter?


  • Subject: Examples for AudioFileStream and AudioConverter?
  • From: Nick Zitzmann <email@hidden>
  • Date: Tue, 9 Sep 2008 12:41:18 -0600

OK, I've searched around Google, I've read through the ConvertFile sample source code, and now I need help. I am not new to Mac OS X programming, but I am very new to CoreAudio programming.

Does anyone have any sample code that effectively ties AudioFileStream and AudioConverter together?

Here's the story. I'm working with a file format that embeds MP3 data in it. The MP3 data can be of any size and length, from a full-length song to a split-second sound effect, and is often VBR I assume to conserve space.

So far I've got the AudioFileStream part working. AudioFileStream loads the data, I get the AudioStreamBasicDescription describing the MP3 data, and I pass that to AudioConverterNew() along with my output requirements - 44KHz native-endian 16-bit non-floating-point stereo linear PCM for loading into an AudioBuffer later on in the program's execution.

But now how do I process this correctly? I already tried the deprecated (and much simpler) AudioConverterFillBuffer(), and found out that it doesn't work with VBR data. Darn! So I tried AudioConverterFillComplexBuffer(), and I'm hopelessly lost with that function. The ConvertFile source code was kind of helpful, but it dealt with AudioFiles instead of AudioFileStreams, and there are some important differences between the two.

Also, AudioConverterGetProperty() is returning a ridiculous value when I try to get the kAudioConverterPropertyMaximumInputPacketSize for VBR packet sizes. The return value is 8192, which is kind of crazy considering some of these MP3s are less than a kilobyte in size.

So again, does anyone have any sample code I could follow? I could post my non-working code if requested...

Nick Zitzmann
<http://seiryu.home.comcast.net/>
S/MIME signature available upon request




_______________________________________________ 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: Examples for AudioFileStream and AudioConverter?
      • From: james mccartney <email@hidden>
  • Prev by Date: Re: Error 0xE00002EE with PCI audio driver
  • Next by Date: Re: Examples for AudioFileStream and AudioConverter?
  • Previous by thread: Re: Error 0xE00002EE with PCI audio driver
  • Next by thread: Re: Examples for AudioFileStream and AudioConverter?
  • Index(es):
    • Date
    • Thread