(text)
| 19 | engine.runAndWait() |
| 20 | |
| 21 | def speak(text): |
| 22 | tts = gTTS(text) |
| 23 | tts.save('temp.mp3') |
| 24 | |
| 25 | # Initialize Pygame mixer |
| 26 | pygame.mixer.init() |
| 27 | |
| 28 | # Load the MP3 file |
| 29 | pygame.mixer.music.load('temp.mp3') |
| 30 | |
| 31 | # Play the MP3 file |
| 32 | pygame.mixer.music.play() |
| 33 | |
| 34 | # Keep the program running until the music stops playing |
| 35 | while pygame.mixer.music.get_busy(): |
| 36 | pygame.time.Clock().tick(10) |
| 37 | |
| 38 | pygame.mixer.music.unload() |
| 39 | os.remove("temp.mp3") |
| 40 | |
| 41 | def aiProcess(command): |
| 42 | client = OpenAI(api_key="<Your Key Here>", |
no outgoing calls
no test coverage detected