How can i code a audio file compressor in python ?? Below i made a voice recorder but now i want to compress that recorded voice file.
import sounddevice as sd
from scipy.io.wavfile import write
import wavio as wv
freq = 44100
duration = 180
recording = sd.rec(int(duration * freq),
samplerate=freq, channels=2)
sd.wait()
write("recording0.mp3", freq, recording)
Currently i am using above code for recording audio. Then audio recorded is stored in file named recording0.mp3. But this file is of 60MB. I want to compress it so what is the code for compressing this file in python ??