Package wavFiles
Class ByteConverterFloat32
java.lang.Object
wavFiles.ByteConverter
wavFiles.ByteConverterFloat32
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
bytesToDouble
(byte[] byteData, double[][] doubleData, int numBytes) Converts a byte array into a double array.int
doubleToBytes
(double[][] doubleData, byte[] byteData, int numSamples) Converts a double array into a byte array.Methods inherited from class wavFiles.ByteConverter
createByteConverter, createByteConverter
-
Constructor Details
-
ByteConverterFloat32
public ByteConverterFloat32()
-
-
Method Details
-
bytesToDouble
public int bytesToDouble(byte[] byteData, double[][] doubleData, int numBytes) Description copied from class:ByteConverter
Converts a byte array into a double array. The double array can be longer than required to hold the byte array in which case remaining doubles will be left untouched and not set to zero.- Specified by:
bytesToDouble
in classByteConverter
- Parameters:
byteData
- byte datadoubleData
- double data- Returns:
- number of doubles converted
-
doubleToBytes
public int doubleToBytes(double[][] doubleData, byte[] byteData, int numSamples) Description copied from class:ByteConverter
Converts a double array into a byte array. The byte array can be longer than required to hold the double data in which case remaining bytes will be left untouched and not set to zero.- Specified by:
doubleToBytes
in classByteConverter
- Parameters:
doubleData
- double databyteData
- byte data- Returns:
- number of bytes converted
-