Hi David,
You could look at my Trek Version 3.6 and the .vbs file there. I have set
up in the Dialog the ability to change voices and save them inside an .ini file.
Then you could call back those settings at will when you need them for such
things as a command type voice to give an alert or something as you suggested.
Now in this file there are 2 engines being used and there the standard WE
engine and the Sapi engine Microsoft provides.
What I do is use several dictionaries to store original voice parms and
changed voice parms so you have a way of getting those settings from memory and
not an external file; loaded from the .ini file upon start-up ..
Below is part of that app and there is a change voice routine to change and
save settings.
Sub SaveActiveSettings()
'Store Original voices making sure it is not called again during save.
If myChangingActiveSettings Then Exit Sub
myChangingActiveSettings = True
myActiveSettings( "v") = ActiveSettings.Screen.Tone
myActiveSettings( "rl") = ActiveSettings.Screen.Rate
myActiveSettings( "pl") = ActiveSettings.Screen.Pitch
myActiveSettings( "vl") = ActiveSettings.Screen.Volume
End Sub
Sub ResetActiveSettings()
'Return or restore voice to original voice.
ActiveSettings.Screen.Tone = myActiveSettings( "v")
ActiveSettings.Screen.Rate = myActiveSettings( "rl")
ActiveSettings.Screen.Pitch = myActiveSettings( "pl")
ActiveSettings.Screen.Volume = myActiveSettings( "vl")
End Sub
Sub ChangeActiveSettings()
'Set voice to changed settings.
'Called while setting voices from the Voice dialog.
ActiveSettings.Screen.Tone = myChangedActiveSettings( "v")
ActiveSettings.Screen.Rate = myChangedActiveSettings( "rl")
ActiveSettings.Screen.Pitch = myChangedActiveSettings( "pl")
ActiveSettings.Screen.Volume = myChangedActiveSettings( "vl")
End Sub
Bruce
Sub ChangeVoice( dControls)
' Change Selected Voice Setting.
Dim txt, num
txt = dControls(0).Text( dControls(0).SelectedItem)
num = dControls(0).Data( dControls(0).SelectedItem)
Select Case dControls( 1)
Case "cmb_tone"
If myVoiceEngine = "WE" Then
myChangedActiveSettings( "v") = txt
Else
mySapiEngine.setVoiceByNum = num
End If
Case "cmb_rate"
If myVoiceEngine = "WE" Then
myChangedActiveSettings( "rl") = num
Else
mySapiEngine.setRate = num
End If
Case "cmb_pitch"
If myVoiceEngine = "WE" Then
myChangedActiveSettings( "pl") = num
Else
mySapiEngine.setPitch = num
End If
Case "cmb_volume"
If myVoiceEngine = "WE" Then
myChangedActiveSettings( "vl") = num
Else
mySapiEngine.setVolume = num
End If
End Select
If myVoiceEngine = "WE" Then
SaveActiveSettings
ChangeActiveSettings
Speak txt
Sleep 1000
Else
Silence
mySapiEngine.Speaking txt
End If
If myVoiceEngine = "WE" Then ResetActiveSettings
myChangingActiveSettings = False
End Sub
Sent: Friday, January 17, 2014 7:56 AM
Subject: Using a secondary voice for speech messages
Allright, you developers,
Here is another tricky question. Hope someone has a solution, as it would
have improved my projects a bit.
Le'ts for samplification say, that a user is operating his computer by
Eloquence Reed. Like many users actually are doing.
My app sends a few messages to the synthesizer, like status messages in given
operations, or resulting messages from other operations. Since they are all
sent to the same synth, it is likely it only will drown in the amount of other
activity the user is performing. And, he may not be able to discern what the
message is about. This could specially be the case, when an app is performing
some activity in the background, or in a separate window, and the user
currently is reading a document. Now, if the status message from the app pops
in, right in the middle of the document reading, either the user will think it
may be part of the document, or he may experience a break-down of the speech
altogether.
It would have many benefits, if the app could have its "internal" messages
sent to another voice, available on the user's system. Now, with the
Speak
command, in WE, is there a way to redirect the output to a secondary synth or
voice? Or, is there a "back-door" workaround to this issue?
I greatly would welcome any ideas you all may have, and maybe you have
implied any such solution in your apps already, and could please share some
techniques? Thanks alot,
---
This email is free from viruses and malware because avast! Antivirus protection
is active.
http://www.avast.com