Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import speech_recognition as sr
- r = sr.Recognizer()
- mic = sr.Microphone()
- print('Recording...')
- with mic as source:
- audio = r.listen(source)
- with open("audio_file.wav", "wb") as file:
- file.write(audio.frame_data)
Add Comment
Please, Sign In to add comment