Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
working with pyttsx3
#1
i have been messing around with text the speech module pyttsx3, I have two computers that I am working with, one is a mac and the other is a linux the voice id 14 on the mac is ideal but the voice id 14 on the linux is horrid.
i got to looking into this and i think its because of the nssSpeech synthesizer is on the mac and Espeak is on linux. so i guess its espeak that has terrible voices, so i found flite , it had a usable voice but i couldnt find a way to pip install that...
i went over to pyttsx3 doc page trying to figure out the proper syntax but i didnt fully understand it....
what i am wondering is can i assign flite or any other speech synthesizer as the driver for the pyttsx3 engine? here is what ive tried that didnt work...

 
import pyttsx3


engine = pyttsx3.init('flite')
voice = engine.getProperty("voices")
engine.setProperty('voice',voice[14].id)
newvoiceRate = 135
engine.setProperty('rate' , newvoiceRate)


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


speak("hello, this is my voice , this isnt quite the voice that you want.")
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Controlling text-to-speech pauses with pyttsx3 pmac1300 4 4,322 Mar-14-2022, 06:47 AM
Last Post: Coricoco_fr
  pyttsx3 cutting off last word Extra 3 2,810 Feb-28-2022, 11:20 PM
Last Post: BashBedlam
  pyttsx3 problem Tyrel 0 1,084 Feb-05-2022, 08:53 AM
Last Post: Tyrel
  Know when the pyttsx3 engine stops talking UsualCoder 3 3,138 Aug-29-2021, 11:08 PM
Last Post: snippsat
  pyttsx3 cuts off when run from py file duelistjp 4 3,990 Dec-20-2018, 04:54 PM
Last Post: DrNerdly118

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020