I have a 2 seconds 16bit single channel 8khz wav file and I need to change its volume.
It should be quite straightforward, because changing the volume is the same as
I wrote a library to simplify this type of thing
You can do that like so:
from pydub import AudioSegment
song = AudioSegment.from_wav("never_gonna_give_you_up.wav")
# reduce volume by 10 dB
song_10_db_quieter = song - 10
# but let's make him *very* quiet
song = song - 36
# save the output
song.export("quieter.wav", "wav")