From a48b4a217be03fe68df35aeb60f914c487e9d865 Mon Sep 17 00:00:00 2001 From: "re.kovalev" Date: Mon, 16 May 2022 11:47:37 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9F=D1=82=D0=B8=D1=86=D0=B0-=D0=B3=D0=BE?= =?UTF-8?q?=D0=B2=D0=BE=D1=80=D1=83=D0=BD=20=D1=87=D0=B5=D1=80=D0=B5=D0=B7?= =?UTF-8?q?=20festival?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- speaker.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 speaker.py diff --git a/speaker.py b/speaker.py new file mode 100644 index 0000000..e9a6c7f --- /dev/null +++ b/speaker.py @@ -0,0 +1,13 @@ +# Модуль отвечающий за голосовое воспроизведение текста +# Требует установленный linux-пакет festival + +import subprocess + +def speak(text:str): + """Функция выполняет вызов приложения festival""" + if (len(text) > 0): + #print(text) + process = subprocess.Popen(f'echo "{text}" | festival --tts --language russian', shell=True) + process.wait() + #time.sleep(5) + \ No newline at end of file