Skip to content

Commit

Permalink
fix volume setter
Browse files Browse the repository at this point in the history
  • Loading branch information
martonp96 committed Oct 26, 2023
1 parent e49ec28 commit c518b0d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/CSoundInput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit c518b0d

Please sign in to comment.