在原示例窗口中增加“语音校对”按钮
Dim yy As WinForm.ListBox = e.Form.Controls("ListBox1")
Dim sp As New DotNetSpeech.SpVoice()
Dim vl As String = e.Form.Controls("txtContent").Value '获得要朗读的文本
sp.Rate = e.Form.Controls("boxSpeed").Value '设置语速
sp.Voice = sp.GetVoices(String.Empty,String.Empty).Item(yy.SelectedIndex) '选择语音库
With CurrentTable
For r As Integer = .TopPosition To .BottomPosition
For c As Integer = .LeftCol To .RightCol
Dim v As String = .Rows(r)(c)
If e.Form.Controls("rdoAsync").Checked Then
sp.Speak(v, DotNetSpeech.SpeechVoiceSpeakFlags.SVSFlagsAsync) '异步朗读
Else
sp.Speak(v, DotNetSpeech.SpeechVoiceSpeakFlags.SVSFDefault) '同步朗读
End If
Next
Next
End With
[此贴子已经被作者于2011-6-23 8:32:25编辑过]