From 62d1aef16803b790d8cbd9eca7add28a8b2e1457 Mon Sep 17 00:00:00 2001 From: pluja Date: Fri, 28 Apr 2023 20:54:00 +0200 Subject: [PATCH] remove newlines from text so it is read as a single sentence --- main.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/main.py b/main.py index e6e72a8..3a74b69 100644 --- a/main.py +++ b/main.py @@ -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