remove newlines from text so it is read as a single sentence

main
pluja 2023-04-28 20:54:00 +02:00
rodzic aea6002d62
commit 62d1aef168
1 zmienionych plików z 3 dodań i 0 usunięć

Wyświetl plik

@ -129,6 +129,9 @@ async def text_to_voice(text: str, language: str = None) -> BytesIO:
text=True,
encoding="utf8",
)
# Remove all newlines from the text so that the text is read as a single sentence
text = text.replace("\n", ". ")
process.communicate(input=text)
# Open the file in binary mode and read its content into BytesIO object