Skip to content

Commit

Permalink
added wav file logic
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiasRoeddiger committed Sep 11, 2024
1 parent 07b345c commit 25e8c19
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion assets/js/ChartManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down

0 comments on commit 25e8c19

Please sign in to comment.