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

vw-devel
Cameron Clough 3 years ago
parent 1da6f6a6e2
commit d64a5020b2
No known key found for this signature in database
GPG Key ID: 48B6A0DB1DE6C320
  1. 2
      selfdrive/ui/soundd/sound.cc

@ -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);
}

Loading…
Cancel
Save