• 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
AudioFile API vs. IMA-in-WAV-type files
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

AudioFile API vs. IMA-in-WAV-type files


  • Subject: AudioFile API vs. IMA-in-WAV-type files
  • From: Evan Olcott <email@hidden>
  • Date: Thu, 8 Jun 2006 12:32:25 -0500

Trying to use the CAAudioFile API to read either of these files:

http://www.igorlabs.com/etc/dirtsurface1C.wav
http://www.igorlabs.com/etc/fort_cruise_missile16_11_looped_i.wav

Both of these files read and play with Quicktime Player.

When I ask for the stream format, I get no error return but the stream format comes up cleared out and empty... it's the last section here I call "set up audio convertor"
---
err = FSPathMakeRef((const UInt8 *)[fileName fileSystemRepresentation], &sourceFileRef, NULL);
if (err) goto _error;
err = AudioFileOpen(&sourceFileRef, fsRdPerm, 0, &importFileID);
if (err) goto _error;

// make import file buffer
size = sizeof(maxPacketSize);
err = AudioFileGetProperty(importFileID, kAudioFilePropertyMaximumPacketSize, &size, &maxPacketSize);
if (err) goto _error;
importFileBufferSize = maxPacketSize;
if (importFileBufferSize < 16) importFileBufferSize = 4096; // if PCM, make a respectable size
importFileBuffer = malloc(importFileBufferSize);

// get total number of packets
size = sizeof(totalPackets);
err = AudioFileGetProperty(importFileID, kAudioFilePropertyAudioDataPacketCount, &size, &totalPackets);
if (err) goto _error;


// set up audio convertor
size = sizeof(AudioStreamBasicDescription);
err = AudioFileGetProperty(importFileID, kAudioFilePropertyDataFormat, &size, &sourceFileFormat);
if (err) goto _error;
---
The other returns (max packet size, audio data packet count) seem to return valid enough values...anyone have any idea what I'm missing?


-ev

_______________________________________________
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: AudioFile API vs. IMA-in-WAV-type files
      • From: Doug Wyatt <email@hidden>
  • Prev by Date: Logic Live mode/PDC
  • Next by Date: Re: AudioFile API vs. IMA-in-WAV-type files
  • Previous by thread: Re: Logic-AU mailing address
  • Next by thread: Re: AudioFile API vs. IMA-in-WAV-type files
  • Index(es):
    • Date
    • Thread