From f28084750ff093d47c7323cfa726c4bc8caa66f5 Mon Sep 17 00:00:00 2001 From: retoor Date: Sat, 18 Jan 2025 15:49:02 +0100 Subject: [PATCH] Async update. --- src/rspeech/gcloud.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/rspeech/gcloud.py b/src/rspeech/gcloud.py index aabfb60..38def7a 100644 --- a/src/rspeech/gcloud.py +++ b/src/rspeech/gcloud.py @@ -40,6 +40,9 @@ import google.oauth2.credentials import uuid import pathlib from rspeech.play import play_audio_async +import logging + +logger = logging.getLogger(__name__) # Chars to be ignored in speech IGNORE_CHARS = ["*", "#", "`","'",'"',"\\","/","---"] @@ -105,7 +108,8 @@ async def tts(text:str ,google_project:str="lisa-448004", language_code:str="nl- with file.open("wb") as audio_file: audio_file.write(base64.b64decode(audio_content.encode('latin1'))) async for tik in play_audio_async(file): - await asyncio.sleep(0.1) + logger.debug(tik) + await asyncio.sleep(1) file.unlink()