• 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: AudioConverter format not supported error
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AudioConverter format not supported error


  • Subject: Re: AudioConverter format not supported error
  • From: Brad Ford <email@hidden>
  • Date: Wed, 13 Aug 2003 14:44:22 -0700

On 13. august 2003, at 20:05PM, Robert Grant wrote:
<SNIP>
Here are the two ASBDs:

sampleRate = 44100; // I want to support various sample rates
bitDepth = 16; // I want to support 24 bits too.


So this is your out:

The AIFF format:
AudioStreamBasicDescription inFormat;
inFormat.mSampleRate = sampleRate;
inFormat.mFormatID = kAudioFormatLinearPCM;
inFormat.mFormatFlags = kLinearPCMFormatFlagIsBigEndian;

Above is your problem. You've stated you want BigEndian, unsigned integer (because of the absence of the signed bit), aligned low (because of the absence of the packed bit or aligned high bit--doesn't make sense for 16 bit). Last I checked, Core Audio had no blitters for unsigned integer at bit depth != 8. So only mark unsigned if you're going to 8-bit integer (and you want unsigned). Instead, use:
inFormat.mFormatFlags = kAudioFormatFlagIsBigEndian | kAudioFormatFlagIsSignedInteger | kAudioFormatFlagIsPacked;

inFormat.mBytesPerPacket = 2 * (bitDepth / 8);
inFormat.mFramesPerPacket = 1;
inFormat.mBytesPerFrame = 2 * (bitDepth / 8);
inFormat.mChannelsPerFrame = 2;
inFormat.mBitsPerChannel = bitDepth;

And this is your in (which looks fine):

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.

AudioConverterNew(&rwFormat, &inFormat, &ac); // should now produce no errors.

-Brad Ford
QuickTime Engineering
_______________________________________________
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.

References: 
 >Re: AudioConverter format not supported error (From: "Mark's Studio" <email@hidden>)

  • Prev by Date: Re: [OT] PPC Float to Int
  • Next by Date: trying to build IOAudioFamily.kext from source
  • Previous by thread: Re: AudioConverter format not supported error
  • Next by thread: Re: AudioConverter format not supported error
  • Index(es):
    • Date
    • Thread