summaryrefslogtreecommitdiff
path: root/tools/sapi_voice.vbs
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2007-09-02 23:22:21 +0000
committerJens Arnold <amiconn@rockbox.org>2007-09-02 23:22:21 +0000
commit429ab0d2b2194cf9d29180602b5629784ce05f08 (patch)
tree015933a309eff8e13d9a9749b106843b61502cc8 /tools/sapi_voice.vbs
parent5dbea469a6b476d338353c46473ba9bd3ef0bcb5 (diff)
SAPI voice file generation: Added speed adjustment. TTS parameter: /speed:<n>, SAPI5: allowed range -10..+10 (0 == default), SAPI4: words per minute (allowed range and default depend on engine).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14588 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'tools/sapi_voice.vbs')
-rwxr-xr-xtools/sapi_voice.vbs9
1 files changed, 8 insertions, 1 deletions
diff --git a/tools/sapi_voice.vbs b/tools/sapi_voice.vbs
index cdccef6c3a..7d52329028 100755
--- 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
-Dim sLanguage, sVoice
+Dim sLanguage, sVoice, sSpeed
Dim oSpVoice, oSpFS ' SAPI5 voice and filestream
Dim oTTS, nMode ' SAPI4 TTS object, mode selector
@@ -53,6 +53,7 @@ Set oArgs = WScript.Arguments.Named
bSAPI4 = oArgs.Exists("sapi4")
sLanguage = oArgs.Item("language")
sVoice = oArgs.Item("voice")
+sRate = oArgs.Item("speed")
If bSAPI4 Then
' Create SAPI4 ActiveVoice object
@@ -92,6 +93,9 @@ If bSAPI4 Then
WScript.Quit 1
End If
oTTS.Select nMode
+
+ ' Speed selection
+ If sRate <> "" Then oSpVoice.Speed = sSpeed
Else ' SAPI5
' Create SAPI5 object
Set oSpVoice = CreateObject("SAPI.SpVoice")
@@ -123,6 +127,9 @@ Else ' SAPI5
WScript.Quit 1
End If
+ ' Speed selection
+ If sRate <> "" Then oSpVoice.Rate = sSpeed
+
' Filestream object for output
Set oSpFS = CreateObject("SAPI.SpFileStream")
oSpFS.Format.Type = AudioFormat(oSpVoice.Voice.GetAttribute("Vendor"))