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
4 answers

How do i ignore a the rest of a sentence that contains a word i want to print?

I'm trying to built an assistant, at first while I say "hi" it returns "hi" working great. but if I say "hi, what time is it" it goes to the first if cause it finds the value "hi" in my sentence. This is a piece of my code: def run_alexa(): …
Nir Malka
  • 41
  • 4
0
votes
0 answers

Text to audio engine is omitting first word

Why is it that pyttsx3 engine fails to read the first character or word and how can I fix it. When I supply text it always reads from the second word
Ike Opoku
  • 1
  • 1
0
votes
0 answers

How i can fix my functions automatic repetition

So i have a voice assistant project i use speech recognition and pytsx3, the problem is the functions repetition, so this is my code main.py: import possibilities as ps clear = lambda: os.system('cls') engine = pyttsx3.init('sapi5') voices =…
rask5551
  • 1
  • 1
0
votes
1 answer

My voice assistant program doesn't register anything I say

I downloaded a python code from GitHub. It doesn't register anything I'm saying. My code: import openai import pyttsx3 import speech_recognition as sr from api_key import API_KEY openai.api_key = API_KEY engine = pyttsx3.init() r =…
0
votes
0 answers

ModuleNotFoundError: No module named 'pyttsx3.drivers.' #253

I am a mac user who has encountered this issue ModuleNotFoundError: No module named 'pyttsx3.drivers.' and I was just trying to use pyttsx3 for a simple task and this error came and I have seen answers for this but all of them are realted to windows…
0
votes
0 answers

pyttsx3 audio output wav file is not saved

Now I tried to save the audio output into wav files (mp3 file cannot play, no sound), but it play the audio but does not save audio files at all. Also this program eventually halted when all files under TTBOD folder are exhausted. I can see the mac…
0
votes
2 answers

Is there a way to save an audio file containing different voices with pyttsx3?

I combined these examples from the official pyttsx3 documentation: "Saving voice to a file" "Changing voices" I want to save an audio file containing all the voices. Code import pyttsx3 engine = pyttsx3.init() voices =…
Juan Mir
  • 1
  • 1
0
votes
0 answers

Pynput Hotkey randomly going off when only the first key is pressed

I've maid a text to speech script and it seems to finally be working well, but for some reason after you use a hotkey and I think specifically ctrl+alt+v, the hotkey will randomly run when your press ctrl. Any idea why this is? Also before you ask,…
AdamNaghs
  • 23
  • 4
0
votes
0 answers

eSpeak Installed via HomeBrew, unable to use it in python via subprocess

I installed espeak with homebrew. Using the which espeak command in my terminal, I got this path : '/Users/username/homebrew/bin/espeak' I added it to my path in python : import os os.environ['PATH'] += ':/Users/username/homebrew/bin/espeak' I…
0
votes
0 answers

pyttsx3 - interrupting as utterance not working

pyttsx3.init().stop() function not working. I was finding a way to stop pyttsx3.innit.say() function and came across its documentation. And I got to know that it has a stop function given in an example. So I ran the code but it doesn't do anything.…
Vatsal
  • 16
  • 4
0
votes
1 answer

Pyttsx3 long input file results in only the last page being converted to MP3

import pyttsx3,PyPDF2 import os file_path = input('Enter a file path:') if os.path.exists(file_path): pdfreader = PyPDF2.PdfFileReader(open(file_path, 'rb')) engine = pyttsx3.init() for page_num in range(pdfreader.numPages): …
SplizZPy
  • 3
  • 2
0
votes
0 answers

Pyttsx is not showing languages, getting error

I was having problem with my pyttsx3 not showing some installed languages. So I followed this solution: Open regedit.exe (Windows + R, and type regedit) and navigate to the Registry key…
0
votes
0 answers

Python Speechrecognition throws some error

I had this error, when trying to run python speecrecognition I tried to run a basic speech recognition in python but it didn't work. I have installed pyaudio and pytssx3 and speechrecognition and am running the latest version of pip and python. It…
0
votes
0 answers

No sound after running engine.runandWait()

I am trying to work with the pyttx3 library and I am trying to output speech by supplying a text to engine.say('My text'), then I run the engine.runandwait() function but the program just stays there and does nothing. Here is my code: import…
MAT
  • 1
  • 1
0
votes
0 answers

pyttsx3 makes pauses evere 82 words

I am learning to use pyttsx3 module. I want to make a continuous speech without any pauses so I deleted all '.' and ',', but pauses are created in what I thought were random places. So dug deeper and figured that it makes a pause every 82 (+/-1…