You are reading help file online using chmlib.com
|
Object: SpVoice
The Rate property gets and sets the speaking rate of the voice.
Values for the Rate property range from -10 to 10, which represent the slowest and the fastest speaking rates, respectively.
At the beginning of each Speak or SpeakStream method, the voice sets its speaking rate according to the value of its Rate property, and speaks the entire stream at that rate. The Rate property can be changed at any time, but the actual speaking rate will not reflect the changed property value until it begins a new stream.
Set: | SpVoice.Rate = Long |
Get: | Long = SpVoice.Rate |
The following Visual Basic form code demonstrates the use of the Rate and the Volume properties. To run this code, create a form with the following controls:
Paste this code into the Declarations section of the form.
The Form_Load procedure creates a voice object and associates the VScrollbar with the voice's Volume property and the HScrollbar with the voice's Rate property. Adjusting the scroll bars changes the settings of the Volume and Rate properties. The Command1_Click procedure speaks a phrase in order to demonstrate the effects of the changes.
Option Explicit
Private V As SpeechLib.SpVoice
Private Sub Command1_Click()
V.Speak "The quick brown fox jumped over the lazy dog.", SVSFlagsAsync
End Sub
Private Sub Form_Load()
Set V = New SpeechLib.SpVoice
VScroll1.Min = 0
VScroll1.Max = 100
VScroll1.Value = V.Volume
HScroll1.Min = -10
HScroll1.Max = 10
HScroll1.Value = V.Rate
Text1.Text = "Vol: " & VScroll1.Value & "; Rate: " & HScroll1.Value
End Sub
Private Sub HScroll1_Change()
V.Rate = HScroll1.Value
Text1.Text = "Vol: " & VScroll1.Value & "; Rate: " & HScroll1.Value
End Sub
Private Sub VScroll1_Change()
V.Volume = VScroll1.Value
Text1.Text = "Vol: " & VScroll1.Value & "; Rate: " & HScroll1.Value
End Sub
You are reading help file online using chmlib.com
|