NaturalVoiceSAPIAdapter icon indicating copy to clipboard operation
NaturalVoiceSAPIAdapter copied to clipboard

Please add support for Microsoft's leaked offline natural voices

Open 1001ruchka opened this issue 1 year ago • 11 comments

Together with the game Senua's Saga: Hellblade II leaked a few offline natural voices that can not be downloaded from the Microsoft website. In particular, there are Russian and Ukrainian local voices. In MultiTTS program ( t.me/MultiTTS_channel) added support for these voices.

Unfortunately NaturalVoiceSAPIAdapter gives an error when trying to use them:

Speech synthesis error: Local TTS speak failed, with TTS error code = EMBEDDED_TTS_ERROR_WRONG_DECRYPTION_KEY. Wrong embedded speech synthesis model key.

I tested on the Russian voice: https://drive.google.com/drive/folders/1o8Y1oAm-3RCs_efoNjo075iB0tarilzb

1001ruchka avatar Nov 21 '24 14:11 1001ruchka

Configuration file for use in MultiTTS. There may be an encryption key here.

microsoft:
- !!org.nobody.multitts.tts.speaker.Speaker
  avatar: null
  code: ru-RU-SvetlanaNeural
  desc: ru-RU-SvetlanaNeural
  extendUI: null
  gender: 0
  locale: ru-RU
  name: Svetlana
  note: null
  param: |-
    Microsoft Server Speech Text to Speech Voice (ru-RU, SvetlanaNeural)
    BGJJwTRVfhRYIZq0xtySkIQlJbmBDsX6GsVyDRFHM0AzOjRvZ7ELI5kgzCUWYAKhTk99WDj5aOSWY@KHnffCDqlB008FmEUZHXM2lmKaFnfffnu4r8eiLUyYuH1uf4fSYA39OKQUZ9wY
  pitch: 1.0
  sampleRate: 24000
  speed: 1.0
  type: 0
  volume: 1.0

1001ruchka avatar Nov 21 '24 17:11 1001ruchka

This is very interesting. Thanks.

With the correct key BGJJwTRVfhRYIZq0xtySkIQlJbmBDsX6GsVyDRFHM0AzOjRvZ7ELI5kgzCUWYAKhTk99WDj5aOSWY@KHnffCDqlB008FmEUZHXM2lmKaFnfffnu4r8eiLUyYuH1uf4fSYA39OKQUZ9wY in the config file, the voices do work.

However, the voice enumerator in this adapter assumes that all local natural voices are Narrator voices, so it uses the key for Narrator voices, which is incorrect for those leaked voices.

To utilize those voices in the current version of this adapter, you can bypass the voice enumerator, and put the voice information directly into the registry.

In registry editor, create a registry key under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\Voices\Tokens. The key's name will be the voice's internal ID. Then, create the following keys & values inside this key:

  • String value (Default): display name of the voice, e.g. Microsoft Svetlana
  • String value CLSID: {013ab33b-ad1a-401c-8bee-f6e2b046a94e}
  • Subkey: Attributes
    • String value Language: hexadecimal language ID of the voice, e.g. 409 for English (US), 419 for Russian (Russia). Usually you can find an INI file named with a number, e. g. 1049.INI, inside the voice folder. Convert 1049 to hexadecimal and you will get the language ID.
    • String value Gender: Male or Female.
    • String value Age: Adult, Senior, Child, or Teen.
  • Subkey: NaturalVoiceConfig
    • String value Path: path of the voice folder (e. g. path to ru-RU-SvetlanaNeural)
    • String value Key: the decryption key

After that, the voice will be shown in the voice list of 64-bit programs. To make it work in 32-bit programs, you should also create the same registry key under HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Speech\Voices\Tokens.

Create one key for each voice you want to add. This has to be done manually, until I update the voice enumerator so that it can support such voices.

gexgd0419 avatar Nov 22 '24 03:11 gexgd0419

MultiTTS seems to be much more advanced than this adapter, which was originally meant to be no more than a simple proof of concept.

As some users requested to support more kinds of voices, I think that a more user-friendly way to introduce other voices would be to use "voice packs" that users can just import and use, like what MultiTTS is doing, instead of making the users manually input the keys, paths, etc.

As I don't have my own channel to distribute such voices, maybe I can consider making the adapter able to use (some of) the voice packs for MultiTTS. So here are some questions.

  • Is MultiTTS open-sourced? Do I have a way to get its source code?
  • Can I make my adapter able to use the voice pack format for MultiTTS?

