SecretSanta / reduce-vol.py
mooncake030's picture
hello
719b8f9
raw
history blame contribute delete
323 Bytes
import math
import fire
from pydub import AudioSegment
def reduce_volume(src_path, dst_path, volume_ratio):
audio = AudioSegment.from_file(src_path)
vol_change = 20 * math.log10(volume_ratio)
quieter = audio + vol_change
quieter.export(dst_path)
if __name__ == "__main__":
fire.Fire(reduce_volume)