1

I am bit new to linux and I tried to run this python code. At the first time it asked me to install libespeak-dev and try to run the code again. After installing it when I ran the code the sound was very weird and very robotic and it was terrible to listen. Here is the code:

import pyttsx3

engine = pyttsx3.init()


def speak(text):
    engine.say(text)
    engine.runAndWait()


speak("Hello World and this is a test.")

For some reasons I am unable to attach the mp3 file to tell how terrible it sounds. By the way I am using Ubuntu 20.04 LTS which comes with default installation of python 3.8.5. Is there any fix to this? Because it sounds very bad. Thanks in advance...

Rob
  • 14,746
  • 28
  • 47
  • 65
  • Update: When I tried to run the same code on windows 10, with the same python version, it sounded normal, but when I tried to run the code on ubuntu 20.04 LTS, it sounds terrible... Hoping for a fix. – Just_A_Coder Nov 20 '20 at 11:22

1 Answers1

2

It doesn't work as windows uses a framework called as sapi5 which is way more developed than what linux uses that is espeak which is open source and also worse. You cannot in any way use sapi5 on linux...