• 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
ExtAudioFile API crash when reading compressed file with different sample rate
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ExtAudioFile API crash when reading compressed file with different sample rate


  • Subject: ExtAudioFile API crash when reading compressed file with different sample rate
  • From: Michael Tyson <email@hidden>
  • Date: Sun, 28 Aug 2011 18:59:55 +0200

Hi!

Guys, my brain hurts.  I'm having a some real trouble loading compressed audio files using the ExtAudioFile API, when the files in question have a sample rate different to the target rate.

I'm trying to load the files into memory as 16-bit LPCM at 44.1k.  The code works like a charm with all files also at 44.1k, but at other rates, I'm seeing a crash in ExtAudioFileRead (specifically, in SRC_convert_table_i16_scalar_stereo, within AudioConverterFillComplexBuffer).

Here's the relevant code I'm using: http://pastebin.com/raw.php?i=E7YHRiXt (commented, also contains a backtrace of the crash)

And here's a tiny sample project that demonstrates the problem, with 44.1k and 48k sample MP3 files: http://resources.atastypixel.com/AudioFileLoadTest.zip

In summary, I'm:

1. Opening the source file, 
2. Obtaining kExtAudioFileProperty_FileDataFormat, 
3. Setting the target audio description to match the number of channels (otherwise it's 16 bit LCPM at 44.1k), 
4. Applying kExtAudioFileProperty_ClientDataFormat, 
5. Grabbing kExtAudioFileProperty_FileLengthFrames,
6. Allocating a buffer to hold the loaded audio (fileLengthInFrames * targetAudioDescription.mBytesPerFrame)
7. Performing one ExtAudioFileRead (cue crash, burn and hair loss here)

At present I'm assuming that the kExtAudioFileProperty_FileLengthFrames gives the length in the client data format (the docs seem pretty vague), but even assuming that it's giving it at the original sample rate, the crash still occurs.

So - does anyone have any ideas where I'm going wrong? Am I just doing something stupid?

Many thanks in advance!

Michael
 _______________________________________________
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: ExtAudioFile API crash when reading compressed file with different sample rate
      • From: Michael Tyson <email@hidden>
  • Prev by Date: Re: iOS: Is it possible to have multiple parallel AUGraphs using a Remote-I/O Output Unit?
  • Next by Date: 'Unsupported num channels' warnings
  • Previous by thread: Rép : Measuring Input/Output latencies
  • Next by thread: Re: ExtAudioFile API crash when reading compressed file with different sample rate
  • Index(es):
    • Date
    • Thread