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:
parent
ba8a3394f5
commit
3c3d660bf6
1 changed files with 1 additions and 1 deletions
|
@ -39,7 +39,7 @@ async def toggle(number: int) -> str:
|
||||||
|
|
||||||
@app.get("/speak")
|
@app.get("/speak")
|
||||||
async def speak(text: str) -> str:
|
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}";
|
return f"TEXT {'OK' if ret == 0 else 'FAIL'}, TEXT: {text}";
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue