Audio responses to text found in textbox: VB 6.0

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Dököll
    Recognized Expert Top Contributor
    • Nov 2006
    • 2379

    Audio responses to text found in textbox: VB 6.0

    Greetings, Good buddies!

    I am for the first time, since I started learning VB, going to build an application I wanted to build for my first son, a language and activities program that will allow at one push of a button for colours to be added in squares, circles, and for audio responses to these to sound when for example, red circles, blue squares, or foods, etc are found in text added to multiline textbox.

    My second son can benefit from it now:-)

    Good thing some of the work is already done. Previous help through this forum have compelled me to think harder to complete a project, thought this code I am about to post did not work for the project it was written for, through perseverance and support from you, I found a solution. However, I did think someday I would have an opportunity to use this code, which will be very familiar:-) as to satisfy this big idea I have had, and could not do in the past...

    [CODE=VB]

    Private Sub GtWords_Click()

    If Text6.Text = "" Then
    MsgBox ("Sorry, you forgot to add text please add text to continue!")
    Text6.SetFocus
    ElseIf Text6.Text <> "" Then

    Open App.Path + "\usermate. txt" For Output As #1 'file is opened as inWrite because it is Writing back into the program
    Write #1, , Text6.Text

    Close #1

    Dim GoSplit As Variant
    Dim strGetWords As String

    FileName = "\usermate. txt"
    f = FreeFile
    Open App.Path + FileName For Input As #1
    Do While Not EOF(f)
    Line Input #1, strGetWords
    GoSplit = Split(strGetWor ds, " ")

    If InStrB(strGetWo rds, "cicle") <> 0 Then
    this and than here...

    End If

    [/CODE]



    But when this happen, circle is found to give it an available colour the fire an audio response, which I can save as mp3 files, loaded in an array or something like that.

    The problem I know I will encounter is making sure all keys on the keyboard being used to go through this information are up for grabs, which means that, a three year old can simply slap the keyboard and program would move to next word/item found.

    I will be honest, in 2002 it was wishful thinking when I thought of doing this, today still is. I just will need your help, I am sure, getting the right idea into the program; which could become helpful in the future for other projects I have for my homeland, perhaps teach locals English that way:-)

    Does this all makes sense?

    If I save audio files I should be able to reference the right ones when a circle is found in text.

    I would like to start by by learning how to write a loop that would go in a tex file, or textboxes with words in them then to say one by one:

    (1) cicle was found
    (2) that circle is blue


    The it would jump to the next item or word at a slap of the keyboard

    If the were note an audio sample would alert end of file or no more words...

    How can one go about such loop, or can I use the existing information:

    [CODE=VB]

    Private Sub GtWords_Click()

    If Text6.Text = "" Then
    MsgBox ("Sorry, you forgot to add text please add text to continue!")
    Text6.SetFocus
    ElseIf Text6.Text <> "" Then

    Open App.Path + "\usermate. txt" For Output As #1 'file is opened as inWrite because it is Writing back into the program
    Write #1, , Text6.Text

    Close #1

    Dim GoSplit As Variant
    Dim strGetWords As String

    FileName = "\usermate. txt"
    f = FreeFile
    Open App.Path + FileName For Input As #1
    Do While Not EOF(f)
    Line Input #1, strGetWords
    GoSplit = Split(strGetWor ds, " ")

    If InStrB(strGetWo rds, "cicle") <> 0 Then
    this and than here...
    Then start an inner loop in here to go grab audio files or grab colours in storage and match them up

    End If

    [/CODE]

    Audio files would be in this fashion

    (a) Blue
    (b) Red
    (3) Green

    and so on

    then there'd be:

    (1) Cicle
    (2) Square
    (3) Diamond


    and the program would go fetch a colour that was not previousy stated with a particular item and pin it to the item shown, which would also have to be an image:

    - If a cirlce is found the loop would also need to add the appropriate image or shape, I almost forgot to mention that.

    - The loop would need to grab the cicle text found, pin a colour to it and add the appropriate image or shape

    How could I go about this or do you have a simple option?

    Sorry for the length of this post;-)

    In a bit!

    Dököll
    Last edited by Dököll; Mar 30 '08, 03:39 PM. Reason: text...
  • Dököll
    Recognized Expert Top Contributor
    • Nov 2006
    • 2379

    #2
    Please disregard, this can be achieved using wonderful powerpoint presentations:-)

    Closing thread...

    Comment

    Working...