AudioConverter format not supported error
AudioConverter format not supported error
- Subject: AudioConverter format not supported error
- From: Robert Grant <email@hidden>
- Date: Wed, 13 Aug 2003 14:05:34 -0400
I'm delving into the realm of AudioFiles and AudioConverters because
QuickTime's AIFF support stops short at 48000 Hz and 16 bits.
So I'm trying to build an AudioConverter that'll take a non-interleaved
32 bit float stereo buffer and convert it into interleaved 16 bit
integer stereo.
Trouble is I'm getting a 'fmt?' error but I'm not sure which format is
causing trouble. Of course my ignorance is a major factor :-)
Here are the two ASBDs:
sampleRate = 44100; // I want to support various sample rates
bitDepth = 16; // I want to support 24 bits too.
The AIFF format:
AudioStreamBasicDescription inFormat;
inFormat.mSampleRate = sampleRate;
inFormat.mFormatID = kAudioFormatLinearPCM;
inFormat.mFormatFlags = kLinearPCMFormatFlagIsBigEndian;
inFormat.mBytesPerPacket = 2 * (bitDepth / 8);
inFormat.mFramesPerPacket = 1;
inFormat.mBytesPerFrame = 2 * (bitDepth / 8);
inFormat.mChannelsPerFrame = 2;
inFormat.mBitsPerChannel = bitDepth;
The Float format:
AudioStreamBasicDescription rwFormat;
rwFormat.mSampleRate = sampleRate;
rwFormat.mFormatID = kAudioFormatLinearPCM;
rwFormat.mFormatFlags = kLinearPCMFormatFlagIsNonInterleaved |
kLinearPCMFormatFlagIsFloat;
rwFormat.mBytesPerPacket = 4;
rwFormat.mFramesPerPacket = 1;
rwFormat.mBytesPerFrame = 4;
rwFormat.mChannelsPerFrame = 2;
rwFormat.mBitsPerChannel = 32;
Create a new audio converter with these formats gets me a 'fmt?' error.
Thanks,
Robert.
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.