Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Created Oct 31, 2021
Embed
What would you like to do?
import sounddevice
from scipy.io.wavfile import write
def voice_recorder(seconds, file):
print("Recording Started...")
recording = sounddevice.rec((seconds * 44100), samplerate= 44100, channels=2)
sounddevice.wait()
write(file, 44100, recording)
print("Recording Finished")
voice_recorder(10, "record.wav")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment