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
0
votes
1 answer

Writing unit test for a dependent function

I have this function that asks the user for the gender of the voice and then reads the text in that voice. If the user input is not either male or female it raises a value error. I want to write a unit test for this function, but don't know how…
Rylie
  • 19
  • 4
0
votes
0 answers

why is the Pyttsx3 library not working in VScode

this is an old code and it was working before but when I tried to restart the project it gives me this error ImportError: No module named pyttsx3 this is the code I use VScode and have used pip install pyttsx3 import pyttsx3 engine =…
Ali
  • 19
  • 2
0
votes
0 answers

Tkinter & Pyttsx3. Windows Closes after execution

I completed a small project but I do not understand why the Tkinter windows close. I would like the window to stay open so I can keep making it say what I entered as input. Why does it close the window? Any way I can fix it? Thanks import tkinter as…
0
votes
1 answer

How to run pyttsx3 (text-to-speech) on non-main thread? (Python) [Answered]

I created a small function that converts string to speech and saves to a .mp3 file. This works without any issues on main thread. But when I run this function on second thread it doesn't generate any .mp3 file and doesn't raise any error. Do you…
herdek550
  • 625
  • 1
  • 5
  • 10
0
votes
1 answer

How to set pyttsx3 voice to male

When I use pyttsx3 to speak only female voice how can I change it to male rate and frequency doesn't work. please update this code - import speech_recognition as sr import pyttsx3 listener = sr.Recognizer() engine =…
Aniket M
  • 31
  • 5
0
votes
1 answer

Make python code function as microphone using pyttsx3?

Hello I often have the trouble of not being able to speak with my friends over discord at night as my better half sleeps right behind me. Is there a way that I can use the small code I made here to "speak" for me when that happens. The TTS function…
0
votes
1 answer

Is there a way to change voice in pyttsx3 (python 3.10.4 x64)?

import pyttsx3 engine = pyttsx3.init() voices = engine.getProperty('voices') engine.setProperty('voice', voices[1].id ) engine.say('I\'m a little teapot...') engine.runAndWait() When I try run this code I get this error message; Traceback…
0
votes
1 answer

Python text-to-speech in a separate thread

I have a Python program in which I would like to have a voice report certain events, but I don't want to pause the main loop of my program while the voice speaks. I thought I could achieve this by running pyttsx3 in a separate thread (as shown…
0
votes
1 answer

how to calculate duration of each word when using Microsoft Text to speech?

Hi I'm using pyttsx3 in python which uses the Microsoft SDK SAPI5.1 text to speech synthesizer to generate audio from text. Problem that I'm facing is that the the speed of the speech it generate is not stable and it varies depending on the length…
Fchpro01
  • 11
  • 3
0
votes
1 answer

pyttsx3 stacked on the second round of iteration when using the "save" option

Using the pyttsx3 text-to-speech library, I'm saving the audio files during the iteration of the list of strings. The program is always stacked on the second round after saving the file. What may possibly be the cause of this behavior? import…
shapale
  • 123
  • 2
  • 9
0
votes
0 answers

Pyttsx3 to tkinter text while you are speaking

I want pyttsx3 and tkinter-text go synchronically. I mean, I want to see what I told in a text like the subtitles However I could not manage that. It is possible when it is not in a while loop.... but when I use it in while loop it shows the the…
0
votes
1 answer

python logging library init.py returns keyerror and acquireLock() is NoneType

Im absolutely not sure which library is causing this or what is causing this but i really would appreciate some help. Although the error isn't messing up with the answers it pops up at the end of the program which im not sure why that is. GITHUB :…
Aaryan Dhakal
  • 25
  • 1
  • 6
0
votes
1 answer

Using Microphone from Bluetooth headset on Raspberry Pi Zero 2 W Issue

So when I connect the Bluetooth headset to the Zero 2 W the audio works, but whenever I attempt to select it as an audio input while being an audio output as well, it appears to work but when I run my Python code that uses the microphone it results…
blevlabs
  • 11
  • 3
0
votes
1 answer

synthesizer in windows sounds much better than in linux (python and pyttsx3)

I've made a simple text_to_speech function in python based on pyttsx3 library (in polish language). import pyttsx3 as tts engine = tts.init() engine.setProperty('rate', 130) engine.setProperty('voice', 'polish') def text_to_speech(text): …
rumcajs
  • 129
  • 1
  • 10
0
votes
1 answer

Python speech recognition module isn't able to take time input correctly

I am building a small project where user will speak the time duration and the voice assistant will answer which lecture they would have to attend during that duration. For example -user said 10:45 to 12:45 then the voice assistant must answer…