lib/minim/src/ddf/minim/javasound/FloatSampleTools.java
/**
	 * Conversion function to convert an interleaved float array to an
	 * interleaved byte array. The float array contains normalized samples in
	 * the range [-1.0f, +1.0f]. The output array will receive bytes in the
	 * format specified in <code>format</code>.
	 * <p>
	 * Only PCM formats are accepted. The method will convert all samples from
	 * <code>input[inOffset]</code> to
	 * <code>input[inOffset + (frameCount * format.getChannels()) - 1]</code>
	 * to byte values from <code>output[outByteOffset]</code> to
	 * <code>output[outByteOffset + (frameCount * format.getFrameSize()) - 1]</code>
	 * <p>
	 * Dithering should be used when the output resolution is significantly
	 * lower than the original resolution. This includes if the original data
	 * was 16-bit and it is now converted to 8-bit, or if the data was generated
	 * in the float domain. No dithering need to be used if the original sample
	 * data was in e.g. 8-bit and the resulting output data has a higher
	 * resolution. If dithering is used, a sensitive value is
	 * DEFAULT_DITHER_BITS.
	 * 
	 * @param input the audio data in normalized samples
	 * @param inOffset index in input where to start the conversion
	 * @param output the byte array that receives the converted audio data
	 * @param outByteOffset the start offset in <code>output</code>
	 * @param frameCount number of frames to be converted.
	 * @param format the output format. Only packed PCM is allowed
	 * @param ditherBits if 0, do not dither. Otherwise the number of bits to be
	 *            dithered
	 * @throws IllegalArgumentException if one of the parameters is out of
	 *             bounds
	 * @see #DEFAULT_DITHER_BITS
	 * @see #float2byte(List,int,byte[],int,int,AudioFormat,float)
	 */
Conversion function to convert an interleaved float array to an
interleaved byte array. The float array contains normalized samples in
the range [-1.0f, +1.0f]. The output array will receive bytes in the
format specified in format.

Only PCM formats are accepted. The method will convert all samples from
input[inOffset] to
input[inOffset + (frameCount * format.getChannels()) - 1]
to byte values from output[outByteOffset] to
output[outByteOffset + (frameCount * format.getFrameSize()) - 1]

Dithering should be used when the output resolution is significantly
lower than the original resolution. This includes if the original data
was 16-bit and it is now converted to 8-bit, or if the data was generated
in the float domain. No dithering need to be used if the original sample
data was in e.g. 8-bit and the resulting output data has a higher
resolution. If dithering is used, a sensitive value is
DEFAULT_DITHER_BITS.


Conversion function to convert an interleaved float array to an interleaved byte array . The float array contains normalized samples in the range [ - 1 . 0f + 1 . 0f ] . The output array will receive bytes in the format specified in format . Only PCM formats are accepted . The method will convert all samples from input [ inOffset ] to input [ inOffset + ( frameCount * format . getChannels () ) - 1 ] to byte values from output [ outByteOffset ] to output [ outByteOffset + ( frameCount * format . getFrameSize () ) - 1 ] Dithering should be used when the output resolution is significantly lower than the original resolution . This includes if the original data was 16 - bit and it is now converted to 8 - bit or if the data was generated in the float domain . No dithering need to be used if the original sample data was in e . g . 8 - bit and the resulting output data has a higher resolution . If dithering is used a sensitive value is DEFAULT_DITHER_BITS .
public static void float2byteInterleaved(float[] input, int inOffset,
			byte[] output, int outByteOffset, int frameCount,
			AudioFormat format, float ditherBits) {
		float2byteGeneric(input, inOffset, output, outByteOffset,
				format.getFrameSize() / format.getChannels(), frameCount
						* format.getChannels(), format, ditherBits);
	}
public static void float2byteInterleaved ( float [ ] input , int inOffset , byte [ ] output , int outByteOffset , int frameCount , AudioFormat format , float ditherBits ) { float2byteGeneric ( input , inOffset , output , outByteOffset , format . getFrameSize ( ) / format . getChannels ( ) , frameCount * format . getChannels ( ) , format , ditherBits ) ; }
Conversion function to convert an interleaved float array to an
 interleaved byte array.
Conversion function to convert an interleaved float array to an interleaved byte array .