Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SAPI - Language codes and other fields to not be Empty (fix for #384) #385

Merged
merged 6 commits into from
Nov 15, 2024

Conversation

willwade
Copy link
Collaborator

@willwade willwade commented Nov 14, 2024

nb; using locale to get correct lang codes that are understandable

This matches eSpeak too

You should now get data like

<Voice id=HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\Voices\Tokens\TTS_MS_EN-US_DAVID_11.0
          name=Microsoft David Desktop - English (United States)
          languages=['en-US']
          gender=Male
          age=Adult>
<Voice id=HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\Voices\Tokens\TTS_MS_EN-US_ZIRA_11.0
          name=Microsoft Zira Desktop - English (United States)
          languages=['en-US']
          gender=Female
          age=Adult>
<Voice id=HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\Voices\Tokens\TTS_MS_ES-ES_HELENA_11.0
          name=Microsoft Helena Desktop - Spanish (Spain)
          languages=['es-ES']
          gender=Female
          age=Adult>
<Voice id=HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\Voices\Tokens\TTS_MS_FR-FR_HORTENSE_11.0
          name=Microsoft Hortense Desktop - French
          languages=['fr-FR']
          gender=Female
          age=Adult>
<Voice id=HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\Voices\Tokens\TTS_MS_RU-RU_IRINA_11.0
          name=Microsoft Irina Desktop - Russian
          languages=['ru-RU']
          gender=Female
          age=Adult>

nb; using locale to get correct lang codes that are understandable
@willwade
Copy link
Collaborator Author

RE: #385 @soleyhyman - take a look if you can

@willwade
Copy link
Collaborator Author

willwade commented Nov 14, 2024

nb: @cclauss i see now something you were trying to tell me about yesterday - its timing out on espeak get voices in the test,

Im not sure why. with this PR if I do (on Windows)

import pyttsx3
engine = pyttsx3.init('espeak')
voices = engine.getProperty('voices')
for voice in voices:
    print(voice)

It runs fine

pyttsx3/drivers/sapi5.py Outdated Show resolved Hide resolved
pyttsx3/drivers/sapi5.py Outdated Show resolved Hide resolved
pyttsx3/drivers/sapi5.py Outdated Show resolved Hide resolved
pyttsx3/drivers/sapi5.py Outdated Show resolved Hide resolved
willwade and others added 3 commits November 14, 2024 13:05
Co-authored-by: Christian Clauss <[email protected]>
Co-authored-by: Christian Clauss <[email protected]>
Co-authored-by: Christian Clauss <[email protected]>
@willwade willwade merged commit 2c5043c into nateshmbhat:master Nov 15, 2024
9 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants