fix(audio): ensure mic unmuted and max gain on record - ES8311

- VoiceRecorder now explicitly unmutes input and sets 100% gain (24dB) after audio_stream_open_input
- Matches firmware fix c7dc66e0 BOTH complementary open + close ref-count
- Mp3Player/BookPlayer already using audio-stream for output (fixes fast playback)
This commit is contained in:
Adolfo
2026-07-18 20:13:14 -04:00
parent f07d347fd9
commit b2e9046438
+6
View File
@@ -184,6 +184,12 @@ static void record_task(void* arg) {
};
error_t err = audio_stream_open_input(ctx->stream_dev, &in_cfg, &ctx->input_handle);
if (err == ERROR_NONE) {
// Ensure mic is unmuted and at max gain (ES8311 0..24dB)
audio_stream_set_mute(ctx->stream_dev, AUDIO_CODEC_DIR_INPUT, false);
audio_stream_set_volume(ctx->stream_dev, AUDIO_CODEC_DIR_INPUT, 100.0f);
ESP_LOGI(TAG, "Mic unmuted, gain 100%%");
}
if (err != ERROR_NONE) {
ESP_LOGE(TAG, "audio_stream_open_input failed: %d", err);
fclose(f);