Created
July 10, 2019 07:37
-
-
Save aravindpai/5f200d64efd282440d5dc58ffe26a593 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 = 'yes.wav' | |
print("start") | |
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
Sir, I am getting error in this line:
mydata = sd.rec(int(samplerate * duration), samplerate=samplerate,
channels=1, blocking=True)
PortAudioError: Error querying device -1
How to solve this. Please help me