Created
May 8, 2020 14:09
-
-
Save pragatibaheti/a4245b9506147245b1189cbb98b7fe46 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sounddevice as sd | |
import soundfile as sf | |
samplerate = 16000 | |
duration = 1 # seconds | |
filename = 'mytest.wav' | |
print("start recording") | |
mydata = sd.rec(int(samplerate * duration), samplerate=samplerate, | |
channels=1, blocking=True) | |
print("end") | |
sd.wait() | |
sf.write(filename, mydata, samplerate) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment