Re: Calculating peak level in db
Re: Calculating peak level in db
- Subject: Re: Calculating peak level in db
- From: Brian Willoughby <email@hidden>
- Date: Sat, 12 Oct 2002 15:04:28 -0700
[ Does this mean my assuption is wrong, that the maximum sample
[ value I can get is 1.0?
[ And if it's wrong, which is the maximum sample valus I might get?
CoreAudio uses floating point, which is rather new in digital recording.
Floating point has the advantage of hiding the detail of whether you have 8
bit, 16 bit, or 24 bit samples. The defined range is -1.0 to 1.0, but due to
the way that binary fixed point numbers work, you'll never precisely reach 1.0
although you should still calculate as if you expect to get 1.0 (you *can* get
-1.0, however). See the CoreAudio list archives for code examples.
e.g. 16 bit samples range from -32768 to 32767 in fixed point. The -32768
maps precisely to -1.0 in CoreAudio, but the 32767 doesn't quite reach 1.0
exactly, although it gets closer to 1.0 than an 8 bit sample would. I suppose
24 bit sampling would approach 1.0 even closer :-) NOTE: the 32 bit floats in
CoreAudio probably cannot handle more than 24 bit samples, at least not while
preserving full accuracy (not that I've seen any equipment that samples beyond
24 bit).
Brian Willoughby
Sound Consulting
_______________________________________________
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.