• 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
Converted audio file, bit rate reported with afinfo
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Converted audio file, bit rate reported with afinfo


  • Subject: Converted audio file, bit rate reported with afinfo
  • From: Fredrik <email@hidden>
  • Date: Sat, 15 May 2010 17:17:31 +0200

Hi,

I've converted a file and get the wrong bit rate reported by afinfo. The input file is a 16bit 44.1 wav file, the output file is a 12 bit 26040hz caf file defined like this:

AudioStreamBasicDescription outputFormat;


outputFormat.mSampleRate = 26040;
outputFormat.mFormatID         = kAudioFormatLinearPCM;
outputFormat.mFormatFlags = kAudioFormatFlagIsSignedInteger | kAudioFormatFlagIsAlignedHigh;
outputFormat.mBytesPerPacket = 2;
outputFormat.mFramesPerPacket = 1;
outputFormat.mBytesPerFrame = 2;
outputFormat.mChannelsPerFrame = 1;
outputFormat.mBitsPerChannel = 12;


UInt32 outputBitRate = (outputFormat.mSampleRate * outputFormat.mBitsPerChannel); // 312480 


When using this bit rate in AudioConverterSetProperty with kAudioConverterEncodeBitRate, I get a 'prop' error. Setting the bit rate to 0 gives me this in afinfo, indicating that the output file is 16 bits.

infile:

File:           /Users/fred/desktop/kick.wav
File type ID:   WAVE
Data format:     1 ch,  44100 Hz, 'lpcm' (0x0000000C) 16-bit little-endian signed integer
                no channel layout.
estimated duration: 0.196 sec
audio bytes: 17248
audio packets: 8624
bit rate: 705600 bits per second
packet size upper bound: 2
audio data file offset: 44
not optimized

outfile:

File:           /Users/fred/desktop/spKick.caf
File type ID:   caff
Data format:     1 ch,  26040 Hz, 'lpcm' (0x00000014) 12-bit little-endian signed integer, unpacked in 2 bytes high-aligned
                no channel layout.
estimated duration: 0.196 sec
audio bytes: 10184
audio packets: 5092
audio 5092 valid frames + 0 priming + 0 remainder = 5092
bit rate: 416640 bits per second
packet size upper bound: 2
audio data file offset: 68
optimized
sound check:
    approximate duration in seconds          0.196

 _______________________________________________
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: Converted audio file, bit rate reported with afinfo
      • From: Doug Wyatt <email@hidden>
  • Prev by Date: Re: Does OS X limit USB audio devices to 16 bits of resolution?
  • Next by Date: Re: Changing System Audio Output - Notifications to Apps?
  • Previous by thread: Re: Does OS X limit USB audio devices to 16 bits of resolution?
  • Next by thread: Re: Converted audio file, bit rate reported with afinfo
  • Index(es):
    • Date
    • Thread