mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-13 18:17:39 -04:00
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:
parent
f6224b7860
commit
9f8654c5e2
1 changed files with 13 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue