1
Fork 0
mirror of https://github.com/RGBCube/GDUS synced 2025-07-28 13:37:45 +00:00

Finally play the text

This commit is contained in:
RGBCube 2024-01-03 15:33:15 +03:00
parent ba8a3394f5
commit 3c3d660bf6
No known key found for this signature in database

View file

@ -39,7 +39,7 @@ async def toggle(number: int) -> str:
@app.get("/speak")
async def speak(text: str) -> str:
ret = os.system(f'text2speech "{text}"')
ret = os.system(f'gtts-cli "{text}" --output text.mp3; pw-play text.mp3')
return f"TEXT {'OK' if ret == 0 else 'FAIL'}, TEXT: {text}";