diff options
author | Jens Arnold <amiconn@rockbox.org> | 2008-08-04 21:01:44 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2008-08-04 21:01:44 +0000 |
commit | 0319e3be3fbad4ee0f629a46160d172f4faca5b5 (patch) | |
tree | c88d4516c8a5cc09c258d103d23b6748628de7a8 /tools | |
parent | ac40296723f072665121439363fd038ea104166b (diff) | |
download | rockbox-0319e3be3fbad4ee0f629a46160d172f4faca5b5.tar.gz rockbox-0319e3be3fbad4ee0f629a46160d172f4faca5b5.zip |
Handle SAPI5 voices without vendor attribute (reported for japanese L&H engines - see FS#9148).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18196 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'tools')
-rw-r--r-- | tools/sapi_voice.vbs | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/tools/sapi_voice.vbs b/tools/sapi_voice.vbs index 3f6b657066..a7d773e40e 100644 --- a/tools/sapi_voice.vbs +++ b/tools/sapi_voice.vbs @@ -34,7 +34,7 @@ Const SPSF_48kHz16BitMono = 38 Dim oShell, oArgs, oEnv
Dim bVerbose, bSAPI4, bList
-Dim sLanguage, sVoice, sSpeed
+Dim sLanguage, sVoice, sSpeed, sVendor
Dim oSpVoice, oSpFS ' SAPI5 voice and filestream
Dim oTTS, nMode ' SAPI4 TTS object, mode selector
@@ -109,6 +109,10 @@ If bSAPI4 Then ' Speed selection
If sSpeed <> "" Then oTTS.Speed = sSpeed
+
+ ' Get vendor infomration
+ sVendor = oTTS.MfgName(nMode)
+
Else ' SAPI5
' Create SAPI5 object
Set oSpVoice = CreateObject("SAPI.SpVoice")
@@ -154,9 +158,16 @@ Else ' SAPI5 ' Speed selection
If sSpeed <> "" Then oSpVoice.Rate = sSpeed
+ ' Get vendor information, protect from missing attribute
+ sVendor = oSpVoice.Voice.GetAttribute("Vendor")
+ If Err.Number <> 0 Then
+ Err.Clear
+ sVendor = "(unknown)"
+ End If
+
' Filestream object for output
Set oSpFS = CreateObject("SAPI.SpFileStream")
- oSpFS.Format.Type = AudioFormat(oSpVoice.Voice.GetAttribute("Vendor"))
+ oSpFS.Format.Type = AudioFormat(sVendor)
End If
Do
@@ -169,11 +180,7 @@ Do Case "QUERY"
Select Case aLine(1)
Case "VENDOR"
- If bSAPI4 Then
- WScript.StdOut.WriteLine oTTS.MfgName(nMode)
- Else
- WScript.StdOut.WriteLine oSpVoice.Voice.GetAttribute("Vendor")
- End If
+ WScript.StdOut.WriteLine sVendor
End Select
Case "SPEAK"
aData = Split(aLine(1), vbTab, 2)
|