0

This is my code

import pyttsx3

# This function is used to process text and speak it out
def speak (lis):
    voiceEngine = pyttsx3.init() 
    voiceEngine.getProperty("rate", 100)
    #voice_id = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\Voices\Tokens\IVONA 2 Voice Brian22" 
    #voiceEngine.setProperty('IVONA 2 Brian - British English male voice [22kHz]', voice_id ) 
    voiceEngine.say (lis)
    voiceEngine.runAndWait() 
    voiceEngine.stop


speak(lis = "Hello i am alpha, your personal digital assistant. how may i be of your assistance")
joshmeranda
  • 3,001
  • 2
  • 10
  • 24

1 Answers1

0

Looking at the documentation for pyttsx3.ening.Engine.getProperty it looks like you're giving it too many arguments:

getProperty(name : string) → object

Gets the current value of an engine property. Parameters: name – Name of the property to query. Returns: Value of the property at the time of this invocation.

You are giving it an extra parameter: 100. You should only be providing the name of the property you are looking to access: voiceEngine.getProperty("rate").

Unless you were looking to use pyttsx3.engine.Engine.setProperty which does take a second value for the value to set the property to.

joshmeranda
  • 3,001
  • 2
  • 10
  • 24