diff --git a/assets/js/OpenEarable.js b/assets/js/OpenEarable.js index 56fdf24..d6ef817 100644 --- a/assets/js/OpenEarable.js +++ b/assets/js/OpenEarable.js @@ -453,7 +453,9 @@ class SensorManager { const view = new DataView(data); view.setUint8(0, sensorId); view.setFloat32(1, samplingRate, true); - view.setUint32(5, latency, true); + view.setUint32(5, latency, true); + console.log("Writing Sensor Config") + console.log(data) await this.bleManager.writeCharacteristic( SERVICES.SENSOR_SERVICE.UUID, SERVICES.SENSOR_SERVICE.CHARACTERISTICS.SENSOR_CONFIGURATION_CHARACTERISTIC.UUID, diff --git a/assets/js/SensorManager.js b/assets/js/SensorManager.js index d67cbbf..f6cf32e 100644 --- a/assets/js/SensorManager.js +++ b/assets/js/SensorManager.js @@ -37,13 +37,14 @@ $(document).ready(function () { var microphoneSamplingRate = $('#microphoneSamplingRate').val(); log("Setting sampling rate for microphone: " + microphoneSamplingRate + " Hz"); if (openEarable.firmwareVersion === "1.4.0") { + // set gain negative to disable mic var gainInner = -1; var gainOuter = -1; if ($('#innerMicrophoneEnabled').is(':checked')) { - gainInner = $('#microphoneGain').val() + gainInner = $('#microphoneGainInner').val() } if ($('#outerMicrophoneEnabled').is(':checked')) { - gainOuter = $('#microphoneGain').val() + gainOuter = $('#microphoneGainOuter').val() } // Ensure gain values are in the range of int8 (-128 to 127) @@ -72,9 +73,11 @@ $(document).ready(function () { await openEarable.sensorManager.writeSensorConfig(2, 0, 0); // Uncheck the checkboxes - $('#areSensorsEnabled, #isMicEnabled, #isPressureSensorEnabled').prop('checked', false); + $('#areSensorsEnabled, #isMicEnabled, #isPressureSensorEnabled, #innerMicrophoneEnabled, #outerMicrophoneEnabled').prop('checked', false); // Reset the dropdowns to 0 $('#sensorSamplingRate, #microphoneSamplingRate, #pressureSensorSamplingRate').val('0'); + $('#microphoneGainInner').val('40'); + $('#microphoneGainOuter').val('40'); }); }); diff --git a/index.html b/index.html index a8bb04b..33a5d6a 100644 --- a/index.html +++ b/index.html @@ -205,9 +205,9 @@