Answers for "how to record a voice in python"

0

how to record a voice in python

import sounddevice as sd
from scipy.io.wavfile import write

fs = 44100  # Sample rate
seconds = 3  # Duration of recording

myrecording = sd.rec(int(seconds * fs), samplerate=fs, channels=2)
sd.wait()  # Wait until recording is finished
write('output.wav', fs, myrecording)  # Save as WAV file
Posted by: Guest on June-04-2021

Code answers related to "how to record a voice in python"

Python Answers by Framework

Browse Popular Code Answers by Language