Skip to content

Commit

Permalink
Fixed linting
Browse files Browse the repository at this point in the history
  • Loading branch information
milo157 committed Oct 22, 2024
1 parent dfa037b commit 1300546
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions examples/serverless-api/main.py
Original file line number Diff line number Diff line change
@@ -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()
Expand All @@ -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
}

0 comments on commit 1300546

Please sign in to comment.