Click here to Skip to main content
15,912,294 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
AnswerRe: to read word document in the textbox Pin
Gerry Schmitz8-Nov-09 2:48
mveGerry Schmitz8-Nov-09 2:48 
GeneralRe: to read word document in the textbox Pin
vimalkumarsinghal9-Nov-09 2:50
vimalkumarsinghal9-Nov-09 2:50 
GeneralRe: to read word document in the textbox Pin
Gerry Schmitz9-Nov-09 4:22
mveGerry Schmitz9-Nov-09 4:22 
AnswerRe: to read word document in the textbox Pin
Dave Kreskowiak8-Nov-09 3:38
mveDave Kreskowiak8-Nov-09 3:38 
AnswerRe: to read word document in the textbox Pin
Shameel8-Nov-09 23:27
professionalShameel8-Nov-09 23:27 
GeneralRe: to read word document in the textbox Pin
vimalkumarsinghal9-Nov-09 2:52
vimalkumarsinghal9-Nov-09 2:52 
GeneralRe: to read word document in the textbox Pin
Shameel9-Nov-09 23:48
professionalShameel9-Nov-09 23:48 
Questionhow to convert this code to vb.NET?? Voice program..!! Pin
kaex217-Nov-09 16:48
kaex217-Nov-09 16:48 
hello to everyone.. i want to ask how to do this code in vb.net.. becuase i am newly in the vb.net .. i only got correctly in vb6.. there are some differences but i think their almost the same.. can you help me guys to do my program..?? my problem is that i cant generate the voice... it gives me error but in vb6 its working properly.. i am using now vb.net and sapi 5.1.. my OS windows XP.. this is like an ordering application..

here's my code...


Public Class main<br />
<br />
    Public gmode As Integer<br />
    Public gRestoreGrammar As Boolean<br />
    Public additional As Boolean<br />
<br />
    Private Sub AxDirectSR1_PhraseFinish(ByVal flags As Long, ByVal beginhi As Long, ByVal beginlo As Long, ByVal endhi As Long, ByVal endlo As Long, ByVal Phrase As String, ByVal parsed As String, ByVal results As Long)<br />
        If (parsed = "") Then<br />
            AxDirectSR1.Deactivate()<br />
            If (Rnd() > 0.5) Then<br />
                AxDirectSS1.Speak("kindly repeat your order again sir.")<br />
            Else<br />
                AxDirectSS1.Speak("please follow the menu.")<br />
            End If<br />
        Else<br />
            If (parsed = "ok") Then<br />
                AxDirectSR1.Deactivate()<br />
                If (additional = False) Then<br />
                    gmode = 2<br />
                    AxDirectSS1.Speak("Would like to have drinks?")<br />
<br />
                Else<br />
                    gmode = 3<br />
                    AxDirectSS1.Speak("would that be all sir?")<br />
                End If<br />
            ElseIf (parsed = "cancel") Then<br />
                Dim Item As String<br />
                Item = ListBox1.Items.Count - 1<br />
                If (Item >= 0) Then<br />
                    ListBox1.Items.Remove(ListBox1.Items.Count - 1)<br />
                    AxDirectSR1.Deactivate()<br />
                    AxDirectSS1.Speak("your order cancel")<br />
                End If<br />
            ElseIf (parsed = "no") Then<br />
                If (gmode = 2) Then<br />
                    gmode = 3<br />
                    additional = True<br />
                    AxDirectSR1.Deactivate()<br />
                    AxDirectSS1.Speak("verifying your order")<br />
                ElseIf (gmode = 3) Then<br />
                    gmode = 0<br />
                    gRestoreGrammar = True<br />
                    AxDirectSR1.Deactivate()<br />
                    AxDirectSS1.Speak("you can continue your order")<br />
                Else<br />
                    gmode = 0<br />
                    gRestoreGrammar = True<br />
                End If<br />
            ElseIf (parsed = "yes") Then<br />
<br />
                If (gmode = 2) Then<br />
                    'form2.Show()<br />
                    gmode = 3<br />
                    AxDirectSR1.Deactivate()<br />
                    AxDirectSS1.Speak("would that be all")<br />
<br />
                ElseIf (gmode = 3) Then<br />
                    Dim total As Integer<br />
                    total = 0<br />
                    For i = 0 To ListBox1.Items.Count - 1<br />
                        total = total + Val(ListBox1.Items(i))<br />
                    Next i<br />
                    ListBox1.Items.Add("---total is: $" + Format(total, "###0.00"))<br />
                    gmode = 1<br />
                    gRestoreGrammar = True<br />
<br />
                    AxDirectSR1.Deactivate()<br />
<br />
                    AxDirectSS1.Speak("Your total will be $" + Format(total, "###0.00") + " at the next window please.")<br />
                End If<br />
            Else<br />
                AxDirectSR1.Deactivate()<br />
                ListBox1.Items.Add(parsed)<br />
            End If<br />
        End If<br />
<br />
        ListBox1.SelectedIndex = ListBox1.Items.Count - 1<br />
        AxDirectSS1.Speak(Phrase)<br />
<br />
    End Sub<br />
    Private Sub DirectSS1_AudioStop(ByVal hi As Long, ByVal lo As Long)<br />
        If (gmode = 1) Then<br />
            ListBox1.Items.Clear()<br />
            gmode = 0<br />
            AxDirectSS1.Speak("Hi! May I take your order?")<br />
        Else<br />
            If (gmode = 2) Or (gmode = 3) Then<br />
<br />
                AxDirectSR1.GrammarFromFile("C:\Documents and Settings\kaex21\My Documents\Visual Studio 2008\Projects\Project1\WindowsApplication6\WindowsApplication6\yesno.txt")<br />
