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
1
vote
0 answers

pyttsx3 produced mp3 not recognizable by pydub

In using pyttsx3 to produce mp3 audio files, it seems there's a problem that the mp3 file is not recognizable by pydub. pyttsx3: text to speech package pydub: audio handling package The error message says a lot of "Header missing". The code is…
Mark K
  • 8,767
  • 14
  • 58
  • 118
1
vote
1 answer

Pyttsx3 Ubuntu aplay:main:831 Error audio open error

I've been trying forever to get my pyttsx code working. I am working in a Github codespace based on Linux Ubuntu. Since it is not my own I can't access any of its settings. enter image description here I've ran a number of different commands to try…
VinPy
  • 36
  • 4
1
vote
0 answers

Python smart voice assistant with using a JSON file

I was trying to create a voice assistant using python... but my code is showing some weird texts when I run it... down below is my code from email.mime import audio from logging.config import listen import re from neuralintents import…
1
vote
1 answer

pyttsx3 stopped working after updating to macOS Ventura

Here is the code that I wrote earlier on Python3.11. ` import pyttsx3 engine = pyttsx3.init('nsss') # object creation TTS_RATE = 150 # speed of tts TTS_VOLUME = 1.0 # volume of tts TTS_GENDER = "Male" # gender of tts (Male or…
1
vote
0 answers

pyttsx3 save_to_file() stops at a period

Im trying to write a test program for TTS inorder to use it in my main project. When i use the savetofile command, it only outputs up to the first period. for example: import pyttsx3 engine = pyttsx3.init() hell = "this is period 1. this is period…
1
vote
2 answers

Tkinter window closes pyttsx3

from tkinter import * import pyttsx3 root = Tk() root.geometry("800x500") def talk(): engine = pyttsx3.init() engine.say(my_entry.get()) my_entry.delete(0, END) engine.runAndWait() my_entry = Entry(root, font=("Helvetica",…
Muzammil-cyber
  • 141
  • 1
  • 7
1
vote
0 answers

how to wake up voice assistant without constantly printing exception

I am creating a personal assistant to open apps with my voice. I want it to always keep hearing so when it hears "Hello Windows" it wakes up, but i don't want it to keep printing Exception because it is either bad practice or I have a feeling that…
AfterHover
  • 97
  • 2
  • 12
1
vote
1 answer

Play sound when a word spoken is in command

I want to code a script for example If 'song' in command: Playsound(path) Speak(path) It should work like. When speech recognition is imported and when i run script, it starts listening and when i say a trigger word the audio of given path…
1
vote
0 answers

pyttsx3 NameError on initialisation

When I try to run this code: import pyttsx3 engine = pyttsx3.init() engine.say("I will speak this text") engine.runAndWait() I get this error message: Exception has occurred: NameError name 'sion' is not defined During handling of the above…
Mariah
  • 21
  • 1
1
vote
1 answer

How to use the audio created by pyttsx3 in the microphone output or choose audio output driver?

Usage need: I'm going to do a draw during an audio conference, for that I'm generating a random number in Python and making pyttsx3 read the text created. from num2words import num2words from random import randint import pyttsx3 engine =…
Digital Farmer
  • 1,705
  • 5
  • 17
  • 67
1
vote
0 answers

OSError: libespeak.so.1: cannot open shared object file: No such file or directory (in fedora35)

Recently, I have been trying to work on a voice assistant project. so, I installed pyttsx3 successfully. But when I try to execute engine = pyttsx3.init() this piece of code. the error pops out OSError: libespeak.so.1: cannot open shared object…
Amir-UL
  • 19
  • 5
1
vote
0 answers

I test pyttsx3 and all is allways the same, robotic voice , i cannot change this voice

enter code here import pyttsx3 import os texte = input("le texte à exprimer ? : ") tts = pyttsx3.init() tts.say(texte) voices = tts.getProperty('voices') tts.setProperty("voice", voices[1].id) tts.runAndWait() i tried to change…
1
vote
1 answer

Is there a way to add a pause/delay using pyttsx3?

Say I have a list of lines that I want to read off, such as: ["Line 1", "Line 2", "Line 3"] Is there a way to use the "pyttsx3" module to add a pause/delay after each line? So, for example, it would say (which would be saved to an mp3 file): "Line…
PyroGamez
  • 11
  • 1
1
vote
0 answers

pyttsx3 giving no audio output

I've tried many different lines of code and can't get any output. It reads the mic just fine but won't say anything. I've been working on this for 3 days and can't get any speech out. I've also tried version 2.7 of pyttsx3 and the latest version,…
sdog
  • 19
  • 1
  • 5
1
vote
2 answers

Import "speech_recognition" could not be resolved

I installed the speech recognition and the pyttsx3 libraries pip install SpeechRecognition pip install pyttsx3 but when i try to import them it gives two errors Import "speech_recognition" could not be resolved Import "pyttsx3" could not be…
epicgamer2018
  • 21
  • 1
  • 2
1 2
3
16 17