()
| 5 | |
| 6 | |
| 7 | def stt(): |
| 8 | with sr.Microphone() as source: |
| 9 | # read the audio data from the default microphone |
| 10 | audio_data = r.record(source, duration=5) |
| 11 | print("Recognizing...") |
| 12 | # convert speech to text |
| 13 | text = r.recognize_google(audio_data) |
| 14 | print(text) |