gexgd0419 avatar Nov 22 '24 06:11 gexgd0419

Thank you so much! It's working. As for MultiTTS I unfortunately have no information. There is an official chat: https://t.me/MultiTTS_global where you can chat with the developer.

1001ruchka avatar Nov 22 '24 10:11 1001ruchka

Hi, can you help me find out what is wrong with my registry? It doesn't work properly. Thanks!

[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\SPEECH\Voices\Tokens\TTS_MS_ru-RU_SvetlanaNeural_11.0] @="Microsoft Server Speech Text to Speech Voice (ru-RU, SvetlanaNeural)" "419"="Microsoft Server Speech Text to Speech Voice (ru-RU, SvetlanaNeural)" "CLSID"="{a12bdfa1-c3a1-48ea-8e3f-27945e16cf7e}" "LangDataPath"="C:\Windows\Speech_OneCore\Engines\TTS\ru-RU SvetlanaNeural\MSTTSLocRuRU.dat" "VoicePath"="C:\Windows\Speech_OneCore\Engines\TTS\ru-RU SvetlanaNeural\1049"

[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\SPEECH\Voices\Tokens\TTS_MS_ru-RU_SvetlanaNeural_11.0\Attributes] "Age"="Adult" "AudioFormats"="18" "Gender"="Male" "Language"="419" "Name"="Microsoft Server Speech Text to Speech Voice (ru-RU, SvetlanaNeural)" "Vendor"="Microsoft" "Version"="11.0" "Project"="hoiv-dummy-resource-id"

[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\SPEECH\Voices\Tokens\TTS_MS_ru-RU_SvetlanaNeural_11.0\NaturalVoiceConfig] @="C:\Windows\Speech_OneCore\Engines\TTS\ru-RU SvetlanaNeural" "path of the voice folder"="C:\Windows\Speech_OneCore\Engines\TTS\ru-RU SvetlanaNeural" "the decryption key"="BGJJwTRVfhRYIZq0xtySkIQlJbmBDsX6GsVyDRFHM0AzOjRvZ7ELI5kgzCUWYAKhTk99WDj5aOSWY@KHnffCDqlB008FmEUZHXM2"

Alan86024 avatar Jun 09 '25 14:06 Alan86024

Hi, can you help me find out what is wrong with my registry? It doesn't work properly. Thanks!

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\SPEECH\Voices\Tokens\TTS_MS_RU-RU_SVETLANA_11.0] @="Microsoft Svetlana" "CLSID"="{013ab33b-ad1a-401c-8bee-f6e2b046a94e}"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\SPEECH\Voices\Tokens\TTS_MS_RU-RU_SVETLANA_11.0\Attributes] "Language"="419" "Gender"="Female" "Age"="Adult"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\SPEECH\Voices\Tokens\TTS_MS_RU-RU_SVETLANA_11.0\NaturalVoiceConfig] "Key"="BGJJwTRVfhRYIZq0xtySkIQlJbmBDsX6GsVyDRFHM0AzOjRvZ7ELI5kgzCUWYAKhTk99WDj5aOSWY@KHnffCDqlB008FmEUZHXM2lmKaFnfffnu4r8eiLUyYuH1uf4fSYA39OKQUZ9wY" "Path"="C:\TTS\Svetlana"

[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\SPEECH\Voices\Tokens\TTS_MS_RU-RU_SVETLANA_11.0] @="Microsoft Svetlana" "CLSID"="{013ab33b-ad1a-401c-8bee-f6e2b046a94e}"

[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\SPEECH\Voices\Tokens\TTS_MS_RU-RU_SVETLANA_11.0\Attributes] "Language"="419" "Gender"="Female" "Age"="Adult"

[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\SPEECH\Voices\Tokens\TTS_MS_RU-RU_SVETLANA_11.0\NaturalVoiceConfig] "Path"="C:\TTS\Svetlana" "Key"="BGJJwTRVfhRYIZq0xtySkIQlJbmBDsX6GsVyDRFHM0AzOjRvZ7ELI5kgzCUWYAKhTk99WDj5aOSWY@KHnffCDqlB008FmEUZHXM2lmKaFnfffnu4r8eiLUyYuH1uf4fSYA39OKQUZ9wY"

1001ruchka avatar Jun 09 '25 14:06 1001ruchka

svetlana_reg.zip

Other languages can be found here: https://drive.google.com/drive/folders/1XM4cTHcfinfe-cVfHWQIAdsBVCNbqzoa

1001ruchka avatar Jun 09 '25 14:06 1001ruchka

