Added a default voice rate option using 7 as default in set-voice.sh.

This commit is contained in:
Storm Dragon 2020-10-04 12:27:36 -04:00
parent ce95044836
commit b5f33ff908

View File

@ -1,6 +1,8 @@
#!/bin/bash #!/bin/bash
# Set Voice # Set Voice
# Set the default wine voice based on installed options. # Set the default wine voice based on installed options.
# Rate can be specified as a numeric argument to this script, 1 through 9.
# The default rate is 7
# #
# Copyright 2020, Storm Dragon, <storm_dragon@linux-a11y.org> # Copyright 2020, Storm Dragon, <storm_dragon@linux-a11y.org>
# #
@ -104,7 +106,9 @@ set_voice() {
done done
fullVoice=${voiceListFullName[$counter]} fullVoice=${voiceListFullName[$counter]}
wineserver -k # If we don't do this it's likely wine will overwrite our reverted change or even clobber the registry key entirely wineserver -k # If we don't do this it's likely wine will overwrite our reverted change or even clobber the registry key entirely
sed -i -E -e 's/"DefaultTokenId"="HKEY_LOCAL_MACHINE\\\\(SOFTWARE|Software)\\\\(Wow6432Node\\\\|)Microsoft\\\\Speech\\\\Voices\\\\Tokens\\\\[^"]+"/"DefaultTokenId"="HKEY_LOCAL_MACHINE\\\\'"${fullVoice//\\/\\\\}"'"/g' "${WINEPREFIX}/user.reg" # Remove any existing rate change for voices
sed -i '/"DefaultTTSRate"=dword:/d' "${WINEPREFIX}/user.reg"
sed -i -E -e 's/"DefaultTokenId"="HKEY_LOCAL_MACHINE\\\\(SOFTWARE|Software)\\\\(Wow6432Node\\\\|)Microsoft\\\\Speech\\\\Voices\\\\Tokens\\\\[^"]+"/"DefaultTokenId"="HKEY_LOCAL_MACHINE\\\\'"${fullVoice//\\/\\\\}"'"\n"DefaultTTSRate"=dword:0000000'${2:-7}'/g' "${WINEPREFIX}/user.reg"
} }
test_voice() { test_voice() {
@ -151,7 +155,7 @@ voice="$(menulist ${voiceList[@]})"
case $? in case $? in
0) 0)
set_voice "$voice" ; exit=0 ;; set_voice "$voice" "$1" ; exit=0 ;;
3) 3)
test_voice "$voice";; test_voice "$voice";;
*) *)