• 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 + AudioConverter issues
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

AudioFile API + AudioConverter issues


  • Subject: AudioFile API + AudioConverter issues
  • From: Benjamin Golinvaux <email@hidden>
  • Date: Tue, 18 Feb 2003 16:17:56 +0100

hi

I'm doing this :

- open a .cdda file (little endian aifc) using the AudioFile API
- retrieve its format into streamBasicDesc

the format is as follows :

(gdb) p streamBasicDesc
$1 = {
mSampleRate = 44100,
mFormatID = 1819304813, <--- 'lpcm'
mFormatFlags = 14, <--- kAudioFormatFlagIsAlignedHigh || kAudioFormatFlagIsSignedInteger
mBytesPerPacket = 4,
mFramesPerPacket = 1,
mBytesPerFrame = 4,
mChannelsPerFrame = 2,
mBitsPerChannel = 16,
mReserved = 49311760
}

Then I do this :

targetStreamDesc = streamBasicDesc;
targetStreamDesc.mFormatFlags = kAudioFormatFlagsNativeFloatPacked;
targetStreamDesc.mBytesPerPacket = streamBasicDesc.mChannelsPerFrame*sizeof(float);
targetStreamDesc.mBytesPerFrame = streamBasicDesc.mChannelsPerFrame*sizeof(float);
targetStreamDesc.mBitsPerChannel = 8*sizeof(float);

then

st = AudioConverterNew(&streamBasicDesc, & targetStreamDesc, &fTheConverter);

The problem is : although every call returns noErr and everything seems to behave correctly,
the float data I receive (using AudioConverterConvertBuffer) seems to be bogus : it's really
white noise, as if maybe some bytes were shuffled.

Did someone successfuly convert aifc little endian (cdda) files using the AudioConverter ?

Thanks.

Please note I'm using AudioFileReadPackets to feed the converter instead of AudioFileReadBytes :
is this a problem ?

Benjamin Golinvaux
www.arboretum.com
_______________________________________________
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.

  • Prev by Date: Using AudioDeviceRead?
  • Next by Date: Re: when to set kAudioUnitProperty_MaximumFramesPerSlice
  • Previous by thread: Re: Using AudioDeviceRead?
  • Next by thread: AudioFile API + AudioConverter issues (2)
  • Index(es):
    • Date
    • Thread