• 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
Changing bit depth when writing to ALAC format
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Changing bit depth when writing to ALAC format


  • Subject: Changing bit depth when writing to ALAC format
  • From: iain <email@hidden>
  • Date: Sun, 22 Dec 2013 01:00:26 +0000

(Apologies for the cross posting with devforums)
I'm storing my audio data in memory as non-interleaved float, and I'm using ExtAudioFile to encode it to both AIFF and ALAC. The resulting files are both playable and contain the correct data when decoded, but the ALAC file is almost twice the size of the AIFF file. (AIFF - 43.5MB, ALAC - 73.9MB). When I convert the AIFF file to ALAC using iTunes the file is only about 24MB.

Looking at the Finder Info window for each file the ALAC file I created does not have an entry for 'Bits per sample'. The AIFF file and the iTunes generated ALAC both say 'Bits per sample: 16'.

From this, I'm guessing that the ALAC file I'm generating is using a higher bitrate than 16.

The code I'm using is:

_outputFormat.mSampleRate = 44100;
_outputFormat.mFormatID = kAudioFormatAppleLossless;
_outputFormat.mChannelsPerFrame = 2;
AudioFormatGetProperty(kAudioFormatProperty_FormatInfo, 0, NULL, sizeof(_outputFormat), &_outputFormat);

ExtAudioFileCreateWithURL(urlRef, kAudioFileM4AType, &_outputFormat, ...);

I've tried setting the mBitsPerChannel for my output ASBD after I call AudioFormatGetProperty, but it doesn't change anything.

Does anyone know how I can set the bitrate to 16, or if I've made some other mistake as to why the ALAC file is larger than the AIFF?

thanks,
iain

 _______________________________________________
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: Changing bit depth when writing to ALAC format
      • From: Eric Allamanche <email@hidden>
  • Prev by Date: AUSampler portamento
  • Next by Date: Re: AUSampler portamento
  • Previous by thread: Re: AUSampler portamento
  • Next by thread: Re: Changing bit depth when writing to ALAC format
  • Index(es):
    • Date
    • Thread