-
Notifications
You must be signed in to change notification settings - Fork 19
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 Voice Change #8
base: main
Are you sure you want to change the base?
Conversation
Prevents Unity crashes if no voice found.
HResult to SPFindBestToken unused.
Adds function to change the voice to the WindowsTTS class when using the Windows SAPI API.
Formatting to match upstream. Should clean up diff.
This is amazing. Could you also create a 32Bit version of the compiled DLL? Otherwise this feature would only be available in the 64Bit. Granted, that's probably 99.99% of all users :D but it could lead to some really confusing bug reports |
No problem. I could actually see us being in that 1% that needs 32bit. I've got another update to enable rate changes that I was just cleaning up so I will combine it all into one pull request. |
SAPI Speech Rate ChangeAdds ability to change SAPI speech rate. This is intended for use in public installations where a user cannot configure their preferred rate as they would on their own personal device. Voice Change Method Added to UAP_AccesibilityManagerAdds Voice Change added and Speech Rate method updated in UAP_AudioQueue
Adds Win32 dll to
|
SAPI Voice Change
Adds the ability to change the voice used by the Windows SAPI API to allow the screen reader language to be changed mid-game. An English language voice, like Microsoft David, would not be able to correctly read Spanish content so a Spanish language voice, like Microsoft Sabina, is required. This is intended for use in public installations where a user cannot configure their preferred language as they would on their own personal device. The language can now be changed in-game and be read correctly by the Windows SAPI API. This only works with the Windows SAPI API.
WindowsTTS.cs
Adds
SetVoice(string name)
function to WindowsTTS class. This will use the WindowsTTS dll to change the voice used by the Windows SAPI API. Takes the Name attribute of an installed SAPI voice as the parameter. Available names can be found in the registry underHKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\Voices\Tokens\[voice]\Attributes
.Example
WindowsTTS.SetVoice("Microsoft David Desktop");
WindowsTTS.dll
SetVoiceSAPI
function will now validatecpToken
before attempting to callISpVoice::SetVoice(cpToken)
. This prevents Unity crashes when invalid voice provided. Compiled, updated, dll added to Plugins/x86_x64 directory.