diff options
author | Jens Arnold <amiconn@rockbox.org> | 2008-08-15 17:22:52 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2008-08-15 17:22:52 +0000 |
commit | 9f8654c5e23c69808d2622c5af86e208054caf2e (patch) | |
tree | 5ba6f637db0516d6e4ec6698caf1c95f93f92b34 /tools | |
parent | f6224b786034632f5fb3eabb661e6da2834c3297 (diff) | |
download | rockbox-9f8654c5e23c69808d2622c5af86e208054caf2e.tar.gz rockbox-9f8654c5e23c69808d2622c5af86e208054caf2e.zip |
Print the actually selected voice in verbose mode, and try to figure out the vendor from the name for SAPI5 L&H voices if there is no vendor attribute.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18289 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'tools')
-rw-r--r-- | tools/sapi_voice.vbs | 16 |
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 | |||
39 | Dim oShell, oArgs, oEnv | 39 | Dim oShell, oArgs, oEnv |
40 | Dim oFSO, oStdIn, oStdOut | 40 | Dim oFSO, oStdIn, oStdOut |
41 | Dim bVerbose, bSAPI4, bList | 41 | Dim bVerbose, bSAPI4, bList |
42 | Dim sLanguage, sVoice, sSpeed, sVendor | 42 | Dim sLanguage, sVoice, sSpeed, sName, sVendor |
43 | 43 | ||
44 | Dim oSpVoice, oSpFS ' SAPI5 voice and filestream | 44 | Dim oSpVoice, oSpFS ' SAPI5 voice and filestream |
45 | Dim oTTS, nMode ' SAPI4 TTS object, mode selector | 45 | Dim 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 |