Skip to content

Commit

Permalink
increase volume
Browse files Browse the repository at this point in the history
  • Loading branch information
martonp96 committed Oct 26, 2023
1 parent 7717633 commit bcebd84
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 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;
const BASS_BFX_VOLUME VolumeChangeFXParams = { 0, volume };
volume = gain * 2;
const BASS_BFX_VOLUME VolumeChangeFXParams = { BASS_BFX_CHANALL, volume };
BASS_FXSetParameters(LevelVolumeChangeFX, &VolumeChangeFXParams);
BASS_FXSetParameters(VolumeChangeFX, &VolumeChangeFXParams);
}
Expand Down Expand Up @@ -159,13 +159,10 @@ AltVoiceError CSoundInput::SelectDeviceByUID(const char* uid)
levelChannel = BASS_StreamCreate(SAMPLE_RATE, AUDIO_CHANNELS, BASS_STREAM_DECODE, STREAMPROC_PUSH, this);

// Change input volume
const BASS_BFX_VOLUME VolumeChangeFXParams = { BASS_BFX_CHANALL, volume };

LevelVolumeChangeFX = BASS_ChannelSetFX(levelChannel, BASS_FX_BFX_VOLUME, 0);
BASS_FXSetParameters(LevelVolumeChangeFX, &VolumeChangeFXParams);
VolumeChangeFX = BASS_ChannelSetFX(recordChannel, BASS_FX_BFX_VOLUME, 0);

VolumeChangeFX = BASS_ChannelSetFX(levelChannel, BASS_FX_BFX_VOLUME, 0);
BASS_FXSetParameters(VolumeChangeFX, &VolumeChangeFXParams);
SetVolume(1.f);

BASS_ChannelSetDSP(recordChannel, NoiseDSP, this, 2); //higher prio called first
BASS_ChannelSetDSP(recordChannel, NormalizeDSP, this, 1);
Expand Down

0 comments on commit bcebd84

Please sign in to comment.