VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Example with MS Agent, text-to-speech

by Amir Malik (1 Submission)
Category: OLE/COM/DCOM/Active-X
Compatability: Visual Basic 3.0
Difficulty: Unknown Difficulty
Date Added: Wed 3rd February 2021
Rating: (8 Votes)

Microsoft Agent will speak (computerized voice) the contents of a textbox or richtextbox to you!

Inputs
the text to speak, or just paste it
Assumes
components/objects: Microsoft Direct Text-to-Speech control rich text box 2 command buttons the sp is the DirectSS control text box for the computer voice speed
Code Returns
sound!

Rate Example with MS Agent, text-to-speech

' MSAGENT example by Amir Malik
' website: http://amir142.cjb.net
' e-mail : [email protected]

Private Sub cmdPaste_Click()
  TextData.Text = Clipboard.GetText
End Sub
Private Sub cmdPauseR_Click()
  If cmdPauseR.Caption = "&Pause / Stop" Then
    sp.AudioPause
    cmdPauseR.Caption = "&Resume"
  ElseIf cmdPauseR.Caption = "&Resume" Then
    sp.AudioResume
    cmdPauseR.Caption = "&Pause / Stop"
  End If
End Sub
Private Sub cmdSpeak_Click()
  sp.Speak TextData.Text
  sp.Speed = txtSpeed.Text
  Sspeak = True
End Sub
Private Sub txtSpeed_LostFocus()
  If txtSpeed.Text < 50 Then
    MsgBox "Speed is too low."
    txtSpeed.Text = "150"
  End If
  If txtSpeed.Text > 250 Then
    MsgBox "Speed is too high."
    txtSpeed.Text = "150"
  End If
End Sub

Download this snippet    Add to My Saved Code

Example with MS Agent, text-to-speech Comments

No comments have been posted about Example with MS Agent, text-to-speech. Why not be the first to post a comment about Example with MS Agent, text-to-speech.

Post your comment

Subject:
Message:
0/1000 characters