mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-02-25 23:23:52 +08:00
@@ -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, 54.f, 0.f, 1.f);
|
||||
float volume = util::map_val(sm["microphone"].getMicrophone().getFilteredSoundPressureWeightedDb(), 30.f, 56.f, 0.f, 1.f);
|
||||
volume = QAudio::convertVolume(volume, QAudio::LogarithmicVolumeScale, QAudio::LinearVolumeScale);
|
||||
Hardware::set_volume(volume);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user