diff --git a/src/rspeech/play.py b/src/rspeech/play.py index 1fc1096..8d75518 100644 --- a/src/rspeech/play.py +++ b/src/rspeech/play.py @@ -33,6 +33,13 @@ import pygame +async def play_audio_async(filename) + pygame.mixer.init() + pygame.mixer.music.load(filename) + pygame.mixer.music.play() + while pygame.mixer.music.get_busy(): + await asyncio.sleep(0.1) + yield def play_audio(filename):