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
The code which makes sound louder plus filter low and high frequencies
from pydub import AudioSegment
audio_file = "first.mp3"
song = AudioSegment.from_mp3(audio_file)
new = song.low_pass_filter(1000)
new1 = new.high_pass_filter(1000)
# increae volume by 6 dB
song_6_db_quieter = new1 + 6
# save the output
song_6_db_quieter.export("C://Users//User//Desktop//second.mp3", "mp3")