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

Re: Converted audio file, bit rate reported with afinfo


  • Subject: Re: Converted audio file, bit rate reported with afinfo
  • From: Fredrik <email@hidden>
  • Date: Mon, 17 May 2010 19:48:16 +0200

  

With AudioConverter, the bit rate property only applies to certain codecs, never PCM.

12 bits, unpacked, aligned high is essentially the same as 16-bit with the lower 4 bits clear.


Thanks for clarifying that Doug. This is what I'm trying to accomplish here I'm planning to send this of to a sampler, but I have doubts that this is what gets to the file. BTW, I'm only writing this to the file to confirm that the format is correct at this point. It will remain in the buffer later on. I have tried to print each sample in binary representation to the terminal to confirm that the low 4 bits are zero and it, appears that all 16 bit's are still used. 

Calling:

CAShow(converter);

After the call to AudioConverterFillComplexBuffer, gives me this:

AudioConverter 0xe780001 [0x100113220]:
  PCMConverter2 0x0x1001134a0
    Input:   1 ch,  44100 Hz, 'lpcm' (0x0000000C) 16-bit little-endian signed integer
    Output:  1 ch,  44100 Hz, 'lpcm' (0x00000009) 32-bit little-endian float
  SampleRateConverter 0x0x10010e350
    Input:   1 ch,  44100 Hz, 'lpcm' (0x00000009) 32-bit little-endian float
    Output:  1 ch,  26040 Hz, 'lpcm' (0x00000009) 32-bit little-endian float
  PCMConverter2 0x0x100113630
    Input:   1 ch,  26040 Hz, 'lpcm' (0x00000009) 32-bit little-endian float
    Output:  1 ch,  26040 Hz, 'lpcm' (0x00000014) 12-bit little-endian signed integer, unpacked in 2 bytes high-aligned
 
A sample of what is printed to the terminal when I print each byte as bin from the resulting .caf file:

1111011110101010
1111011111010010
1111011110010110
1111011100011000

I then, as a test open up the file and do this to each sample (unsigned short) and write it back

buf[i] &= 0xfff0;

Which gives me this:

1111011110100000
1111011111010000
1111011110010000
1111011100010000

The file still plays fine and it appears that the low 4 bit's have now been cleared. 

Thanks.
 _______________________________________________
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

References: 
 >Converted audio file, bit rate reported with afinfo (From: Fredrik <email@hidden>)
 >Re: Converted audio file, bit rate reported with afinfo (From: Doug Wyatt <email@hidden>)

  • Prev by Date: iPhone "SpeakHere" sample and kAudioFormatMPEG4AAC
  • Next by Date: Re: Subscription problem
  • Previous by thread: Re: Converted audio file, bit rate reported with afinfo
  • Next by thread: DLSMusicDevice compatibility
  • Index(es):
    • Date
    • Thread