@1001ruchka Wow, thank you so much for your quick answer. I'll try it right away. Thanks a lot!

Alan86024 avatar Jun 09 '25 15:06 Alan86024

@1001ruchka Wow, thank you so much for your quick answer. I'll try it right away. Thanks a lot!

I apologize for the mistake. In the registry, you specify the direct path to the folder with the voice, for example: C:\TTS\Svetlana

1001ruchka avatar Jun 09 '25 18:06 1001ruchka

@1001ruchka Hi, Thanks a lot. No problem, I have used it successfully.

Alan86024 avatar Jun 10 '25 06:06 Alan86024

Thanks a lot! I tried to use the Russian voice with your reg file and it works. I tried to create something similar for YunJhe (zh-TW), it is working for me while keeping CLSID as {013ab33b-ad1a-401c-8bee-f6e2b046a94e}.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\SPEECH\Voices\Tokens\TTS_MS_ZH-TW_YUNJHENEURAL_11.0]
@="Microsoft Server Speech Text to Speech Voice (zh-TW, YunJheNeural)"
"404"="Microsoft Server Speech Text to Speech Voice (zh-TW, YunJheNeural)"
"CLSID"="{013ab33b-ad1a-401c-8bee-f6e2b046a94e}"
"LangDataPath"="C:\\TTS\\leaked-voices\\ttsmodel.Zh-TW.5.0.39785395\\YunJhe\\MSTTSLocZhTW.dat"
"VoicePath"="C:\\TTS\\leaked-voices\\ttsmodel.Zh-TW.5.0.39785395\\YunJhe\\1028"

[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\SPEECH\Voices\Tokens\TTS_MS_ZH-TW_YUNJHENEURAL_11.0\Attributes]
"Language"="404"
"Gender"="Male"
"Age"="Adult"
"AudioFormats"="18"
"Name"="Microsoft Server Speech Text to Speech Voice (zh-TW, YunJheNeural)"
"Vendor"="Microsoft"
"Version"="11.0"

[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\SPEECH\Voices\Tokens\TTS_MS_ZH-TW_YUNJHENEURAL_11.0\NaturalVoiceConfig]
"Path"="C:\\TTS\\leaked-voices\\ttsmodel.Zh-TW.5.0.39785395\\YunJhe"
"Key"="BGJJwTRVfhRYIZq0xtySkIQlJbmBDsX6GsVyDRFHM0AzOjRvZ7ELI5kgzCUWYAKhTk99WDj5aOSWY@KHnffCDqlB008FmEUZHXM2lmKaFnfffnu4r8eiLUyYuH1uf4fSYA39OKQUZ9wY"


[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\SPEECH\Voices\Tokens\TTS_MS_ZH-TW_YUNJHENEURAL_11.0]
@="Microsoft Server Speech Text to Speech Voice (zh-TW, YunJheNeural)"
"404"="Microsoft Server Speech Text to Speech Voice (zh-TW, YunJheNeural)"
"CLSID"="{013ab33b-ad1a-401c-8bee-f6e2b046a94e}"
"LangDataPath"="C:\\TTS\\leaked-voices\\ttsmodel.Zh-TW.5.0.39785395\\YunJhe\\MSTTSLocZhTW.dat"
"VoicePath"="C:\\TTS\\leaked-voices\\ttsmodel.Zh-TW.5.0.39785395\\YunJhe\\1028"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\SPEECH\Voices\Tokens\TTS_MS_ZH-TW_YUNJHENEURAL_11.0\Attributes]
"Language"="404"
"Gender"="Male"
"Age"="Adult"
"AudioFormats"="18"
"Name"="Microsoft Server Speech Text to Speech Voice (zh-TW, YunJheNeural)"
"Vendor"="Microsoft"
"Version"="11.0"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\SPEECH\Voices\Tokens\TTS_MS_ZH-TW_YUNJHENEURAL_11.0\NaturalVoiceConfig]
"Key"="BGJJwTRVfhRYIZq0xtySkIQlJbmBDsX6GsVyDRFHM0AzOjRvZ7ELI5kgzCUWYAKhTk99WDj5aOSWY@KHnffCDqlB008FmEUZHXM2lmKaFnfffnu4r8eiLUyYuH1uf4fSYA39OKQUZ9wY"
"Path"="C:\\TTS\\leaked-voices\\ttsmodel.Zh-TW.5.0.39785395\\YunJhe"

Small-Ku avatar Aug 17 '25 12:08 Small-Ku