nateshmbhat / pyttsx3

Offline Text To Speech synthesis for python
Mozilla Public License 2.0
2.09k stars 330 forks source link

engine.say("^") is not working #307

Open shiva396 opened 7 months ago

shiva396 commented 7 months ago

"^" is not working with voice type 2

import pyttsx3
engine = pyttsx3.init()
engine.setProperty('rate', 100)
voices = engine.getProperty('voices')
engine.setProperty('voice', voices[1].id)
print(voices[1].id)
engine.say("^")
engine.runAndWait()

Name of the file : HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\Voices\Tokens\TTS_MS_EN-US_ZIRA_11.0

willwade commented 1 week ago

Umm what were you expecting it say?

shiva396 commented 1 day ago

Often called a “caret,” “hat,” “circumflex,” or “exponent.”... May be the main use case could be considered. i.e., "exponent"

willwade commented 1 day ago

Ok. I think you would be best defining a dict to look up what these characters should say and send them to the engine. I'd be nervous of doing this in the engine of pyttsx3 though. Each engine does things differently- particularly espeak. Infact I wouldn't mind betting carat actually means something else dependent on the language of the voice.

In short - if it says nothing it's probably for good reason. The underlying speech engine either understands it and it isn't what you are expecting or it doesn't