From 429ab0d2b2194cf9d29180602b5629784ce05f08 Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Sun, 2 Sep 2007 23:22:21 +0000 Subject: SAPI voice file generation: Added speed adjustment. TTS parameter: /speed:, 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 --- tools/sapi_voice.vbs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'tools/sapi_voice.vbs') 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")) -- cgit v1.2.3