<br />
            ElseIf (gRestoreGrammar) Then<br />
<br />
                AxDirectSR1.GrammarFromFile("C:\Documents and Settings\kaex21\My Documents\Visual Studio 2008\Projects\Project1\WindowsApplication6\WindowsApplication6\menu.txt")<br />
                gRestoreGrammar = False<br />
<br />
            End If<br />
            REM we had to turn off listening before talking, so now that we are done talking we<br />
            REM should start listening again<br />
            AxDirectSR1.Activate()<br />
        End If<br />
    End Sub<br />
<br />
    Private Sub main_Terminate()<br />
        AxDirectSR1.Deactivate()<br />
    End Sub<br />
<br />
<br />
<br />
    Private Sub LinkLabel2_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles LinkLabel2.LinkClicked<br />
        Form5.Show()<br />
        Visible = False<br />
<br />
    End Sub<br />
<br />
    Private Sub Label9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label9.Click<br />
<br />
    End Sub<br />
<br />
    Private Sub GroupBox18_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GroupBox18.Enter<br />
<br />
    End Sub<br />
<br />
    Private Sub LinkLabel3_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles LinkLabel3.LinkClicked<br />
        End<br />
    End Sub<br />
<br />
<br />
    Private Sub main_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<br />
        gmode = 0<br />
        gRestoreGrammar = False<br />
<br />
        On Error GoTo GeneralFail<br />
        REM we just use this function once, on the first callback, then the timer isn't needed anymore<br />
        Dim engine<br />
        REM Initialize the recognizer. We want command and control, so find and select that engine (or best match)<br />
        AxDirectSR1.Initialized = 1<br />
<br />
        engine = AxDirectSR1.Find("MfgName=Microsoft;Grammars=1")<br />
        AxDirectSR1.Select(engine)<br />
<br />
        REM Burger.txt is our uncompiled grammar. Compile and load it now.<br />
        AxDirectSR1.GrammarFromFile("C:\Documents and Settings\kaex21\My Documents\Visual Studio 2008\Projects\Project1\WindowsApplication6\WindowsApplication6\menu.txt")<br />
        REM Now load the synthesizer, find and select any female voice from microsoft<br />
                AxDirectSS1.Select(AxDirectSS1.Find("MfgName=Microsoft;Gender=1"))<br />
<br />
        REM Start the voice interface...control goes to DirectSS1_AudioStop after this is said, gMode=0<br />
        AxDirectSS1.Speak("Welcome to kaex restaurant, sit back and enjoy as you take your order.")<br />
<br />
        REM sometimes the vb environment comes to front while we're loading, so take the screen back<br />
        Me.Show()<br />
        GoTo done<br />
GeneralFail:<br />
        MsgBox("Unable to start using text to speech or recognition.")<br />
done:<br />
<br />
    End Sub<br />
    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick<br />
<br />
    End Sub<br />
<br />
End Class

AnswerRe: how to convert this code to vb.NET?? Voice program..!! Pin
Abhijit Jana7-Nov-09 16:56
professionalAbhijit Jana7-Nov-09 16:56 
GeneralRe: how to convert this code to vb.NET?? Voice program..!! Pin
kaex217-Nov-09 17:42
kaex217-Nov-09 17:42 
AnswerRe: how to convert this code to vb.NET?? Voice program..!! Pin
Shameel8-Nov-09 23:24
professionalShameel8-Nov-09 23:24 
Question'system.web.extensions' is already defined. Pin
senselva7-Nov-09 6:34
senselva7-Nov-09 6:34 
AnswerRe: 'system.web.extensions' is already defined. Pin
Not Active7-Nov-09 6:57
mentorNot Active7-Nov-09 6:57 
QuestionMySQL Query from 1000 clients to one MySQL Server at the same time Pin
nxexo0077-Nov-09 2:35
nxexo0077-Nov-09 2:35 
AnswerRe: MySQL Query from 1000 clients to one MySQL Server at the same time Pin
Not Active7-Nov-09 2:45
mentorNot Active7-Nov-09 2:45 
GeneralRe: MySQL Query from 1000 clients to one MySQL Server at the same time Pin
nxexo0077-Nov-09 6:44
nxexo0077-Nov-09 6:44 
GeneralRe: MySQL Query from 1000 clients to one MySQL Server at the same time Pin
Not Active7-Nov-09 6:52
mentorNot Active7-Nov-09 6:52 
AnswerRe: MySQL Query from 1000 clients to one MySQL Server at the same time Pin
nxexo0077-Nov-09 6:55
nxexo0077-Nov-09 6:55 
GeneralRe: MySQL Query from 1000 clients to one MySQL Server at the same time Pin
Not Active7-Nov-09 7:01
mentorNot Active7-Nov-09 7:01 
GeneralRe: MySQL Query from 1000 clients to one MySQL Server at the same time Pin
nxexo0077-Nov-09 7:29
nxexo0077-Nov-09 7:29 
AnswerRe: MySQL Query from 1000 clients to one MySQL Server at the same time Pin
Shameel8-Nov-09 23:33
professionalShameel8-Nov-09 23:33 
QuestionInterop Library Available? Pin
#realJSOP7-Nov-09 1:49
professional#realJSOP7-Nov-09 1:49 
AnswerRe: Interop Library Available? Pin
Not Active7-Nov-09 2:42
mentorNot Active7-Nov-09 2:42 
AnswerRe: Interop Library Available? Pin
Luc Pattyn7-Nov-09 3:21
sitebuilderLuc Pattyn7-Nov-09 3:21 
AnswerRe: Interop Library Available? Pin
Dave Kreskowiak7-Nov-09 11:46
mveDave Kreskowiak7-Nov-09 11:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.