We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,039 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Microsoft Speech api

I am having a problem and that is I have buttons to read text to speech like play pause and stop

I have created 4 buttons Play,Pause,Stop,Resume
but now I dont want the Resume button, instead when I click on the pause button it should pause the speech and later when I click the same button again I need the speach to be resumed
this is what I wrote
I know this is chilish then also I am not getting it plz help ASAP !

Public SAPI = CreateObject("SAPI.spvoice")

Private Sub startSpeaking_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles startSpeaking.Click
    SAPI.speak(RichTextBox1.Text, 3)
    findHighlight(TextBox1.Text)
End Sub

Private Sub pauseSpeech_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles pauseSpeech.Click
    SAPI.Pause()
End Sub

Private Sub stopSpeech_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles stopSpeech.Click
    SAPI.Speak(vbNullString, 2)
    'SAPI = Nothing
End Sub

Private Sub resumeSpeech_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles resumeSpeech.Click
    SAPI.Resume()
End Sub
2
Contributors
4
Replies
1 Hour
Discussion Span
1 Year Ago
Last Updated
5
Views
Question
Answered
Darkone
Newbie Poster
3 posts since Mar 2012
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0

Declare a boolean variable at the top of the class.

public Paused as Boolean = false
'When you fire your click event do this;
If Paused = false Then
    'Pause code here
    Paused = true
ElseIf Paused = True Then
    'Unpause code here.
    Paused = False
End If
Begginnerdev
Practically a Posting Shark
862 posts since Apr 2010
Reputation Points: 184
Solved Threads: 142
Skill Endorsements: 8

Thanks a lot for helping me !

Darkone
Newbie Poster
3 posts since Mar 2012
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0

Thanks a lot for helping me !

Darkone
Newbie Poster
3 posts since Mar 2012
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0

Np, friend. Don't forget to marked the thread as solved. :)

Begginnerdev
Practically a Posting Shark
862 posts since Apr 2010
Reputation Points: 184
Solved Threads: 142
Skill Endorsements: 8
Question Answered as of 1 Year Ago by Begginnerdev

This question has already been solved: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.0811 seconds using 2.67MB