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:
@@ -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);
|
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) {
|
if (err != ERROR_NONE) {
|
||||||
ESP_LOGE(TAG, "audio_stream_open_input failed: %d", err);
|
ESP_LOGE(TAG, "audio_stream_open_input failed: %d", err);
|
||||||
fclose(f);
|
fclose(f);
|
||||||
|
|||||||
Reference in New Issue
Block a user