I don't if I am doing it right, but I am using this method to convert a byte array to float array as shown in this link :
public static float[] ConvertByteToFloat(byte[] array) {
float[] floatArr = new float[array.Length / 4];
for (int i = 0; i < floatArr.Length; i++) {
if (BitConverter.IsLittleEndian) {
Array.Reverse(array, i * 4, 4);
}
floatArr[i] = BitConverter.ToSingle(array, i * 4);
}
return floatArr;
}
the input array is an array containing wave raw data (with no header)
The problem is that i am getting (after conversion) values like :
-9.66012E+24, 1963.15576, -5.11384777E-36, -1.19718621E-07
How can I convert this array to a float array and its values should be between -1.0 and 1.0?
Edit:
my input array starts like this :
byte[] {
232,
255,
235,
255,
232,
255,
235,
255,
232,
255,
235,
255,
232,
255,
235,
255,
...
}