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
This commit is contained in:
parent
5dbea469a6
commit
429ab0d2b2
1 changed files with 8 additions and 1 deletions
|
@ -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"))
|
||||
|
|
Loading…
Reference in a new issue