importspeech_recognitionassrr=sr.Recognizer()whileTrue:# Initialize the microphone
withsr.Microphone()assource:print("Speak!!: ")audio=r.listen(source)try:# do the transcription
transcription=r.recognize_google(audio,language='en-US')print(transcription)exceptsr.UnknownValueError:print("Didn't understand the audio")exceptsr.RequestError:print("request error")
Top comments (0)
Subscribe
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Top comments (0)