Set voice now properly handles RHVoice. install MS Mike and Mary for winxp 64 bit bottles.

This commit is contained in:
Storm Dragon
2021-07-04 19:30:57 -04:00
parent f5e48e50db
commit 6d7370640c
2 changed files with 19 additions and 8 deletions

View File

@ -2,7 +2,8 @@
# Set Voice
# 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
# The default rate is 5
# Note that RHVoice will start chopping ends of words above rate 5
#
# ■The contents of this file are subject to the Common Public Attribution
@ -136,14 +137,15 @@ set_voice() {
counter=$(( $counter + 1 ))
done
fullVoice="${voiceListFullName[$counter]}"
fullVoice="${fullVoice/RHVoice/RHVoice\\\\bdl}"
wineserver -k # If we don't do this it's likely wine will overwrite our reverted change or even clobber the registry key entirely
# Remove any existing rate change for voices
if [[ "$(uname)" == "Darwin" ]]; then
gsed -i '/"DefaultTTSRate"=dword:/d' "${WINEPREFIX}/user.reg"
gsed -i -E -e 's/"DefaultTokenId"="HKEY_LOCAL_MACHINE\\\\(SOFTWARE|Software)\\\\(Wow6432Node\\\\|)Microsoft\\\\Speech\\\\Voices\\\\Token(Enum|)s\\\\[^"]+"/"DefaultTokenId"="HKEY_LOCAL_MACHINE\\\\'"${fullVoice//\\/\\\\}"'"\n"DefaultTTSRate"=dword:0000000'${2:-7}'/g' "${WINEPREFIX}/user.reg"
gsed -i -E -e 's/"DefaultTokenId"="HKEY_LOCAL_MACHINE\\\\(SOFTWARE|Software)\\\\(Wow6432Node\\\\|)Microsoft\\\\Speech\\\\Voices\\\\Token(Enum|)s\\\\[^"]+"/"DefaultTokenId"="HKEY_LOCAL_MACHINE\\\\'"${fullVoice//\\/\\\\}"'"\n"DefaultTTSRate"=dword:0000000'${2:-5}'/g' "${WINEPREFIX}/user.reg"
else
sed -i '/"DefaultTTSRate"=dword:/d' "${WINEPREFIX}/user.reg"
sed -i -E -e 's/"DefaultTokenId"="HKEY_LOCAL_MACHINE\\\\(SOFTWARE|Software)\\\\(Wow6432Node\\\\|)Microsoft\\\\Speech\\\\Voices\\\\Token(Enum|)s\\\\[^"]+"/"DefaultTokenId"="HKEY_LOCAL_MACHINE\\\\'"${fullVoice//\\/\\\\}"'"\n"DefaultTTSRate"=dword:0000000'${2:-7}'/g' "${WINEPREFIX}/user.reg"
sed -i -E -e 's/"DefaultTokenId"="HKEY_LOCAL_MACHINE\\\\(SOFTWARE|Software)\\\\(Wow6432Node\\\\|)Microsoft\\\\Speech\\\\Voices\\\\Token(Enum|)s\\\\[^"]+"/"DefaultTokenId"="HKEY_LOCAL_MACHINE\\\\'"${fullVoice//\\/\\\\}"'"\n"DefaultTTSRate"=dword:0000000'${2:-5}'/g' "${WINEPREFIX}/user.reg"
fi
}
@ -157,6 +159,7 @@ test_voice() {
counter=$(( $counter + 1 ))
done
fullVoice="${voiceListFullName[$counter]}"
fullVoice="${fullVoice/RHVoice/RHVoice\\\\bdl}"
wineserver -k # If we don't do this it's likely wine will overwrite our reverted change or even clobber the registry key entirely
if [[ "$(uname)" == "Darwin" ]]; then
gsed -i -E -e 's/"DefaultTokenId"="HKEY_LOCAL_MACHINE\\\\(SOFTWARE|Software)\\\\(Wow6432Node\\\\|)Microsoft\\\\Speech\\\\Voices\\\\Token(Enum|)s\\\\[^"]+"/"DefaultTokenId"="HKEY_LOCAL_MACHINE\\\\'"${fullVoice//\\/\\\\}"'"/g' "${WINEPREFIX}/user.reg"