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
This commit is contained in:
Jens Arnold 2008-08-15 17:22:52 +00:00
parent f6224b7860
commit 9f8654c5e2

View file

@ -39,7 +39,7 @@ Const STDERR = 2
Dim oShell, oArgs, oEnv Dim oShell, oArgs, oEnv
Dim oFSO, oStdIn, oStdOut Dim oFSO, oStdIn, oStdOut
Dim bVerbose, bSAPI4, bList Dim bVerbose, bSAPI4, bList
Dim sLanguage, sVoice, sSpeed, sVendor Dim sLanguage, sVoice, sSpeed, sName, sVendor
Dim oSpVoice, oSpFS ' SAPI5 voice and filestream Dim oSpVoice, oSpFS ' SAPI5 voice and filestream
Dim oTTS, nMode ' SAPI4 TTS object, mode selector Dim oTTS, nMode ' SAPI4 TTS object, mode selector
@ -103,7 +103,10 @@ If bSAPI4 Then
nMode = oTTS.Find(sSelectString) nMode = oTTS.Find(sSelectString)
If oTTS.LanguageID(nMode) = nLangID And (sVoice = "" Or _ If oTTS.LanguageID(nMode) = nLangID And (sVoice = "" Or _
oTTS.Speaker(nMode) = sVoice Or oTTS.ModeName(nMode) = sVoice) Then 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 Exit For
Else Else
sSelectString = "" sSelectString = ""
@ -151,7 +154,10 @@ Else ' SAPI5
End If End If
Set oSpVoice.Voice = oSpVoice.GetVoices(sSelectString).Item(0) Set oSpVoice.Voice = oSpVoice.GetVoices(sSelectString).Item(0)
If Err.Number = 0 Then 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 Exit For
Else Else
sSelectString = "" sSelectString = ""
@ -172,6 +178,10 @@ Else ' SAPI5
If Err.Number <> 0 Then If Err.Number <> 0 Then
Err.Clear Err.Clear
sVendor = "(unknown)" 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 End If
' Filestream object for output ' Filestream object for output