From 2ce87e8cce1ab8041afb78cd9c316fd914410ede Mon Sep 17 00:00:00 2001 From: Kai Date: Fri, 13 Feb 2026 16:20:44 +0100 Subject: [PATCH] Set default mic gain to 2.0 and remove loopback monitor gain --- include/secrets.example.h | 6 ++---- src/main.cpp | 6 +----- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/include/secrets.example.h b/include/secrets.example.h index 23c5f5f..f129e1a 100644 --- a/include/secrets.example.h +++ b/include/secrets.example.h @@ -27,9 +27,7 @@ static constexpr bool EVS_SERIAL_COMMAND_ECHO = true; static constexpr bool EVS_MIC_USE_RIGHT_CHANNEL = false; // 24-bit sample to 16-bit conversion shift. Start with 8. static constexpr int EVS_MIC_S24_TO_S16_SHIFT = 8; -// Digital mic gain (avoid clipping). Typical 0.2 .. 0.8. -static constexpr float EVS_MIC_GAIN = 0.35f; -// Extra gain only for local loopback monitor path. -static constexpr float EVS_LOOPBACK_MONITOR_GAIN = 0.35f; +// Digital mic gain (project default). +static constexpr float EVS_MIC_GAIN = 2.0f; #endif // EVS_SECRETS_H diff --git a/src/main.cpp b/src/main.cpp index b699f54..92455b0 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -11,7 +11,6 @@ static constexpr bool kSerialCommandEcho = EVS_SERIAL_COMMAND_ECHO; static constexpr bool kMicUseRightChannel = EVS_MIC_USE_RIGHT_CHANNEL; static constexpr int kMicS24ToS16Shift = EVS_MIC_S24_TO_S16_SHIFT; static constexpr float kMicGain = EVS_MIC_GAIN; -static constexpr float kLoopbackMonitorGain = EVS_LOOPBACK_MONITOR_GAIN; // --------------------------- // Project config @@ -447,10 +446,7 @@ void loop() { publishMicTelemetryIfDue(pcm16, sampleCount); } else if (g_mode == DeviceMode::LocalLoopback) { for (size_t i = 0; i < sampleCount; ++i) { - float v = (float)pcm16[i] * kLoopbackMonitorGain; - if (v > 32767.0f) v = 32767.0f; - if (v < -32768.0f) v = -32768.0f; - enqueuePcmSample((int16_t)v); + enqueuePcmSample(pcm16[i]); } } else { // idle