(recognizer, audio)
| 12 | |
| 13 | |
| 14 | def callback(recognizer, audio): |
| 15 | with open("spoken/" + str(len(speeches)) + ".wav", "wb") as file: |
| 16 | file.write(audio.get_wav_data()) |
| 17 | |
| 18 | playsound.playsound("spoken/" + str(len(speeches)) + ".wav") |
| 19 | speeches.append(1) |
| 20 | print("____") |
| 21 | |
| 22 | |
| 23 | r = sr.Recognizer() |