add pronon
This commit is contained in:
parent
884c68314a
commit
709adbf507
0
src/greek_lang/audio/__init__.py
Normal file
0
src/greek_lang/audio/__init__.py
Normal file
19
src/greek_lang/audio/manager.py
Normal file
19
src/greek_lang/audio/manager.py
Normal file
@ -0,0 +1,19 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import io
|
||||
|
||||
from aiogtts import aiogTTS
|
||||
|
||||
from ..languages import LanguageEnum
|
||||
|
||||
|
||||
async def get_pronunciation(text: str, source_lang: LanguageEnum) -> io.BytesIO:
|
||||
aiogtts = aiogTTS()
|
||||
buffer = io.BytesIO()
|
||||
await aiogtts.write_to_fp(
|
||||
text=text,
|
||||
fp=buffer,
|
||||
slow=True,
|
||||
lang=source_lang.value,
|
||||
)
|
||||
return buffer
|
||||
Loading…
Reference in New Issue
Block a user