Skip to content

Commit

Permalink
fix db range
Browse files Browse the repository at this point in the history
  • Loading branch information
martonp96 committed Oct 13, 2023
1 parent d7e9329 commit ae4b63e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/CSoundInput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ void CSoundInput::SoundFrameCaptured(HRECORD handle, const void* buffer, DWORD l

// Convert level to decibels
micLevelDb = (micLevel > 0 ? 20 * log10(micLevel) : -HUGE_VAL);
micLevelDb = std::clamp(micLevelDb, -100.f, 0.f);
micLevelDb = std::clamp(micLevelDb, -100.f, 0.f) + 100.f;

// Remove data from level channel (is there a better way to do it?)
BASS_ChannelGetData(levelChannel, writableBuffer, length * sizeof(short));
Expand Down

0 comments on commit ae4b63e

Please sign in to comment.