From 031a6d91447adaecd1aec2b879deeb7a4ad73d49 Mon Sep 17 00:00:00 2001 From: retoor Date: Sat, 18 Jan 2025 15:42:26 +0100 Subject: [PATCH] Async update. --- src/rspeech/gcloud.py | 2 +- src/rspeech/play.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rspeech/gcloud.py b/src/rspeech/gcloud.py index 34848b1..b666aa4 100644 --- a/src/rspeech/gcloud.py +++ b/src/rspeech/gcloud.py @@ -104,7 +104,7 @@ async def tts(text:str ,google_project:str="lisa-448004", language_code:str="nl- file = pathlib.Path(str(uuid.uuid4()) + ".mp3") with file.open("wb") as audio_file: audio_file.write(base64.b64decode(audio_content.encode('latin1'))) - async for tik in play_audio(file) + async for tik in play_audio(file): await asyncio.sleep(0.1) file.unlink() return diff --git a/src/rspeech/play.py b/src/rspeech/play.py index 42eae76..848b19c 100644 --- a/src/rspeech/play.py +++ b/src/rspeech/play.py @@ -33,7 +33,7 @@ import pygame import time -async def play_audio_async(filename) +async def play_audio_async(filename): pygame.mixer.init() pygame.mixer.music.load(filename) time_start = time.time()