From c518b0d535ae8118da8a7d0d0c1b18bab7a47447 Mon Sep 17 00:00:00 2001 From: Vektor Date: Thu, 26 Oct 2023 15:38:04 +0200 Subject: [PATCH] fix volume setter --- src/CSoundInput.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/CSoundInput.cpp b/src/CSoundInput.cpp index 4274e61..0816a9e 100644 --- a/src/CSoundInput.cpp +++ b/src/CSoundInput.cpp @@ -44,8 +44,8 @@ CSoundInput::~CSoundInput() void CSoundInput::SetVolume(float gain) { - volume = gain * 2; - const BASS_BFX_VOLUME VolumeChangeFXParams = { BASS_BFX_CHANALL, volume }; + volume = gain; + const BASS_BFX_VOLUME VolumeChangeFXParams = { BASS_BFX_CHANALL, volume * 2 }; BASS_FXSetParameters(LevelVolumeChangeFX, &VolumeChangeFXParams); BASS_FXSetParameters(VolumeChangeFX, &VolumeChangeFXParams); } @@ -162,11 +162,10 @@ AltVoiceError CSoundInput::SelectDeviceByUID(const char* uid) LevelVolumeChangeFX = BASS_ChannelSetFX(levelChannel, BASS_FX_BFX_VOLUME, 0); VolumeChangeFX = BASS_ChannelSetFX(recordChannel, BASS_FX_BFX_VOLUME, 0); - SetVolume(1.f); + SetVolume(volume); BASS_ChannelSetDSP(recordChannel, NoiseDSP, this, 2); //higher prio called first BASS_ChannelSetDSP(recordChannel, NormalizeDSP, this, 1); - //BASS_ChannelSetDSP(recordChannel, RMSDSP, this, 0); //higher prio called first BASS_ChannelStart(levelChannel); BASS_ChannelPlay(levelChannel, false);