Create A Voice Recorder Using Python
Create A Voice Recorder Using Python
Installation:
To install scipy:
# Recording duration
duration = 5
Using Scipy:
We will use the write function from scipy.io.wavfile to
convert the NumPy array to an audio file.
# This will convert the NumPy array to an audio
# file with the given sampling frequency
Complete Code:
# import required libraries
import sounddevice as sd
import wavio as wv
# Sampling frequency
freq = 44100
# Recording duration
duration = 5
samplerate=freq, channels=2)
sd.wait()