Converting Float32Array to Uint8Array while Preserving IEEE 754 Representation
问题 I have a float32Array from decodeAudioData method, which I want to convert it to Uint8Array while preserving the float32 IEEE 754 audio data . So far I tried, var length = float32Array.length; var emptyBuffer = new ArrayBuffer(length * 4); var view = new DataView(emptyBuffer); for (var i = 0; i < length; i++) { view.setFloat32(i * 4, float32Array[i], true); } var outputArray = new Uint8Array(length); for (var j = 0; j < length; j++) { outputArray[j] = view.getUint8(j * 4); } return