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) |
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 Dim oShell, oArgs, oEnv
Dim oFSO, oStdIn, oStdOut
Dim bVerbose, bSAPI4, bList
-Dim sLanguage, sVoice, sSpeed, sVendor
+Dim sLanguage, sVoice, sSpeed, sName, sVendor
Dim oSpVoice, oSpFS ' SAPI5 voice and filestream
Dim oTTS, nMode ' SAPI4 TTS object, mode selector
@@ -103,7 +103,10 @@ If bSAPI4 Then nMode = oTTS.Find(sSelectString)
If oTTS.LanguageID(nMode) = nLangID And (sVoice = "" Or _
oTTS.Speaker(nMode) = sVoice Or oTTS.ModeName(nMode) = sVoice) Then
- If bVerbose Then WScript.StdErr.WriteLine "Using " & sSelectString
+ sName = oTTS.ModeName(nMode)
+ If bVerbose Then
+ WScript.StdErr.WriteLine "Using " & sName & " for " & sSelectString
+ End If
Exit For
Else
sSelectString = ""
@@ -151,7 +154,10 @@ Else ' SAPI5 End If
Set oSpVoice.Voice = oSpVoice.GetVoices(sSelectString).Item(0)
If Err.Number = 0 Then
- If bVerbose Then WScript.StdErr.WriteLine "Using " & sSelectString
+ sName = oSpVoice.Voice.GetAttribute("Name")
+ If bVerbose Then
+ WScript.StdErr.WriteLine "Using " & sName & " for " & sSelectString
+ End If
Exit For
Else
sSelectString = ""
@@ -172,6 +178,10 @@ Else ' SAPI5 If Err.Number <> 0 Then
Err.Clear
sVendor = "(unknown)"
+ ' Some L&H engines don't set the vendor attribute - check the name
+ If Len(sName) > 3 And Left(sName, 3) = "LH " Then
+ sVendor = "L&H"
+ End If
End If
' Filestream object for output
|