How To Make Voice Recorder In Python



In this post we are going to make a Voice Recorder in Python. We need to install some Modules. If you don't know how to install Modules in Python don't worry! I will explain you how to install modules. In this we need to install three Modules. If you want to record long audio change the duration of audio. If the audio 🔉 is in Minutes please convent Minutes in Second.  Here is the following Modules to install.

1. Sounddevice "pip install sounddevice"

2.Wavio "pip install wavio"

3.Scipy "pip install scripy"

Here Is The Code:-

import sounddevice as sd
from scipy.io.wavfile import write
import wavio as wv
freq = 44100
duration = 5
recording = sd.rec(int(duration * freq),
				samplerate=freq, channels=2)
sd.wait()
write("recording0.wav", freq, recording)
wv.write("recording1.wav", recording, freq, sampwidth=2)

Post a Comment

Previous Post Next Post