Moving toward sandboxed wine installations. This means set-voice.sh needs to create and run its script inside the wine directory.

This commit is contained in:
stormdragon2976 2022-12-23 02:12:34 -05:00
parent 7f9194828a
commit b115e3759f

View File

@ -163,12 +163,12 @@ test_voice() {
fullVoice="${fullVoice/RHVoice/RHVoice\\\\${RHVoiceName}}"
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\\\\Token(Enum|)s\\\\[^"]+"/"DefaultTokenId"="HKEY_LOCAL_MACHINE\\\\'"${fullVoice//\\/\\\\}"'"/g' "${WINEPREFIX}/user.reg"
cat << "EOF" > /tmp/speak.vbs
cat << "EOF" > "${bottle}/drive_c/windows/temp/speak.vbs"
dim speechobject
set speechobject=createobject("sapi.spvoice")
speechobject.speak "This is a test of your chosen voice. It contains multiple sentences and punctuation, and is designed to give a full representation of this voices qualities."
EOF
wine cscript "z:\tmp\speak.vbs"
wine cscript "c:\windows\temp\speak.vbs"
}
# Handle voice restore, but only if voice changed
@ -176,12 +176,12 @@ doRestore=1
trap restore_voice SIGINT
# In case the user hasn't run a game using sapi in this prefix yet, let's try to initialize all the registry keys properly.
cat << "EOF" > /tmp/speak.vbs
cat << "EOF" > "${bottle}/drive_c/windows/temp/speak.vbs"
dim speechobject
set speechobject=createobject("sapi.spvoice")
speechobject.speak ""
EOF
wine cscript "z:\tmp\speak.vbs"
wine cscript "c:\windows\temp\speak.vbs"
# Create an array of available voices.
ifs="$IFS"