summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tools/sapi_voice.vbs16
1 files changed, 13 insertions, 3 deletions
diff --git a/tools/sapi_voice.vbs b/tools/sapi_voice.vbs
index 50e923340e..4f411de5e0 100644
--- a/tools/sapi_voice.vbs
+++ b/tools/sapi_voice.vbs
@@ -39,7 +39,7 @@ Const STDERR = 2
39Dim oShell, oArgs, oEnv 39Dim oShell, oArgs, oEnv
40Dim oFSO, oStdIn, oStdOut 40Dim oFSO, oStdIn, oStdOut
41Dim bVerbose, bSAPI4, bList 41Dim bVerbose, bSAPI4, bList
42Dim sLanguage, sVoice, sSpeed, sVendor 42Dim sLanguage, sVoice, sSpeed, sName, sVendor
43 43
44Dim oSpVoice, oSpFS ' SAPI5 voice and filestream 44Dim oSpVoice, oSpFS ' SAPI5 voice and filestream
45Dim oTTS, nMode ' SAPI4 TTS object, mode selector 45Dim oTTS, nMode ' SAPI4 TTS object, mode selector
@@ -103,7 +103,10 @@ If bSAPI4 Then
103 nMode = oTTS.Find(sSelectString) 103 nMode = oTTS.Find(sSelectString)
104 If oTTS.LanguageID(nMode) = nLangID And (sVoice = "" Or _ 104 If oTTS.LanguageID(nMode) = nLangID And (sVoice = "" Or _
105 oTTS.Speaker(nMode) = sVoice Or oTTS.ModeName(nMode) = sVoice) Then 105 oTTS.Speaker(nMode) = sVoice Or oTTS.ModeName(nMode) = sVoice) Then
106 If bVerbose Then WScript.StdErr.WriteLine "Using " & sSelectString 106 sName = oTTS.ModeName(nMode)
107 If bVerbose Then
108 WScript.StdErr.WriteLine "Using " & sName & " for " & sSelectString
109 End If
107 Exit For 110 Exit For
108 Else 111 Else
109 sSelectString = "" 112 sSelectString = ""
@@ -151,7 +154,10 @@ Else ' SAPI5
151 End If 154 End If
152 Set oSpVoice.Voice = oSpVoice.GetVoices(sSelectString).Item(0) 155 Set oSpVoice.Voice = oSpVoice.GetVoices(sSelectString).Item(0)
153 If Err.Number = 0 Then 156 If Err.Number = 0 Then
154 If bVerbose Then WScript.StdErr.WriteLine "Using " & sSelectString 157 sName = oSpVoice.Voice.GetAttribute("Name")
158 If bVerbose Then
159 WScript.StdErr.WriteLine "Using " & sName & " for " & sSelectString
160 End If
155 Exit For 161 Exit For
156 Else 162 Else
157 sSelectString = "" 163 sSelectString = ""
@@ -172,6 +178,10 @@ Else ' SAPI5
172 If Err.Number <> 0 Then 178 If Err.Number <> 0 Then
173 Err.Clear 179 Err.Clear
174 sVendor = "(unknown)" 180 sVendor = "(unknown)"
181 ' Some L&H engines don't set the vendor attribute - check the name
182 If Len(sName) > 3 And Left(sName, 3) = "LH " Then
183 sVendor = "L&H"
184 End If
175 End If 185 End If
176 186
177 ' Filestream object for output 187 ' Filestream object for output