Set default mic gain to 2.0 and remove loopback monitor gain
This commit is contained in:
@@ -27,9 +27,7 @@ static constexpr bool EVS_SERIAL_COMMAND_ECHO = true;
|
|||||||
static constexpr bool EVS_MIC_USE_RIGHT_CHANNEL = false;
|
static constexpr bool EVS_MIC_USE_RIGHT_CHANNEL = false;
|
||||||
// 24-bit sample to 16-bit conversion shift. Start with 8.
|
// 24-bit sample to 16-bit conversion shift. Start with 8.
|
||||||
static constexpr int EVS_MIC_S24_TO_S16_SHIFT = 8;
|
static constexpr int EVS_MIC_S24_TO_S16_SHIFT = 8;
|
||||||
// Digital mic gain (avoid clipping). Typical 0.2 .. 0.8.
|
// Digital mic gain (project default).
|
||||||
static constexpr float EVS_MIC_GAIN = 0.35f;
|
static constexpr float EVS_MIC_GAIN = 2.0f;
|
||||||
// Extra gain only for local loopback monitor path.
|
|
||||||
static constexpr float EVS_LOOPBACK_MONITOR_GAIN = 0.35f;
|
|
||||||
|
|
||||||
#endif // EVS_SECRETS_H
|
#endif // EVS_SECRETS_H
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ static constexpr bool kSerialCommandEcho = EVS_SERIAL_COMMAND_ECHO;
|
|||||||
static constexpr bool kMicUseRightChannel = EVS_MIC_USE_RIGHT_CHANNEL;
|
static constexpr bool kMicUseRightChannel = EVS_MIC_USE_RIGHT_CHANNEL;
|
||||||
static constexpr int kMicS24ToS16Shift = EVS_MIC_S24_TO_S16_SHIFT;
|
static constexpr int kMicS24ToS16Shift = EVS_MIC_S24_TO_S16_SHIFT;
|
||||||
static constexpr float kMicGain = EVS_MIC_GAIN;
|
static constexpr float kMicGain = EVS_MIC_GAIN;
|
||||||
static constexpr float kLoopbackMonitorGain = EVS_LOOPBACK_MONITOR_GAIN;
|
|
||||||
|
|
||||||
// ---------------------------
|
// ---------------------------
|
||||||
// Project config
|
// Project config
|
||||||
@@ -447,10 +446,7 @@ void loop() {
|
|||||||
publishMicTelemetryIfDue(pcm16, sampleCount);
|
publishMicTelemetryIfDue(pcm16, sampleCount);
|
||||||
} else if (g_mode == DeviceMode::LocalLoopback) {
|
} else if (g_mode == DeviceMode::LocalLoopback) {
|
||||||
for (size_t i = 0; i < sampleCount; ++i) {
|
for (size_t i = 0; i < sampleCount; ++i) {
|
||||||
float v = (float)pcm16[i] * kLoopbackMonitorGain;
|
enqueuePcmSample(pcm16[i]);
|
||||||
if (v > 32767.0f) v = 32767.0f;
|
|
||||||
if (v < -32768.0f) v = -32768.0f;
|
|
||||||
enqueuePcmSample((int16_t)v);
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// idle
|
// idle
|
||||||
|
|||||||
Reference in New Issue
Block a user