Improvements to the set voice convenience script.

This commit is contained in:
Storm Dragon 2020-11-20 20:10:28 -05:00
parent f5383080e1
commit 0b11410733

View File

@ -100,11 +100,11 @@ set_voice() {
local tmp="$1"
local fullVoice
local counter=0
for x in ${voiceList[@]} ; do
for x in "${voiceList[@]}" ; do
[ "$x" = "$tmp" ] && break
counter=$(( $counter + 1 ))
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
# Remove any existing rate change for voices
sed -i '/"DefaultTTSRate"=dword:/d' "${WINEPREFIX}/user.reg"
@ -116,11 +116,11 @@ test_voice() {
local tmp="$1"
local fullVoice
local counter=0
for x in ${voiceList[@]} ; do
for x in "${voiceList[@]}" ; do
[ "$x" = "$tmp" ] && break
counter=$(( $counter + 1 ))
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
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"
cat << "EOF" > /tmp/speak.vbs
@ -151,7 +151,7 @@ echo "voiceListFullName: ${voiceListFullName[@]}"
#exit 1
exit=1
while [[ $exit -ne 0 ]] ; do
voice="$(menulist ${voiceList[@]})"
voice="$(menulist "${voiceList[@]}")"
case $? in
0)