soundd: tune volume to reach max at slightly higher noise level

old-commit-hash: d64a5020b20cf32f2a9ce3a3ba2dd8547751ebc5
This commit is contained in:
Cameron Clough
2022-12-07 22:15:58 -08:00
parent 01db07375c
commit 1ca9fa7fce

View File

@@ -48,7 +48,7 @@ void Sound::update() {
// scale volume using ambient noise level
if (sm.updated("microphone")) {
float volume = util::map_val(sm["microphone"].getMicrophone().getFilteredSoundPressureWeightedDb(), 30.f, 52.f, 0.f, 1.f);
float volume = util::map_val(sm["microphone"].getMicrophone().getFilteredSoundPressureWeightedDb(), 30.f, 54.f, 0.f, 1.f);
volume = QAudio::convertVolume(volume, QAudio::LogarithmicVolumeScale, QAudio::LinearVolumeScale);
Hardware::set_volume(volume);
}