From 25e8c192daca60a33d96bc2fa9e46a19f89821a9 Mon Sep 17 00:00:00 2001 From: TobiasRoeddiger Date: Wed, 11 Sep 2024 14:49:38 +0100 Subject: [PATCH] added wav file logic --- assets/js/ChartManager.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/assets/js/ChartManager.js b/assets/js/ChartManager.js index 8d8d4d3..de7b7a9 100644 --- a/assets/js/ChartManager.js +++ b/assets/js/ChartManager.js @@ -215,7 +215,9 @@ function createWavHeader(dataLength, sampleRate, numChannels, bitsPerSample) { openEarable.sensorManager.subscribeOnSensorDataReceived((sensorData) => { if (sensorData.sensorId === SENSOR_ID.MICROPHONE) { if (recordMic) { - rawData.push(sensorData.rawByteData); // Append data if recording + // Drop the first 8 bytes and append the rest + var dataWithoutHeader = sensorData.rawByteData.slice(8); + rawData.push(dataWithoutHeader); } }