From 8cd3e85adfcad0e5cbece33cb53a80982e92ef3b Mon Sep 17 00:00:00 2001 From: pschatzmann Date: Sat, 2 Nov 2024 20:31:07 +0100 Subject: [PATCH] I2SCodecStream setInputVolume --- src/AudioTools/AudioLibs/I2SCodecStream.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/AudioTools/AudioLibs/I2SCodecStream.h b/src/AudioTools/AudioLibs/I2SCodecStream.h index 13467fae5..d955be3cf 100644 --- a/src/AudioTools/AudioLibs/I2SCodecStream.h +++ b/src/AudioTools/AudioLibs/I2SCodecStream.h @@ -169,6 +169,12 @@ class I2SCodecStream : public AudioStream, public VolumeSupport { return p_board->setPAPower(active); } + /// Sets the volume of the microphone (if available) + bool setInputVolume(float vol){ + if (!is_active || p_board == nullptr) return false; + return p_board->setInputVolume(100.0 * vol); + } + /// Provides the board AudioBoard &board() { return *p_board; } /// (re)defines the board