Speaker volume control

maxbraun
Posts: 1
Joined: Sat Dec 23, 2023 6:29 pm

Speaker volume control

Postby maxbraun » Sat Dec 23, 2023 7:15 pm

Hi!

I'm using an ESP32-S3-Korvo-2 (V3.1) and I was wondering how to adjust the speaker volume.

I'm able to run the pipeline_http_mp3 example (https://github.com/espressif/esp-adf/tr ... e_http_mp3) just fine. How would I adjust it to increase the volume?

I tried i2s_alc_volume_set(i2s_stream_writer, ...), but that call gives an error. I'm also not sure what values are valid.

Thanks!
Max

volksvorg
Posts: 3
Joined: Mon Feb 06, 2023 8:09 pm

Re: Speaker volume control

Postby volksvorg » Thu Jan 04, 2024 10:48 am

audio_hal_set_volume(board_handle->audio_hal, 100);

gyui21g
Posts: 3
Joined: Thu Mar 21, 2024 3:38 am

Re: Speaker volume control

Postby gyui21g » Sun Mar 31, 2024 2:20 pm

When making i2s_stream_writer initialization, configure the i2s_cfg.use_alc=true.

Code: Select all

ESP_LOGI(TAG, "[2.2] Create i2s stream to write data to codec chip");
    int player_volume=0;
    i2s_stream_cfg_t i2s_cfg = I2S_STREAM_CFG_DEFAULT();
    i2s_cfg.use_alc = true;
    i2s_cfg.volume = player_volume;
    i2s_cfg.type = AUDIO_STREAM_WRITER;
    i2s_stream_writer = i2s_stream_init(&i2s_cfg);

Who is online

Users browsing this forum: No registered users and 56 guests