change volume mgmt

better volume management for your hears
This commit is contained in:
Azlux 2020-06-01 17:24:07 +02:00 committed by Terry Geng
parent 37082a82f3
commit 7c2fd00884
No known key found for this signature in database
GPG Key ID: F982F8EA1DF720E7

View File

@ -473,8 +473,8 @@ class MumbleBot:
if raw_music:
# Adjust the volume and send it to mumble
self.volume_cycle()
self.mumble.sound_output.add_sound(
audioop.mul(raw_music, 2, self.volume))
# https://stackoverflow.com/questions/1165026/what-algorithms-could-i-use-for-audio-volume-level
self.mumble.sound_output.add_sound(audioop.mul(raw_music, 2, math.pow(self.volume, math.e)))
else:
time.sleep(0.1)
else: