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

How to select the voice used to read the text? #10

Open
JEAYNE opened this issue Oct 21, 2023 · 3 comments
Open

How to select the voice used to read the text? #10

JEAYNE opened this issue Oct 21, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@JEAYNE
Copy link

JEAYNE commented Oct 21, 2023

Hi,
I've installed several voices (English and French) , but the voice used by the plugin is always the same: Microsoft Suzan
Changing the default voice in Windows Settings has no effect on the voice used by the plugin.
Is there a way to choose the voice used by the plugin (even by editing a configuration file ;-) ?

Note: Using the default English voice for French texts is sometimes hilarious, but not useful...

Regards

@chcg
Copy link
Owner

chcg commented Oct 22, 2023

Seems it is relevant at which order the voices are registered at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\Voices
, see https://learn.microsoft.com/en-us/previous-versions/windows/desktop/ee125021(v=vs.85)

as there is no specific selection by:

HRESULT hr = CoCreateInstance(CLSID_SpVoice, NULL, CLSCTX_ALL, IID_ISpVoice, (void **)&pVoice);

An additional interface would be necessary to be able to enumerate and select a specific voice.

@chcg chcg added the enhancement New feature or request label Oct 22, 2023
@JEAYNE
Copy link
Author

JEAYNE commented Oct 23, 2023

It looks like there are two lists of voices in the registry:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\Voices\Tokens
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech_OneCore\Voices\Tokens

On my Win11 machine 'Speech\Voices\Tokens’ is a subset of the list in 'Speech_OneCore\Voices\Tokens'

I hope you will find the time to add a voice selector to the plugin.
Thanks.

@superluig164
Copy link

You can change this by selecting the voice in Control Panel > Speech Recognition > Text To Speech. In the Microsoft API documentation, it specifically mentions that the default voice will be used if it isn't specified in code. The difference is that the default voice set in Settings is not the same as the one set in Control Panel nor is it the same as the setting for Narrator.

The voice selected in Settings references both lists, and the selection in Control Panel references only the Speech list. If you want one voice in the other list, you can manually copy the registry values over, and it will work fine. I did this to use Microsoft Richard with the plugin, as for me, it only showed up in Settings at first.

@chcg chcg mentioned this issue Aug 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants