Commit 79f54658 authored by ange's avatar ange
Browse files

added write to mic again

parent 7958b111
......@@ -4,14 +4,14 @@ import os
import speech_recognition as sr
# obtain audio from the microphone
r = sr.Recognizer()
with sr.Microphone() as source:
audio = r.listen(source)
# # obtain audio from the microphone
# r = sr.Recognizer()
# with sr.Microphone() as source:
# audio = r.listen(source)
# write audio to a WAV file
with open("mic_audio.wav", "wb") as f:
f.write(audio.get_wav_data())
# # write audio to a WAV file
# with open("mic_audio.wav", "wb") as f:
# f.write(audio.get_wav_data())
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment