From 1300546f7bbff274a1f1d44b420e8865266eac49 Mon Sep 17 00:00:00 2001 From: Michael Louis Date: Tue, 22 Oct 2024 13:54:15 -0400 Subject: [PATCH] Fixed linting --- examples/serverless-api/main.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/serverless-api/main.py b/examples/serverless-api/main.py index 87aa140..2c54bf7 100644 --- a/examples/serverless-api/main.py +++ b/examples/serverless-api/main.py @@ -1,7 +1,9 @@ import edge_tts +from typing import Dict +from typing import AsyncGenerator -async def run(text: str, voice: str = "en-GB-SoniaNeural"): +async def run(text: str, voice: str = "en-GB-SoniaNeural") -> AsyncGenerator[Dict[str, str], None]: communicate = edge_tts.Communicate(text, voice) submaker = edge_tts.SubMaker() @@ -15,7 +17,7 @@ async def run(text: str, voice: str = "en-GB-SoniaNeural"): submaker.create_sub((chunk["offset"], chunk["duration"]), chunk["text"]) subtitles = submaker.generate_subs() - return { + yield { "audio_data": audio_data.decode("latin-1"), "subtitles": subtitles } \ No newline at end of file