Improvements to the set voice convenience script.
This commit is contained in:
parent
f5383080e1
commit
0b11410733
@ -100,11 +100,11 @@ set_voice() {
|
|||||||
local tmp="$1"
|
local tmp="$1"
|
||||||
local fullVoice
|
local fullVoice
|
||||||
local counter=0
|
local counter=0
|
||||||
for x in ${voiceList[@]} ; do
|
for x in "${voiceList[@]}" ; do
|
||||||
[ "$x" = "$tmp" ] && break
|
[ "$x" = "$tmp" ] && break
|
||||||
counter=$(( $counter + 1 ))
|
counter=$(( $counter + 1 ))
|
||||||
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
|
||||||
# Remove any existing rate change for voices
|
# Remove any existing rate change for voices
|
||||||
sed -i '/"DefaultTTSRate"=dword:/d' "${WINEPREFIX}/user.reg"
|
sed -i '/"DefaultTTSRate"=dword:/d' "${WINEPREFIX}/user.reg"
|
||||||
@ -116,11 +116,11 @@ test_voice() {
|
|||||||
local tmp="$1"
|
local tmp="$1"
|
||||||
local fullVoice
|
local fullVoice
|
||||||
local counter=0
|
local counter=0
|
||||||
for x in ${voiceList[@]} ; do
|
for x in "${voiceList[@]}" ; do
|
||||||
[ "$x" = "$tmp" ] && break
|
[ "$x" = "$tmp" ] && break
|
||||||
counter=$(( $counter + 1 ))
|
counter=$(( $counter + 1 ))
|
||||||
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"
|
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
|
cat << "EOF" > /tmp/speak.vbs
|
||||||
@ -151,7 +151,7 @@ echo "voiceListFullName: ${voiceListFullName[@]}"
|
|||||||
#exit 1
|
#exit 1
|
||||||
exit=1
|
exit=1
|
||||||
while [[ $exit -ne 0 ]] ; do
|
while [[ $exit -ne 0 ]] ; do
|
||||||
voice="$(menulist ${voiceList[@]})"
|
voice="$(menulist "${voiceList[@]}")"
|
||||||
|
|
||||||
case $? in
|
case $? in
|
||||||
0)
|
0)
|
||||||
|
Loading…
Reference in New Issue
Block a user