Questions tagged [pyttsx3]

pyttsx3 is a text-to-speech conversion library in Python. Unlike alternative libraries, it works offline, and is compatible with both Python 2 and 3.

pyttssx3 is an offline text-to-speech library for Python. It supports multiple TTS engines, including Sapi5, nsss, and espeak.

251 questions
15
votes
7 answers

OSError: libespeak.so.1: cannot open shared object file: No such file or directory

I am making a pyttsx3 chat bot however this error occurred: OSError: libespeak.so.1: cannot open shared object file: No such file or directory This error also occurred: KeyError: None Here is my code: import pyttsx3 def say(sp): engine =…
crvcio
  • 321
  • 2
  • 5
  • 11
8
votes
4 answers

How can I convert a text file to mp3 file?

Here is my Python code: import pyttsx3 engine = pyttsx3.init(driverName='sapi5') f = open("tanjil.txt", 'r') theText = f.read() f.close() engine.say(theText) engine.runAndWait() I couldn't save the file to an audio file.
taaanjil
  • 81
  • 1
  • 1
  • 2
7
votes
3 answers

Change pyttsx3 language

When trying to use pyttsx3 I can only use English voices. I would like to be able to use Dutch as well. I have already installed the text to speech language package in the windows settings menu. But I can still only use the deafaut english…
Cerabbite
  • 151
  • 1
  • 2
  • 8
6
votes
2 answers

AttributeError: 'super' object has no attribute 'init'

I was making a personal assistant. I got an error in starting code: import pyttsx3 engine = pyttsx3.init() engine.say('How are you today?') engine.runAndWait() Error: /usr/local/lib/python3.11/site-packages/pyttsx3/drivers/nsss.py:12:…
Ansh Tyagi
  • 116
  • 1
  • 15
5
votes
1 answer

Why can't I change voice in pyttsx3?

I want to make a new project with pyttsx3, but I can't choose a voice. In general, I need a set of Russian voices, so I installed the RHVoice packages, but the module does not want to see individual voices, showing only languages. Help, please, how…
DGDays
  • 76
  • 12
3
votes
1 answer

Python pyttsx3 'Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)' Error

I have a simple Python script that uses pyttsx3: import pyttsx3 as tts engine = tts.init() voices = engine.getProperty('voices') engine.setProperty("voice", voices[1].id) engine.say("Hello") engine.runAndWait() However when I run it, the program…
nerdintown
  • 115
  • 1
  • 7
3
votes
0 answers

Add personal voice in pyttsx3

does anyone know how to add personal voices in pyttsx3 module in python? By default there are 3 voices available in my system (windows 11) is there a way to add our own voice to it by any method?
3
votes
2 answers

pyttsx3: can't set specified language

Show all available voice in pyttsx3: import pyttsx3 engine = pyttsx3.init() voices = engine.getProperty('voices') voices[-2].id 'Mandarin' I want to play a Chinese string with Mandarin import pyttsx3 engine = pyttsx3.init() voices =…
showkey
  • 482
  • 42
  • 140
  • 295
3
votes
1 answer

Python Speech Recognition not starting without saying anything

I am creating a Python Personal Assistant using Python's Speech Recognition,pyaudio and Python Text to speech modules, so what I want is that after starting the program I want it to say something and have coded it the same, but when I run the…
3
votes
2 answers

How to change voices in pyttsx3 modlue of python

I am using the pyttsx3 module for text-to-speech in one of my python projects, but I am not able to choose a male/female option for voices. I read the documentation given on https://pypi.org/project/pyttsx3/ where it says use…
Ameya Uppina
  • 131
  • 1
  • 3
  • 13
2
votes
1 answer

Pyttsx3 "runAndWait" function makes the code stop

I am using python 3.10 and PYTTSX3 2.9 to convert a text into an audio file. I start with a very basic code: import pyttsx3 engine = pyttsx3.init() engine.say("Hello, this is a sample text to speech conversion.") engine.runAndWait() engine.say("This…
David Lee
  • 43
  • 6
2
votes
0 answers

pyttsx3/pyttsx4 give segmentation fault: 11

I'm trying to use the pyttsx3 module but it crashes the python env and gives me a segmentation fault as soon as I call the pyttsx3.init() method. Thought it might be an issue of pyttsx3 being outdated so I tried the same with pyttsx4 but no…
2
votes
1 answer

"Segmentation Fault: 11" when running pyttsx3.init() on MacOS

I wanted to try out the pyttsx3 library in python 3.11.2 on MacOS Monterey v12.6.3. I followed the pyttsx3 tutorial as a starter, but am failing at the initialisation step of the engine: Python 3.11.2 (main, Feb 16 2023, 03:15:23) [Clang 14.0.0…
nilsernst
  • 49
  • 1
  • 7
2
votes
0 answers

Save pyttsx3 tts to buffer

How to save pyttsx3 TTS directly to buffer without saving it to file? I'm working on a project where I need to generate a video MP4 with a TTS voiceover. I'm using the pyttsx3 library to generate the audio, but the library saves the audio to a file…
Johann
  • 75
  • 9
2
votes
1 answer

Why the command listener.listen from lib pyttsx3 printing this extra text?

basicly trying to follow the steps of a vid, everything is working great exapt that those lines of code: with sr.Microphone() as source: print('listening..') voice = listener.listen(source) command =…
Nir Malka
  • 41
  • 4
1
2 3
16 17