Re: [Java API] Downsampling with AudioConverters ?
Re: [Java API] Downsampling with AudioConverters ?
- Subject: Re: [Java API] Downsampling with AudioConverters ?
- From: Herbie Robinson <email@hidden>
- Date: Sun, 14 Sep 2003 17:46:31 -0400
>I am trying to convert data I receive directly from the AudioDevice
>through the ioProc with the AudioConverter. Unfortunately, the
>AudioConverter crashes each time with either a badParam or
>InvalidInputSize error... Actually, I'm trying to convert from 32bits
>floats into 16bits integers.
Easy way to convert 32bit float to 16-bit integers:
where sample is the 32-bit float,
short r = round(sample * 0x7FFF);
Don't need a convertor AU for that.
-ev
In general, conversions from float to fixed should be dithered.
Especially if the fixed point is less then 24 bits.
In the above case, the dither has to be applied after the multiply;
so, it can't be done using a plug-in beforehand. If you multiply by
0x8000 instead of 0x7FFF, then the dither could be applied before the
multiply (because multiplying by a power of two would just change the
exponent, and no truncation error would get into the mantissa).
--
-*****************************************
**
http://www.curbside-recording.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.