By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,107 Members | 1,607 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,107 IT Pros & Developers. It's quick & easy.

Audio responses to text found in textbox: VB 6.0

Dököll
Expert 100+
P: 2,364
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...

Expand|Select|Wrap|Line Numbers
  1.  
  2. Private Sub GtWords_Click()
  3.  
  4. If Text6.Text = "" Then
  5. MsgBox ("Sorry, you forgot to add text please add text to continue!")
  6. Text6.SetFocus
  7. ElseIf Text6.Text <> "" Then      
  8.  
  9. Open App.Path + "\usermate.txt" For Output As #1 'file is opened as inWrite because it is Writing back into the program
  10.                 Write #1, , Text6.Text
  11.  
  12.                 Close #1
  13.  
  14. Dim GoSplit As Variant
  15. Dim strGetWords As String
  16.  
  17. FileName = "\usermate.txt"
  18. f = FreeFile
  19. Open App.Path + FileName For Input As #1
  20. Do While Not EOF(f)
  21. Line Input #1, strGetWords
  22. GoSplit = Split(strGetWords, " ")
  23.  
  24. If InStrB(strGetWords, "cicle") <> 0 Then
  25. this and than here...
  26.  
  27. End If
  28.  
  29.  


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:

Expand|Select|Wrap|Line Numbers
  1.  
  2. Private Sub GtWords_Click()
  3.  
  4. If Text6.Text = "" Then
  5. MsgBox ("Sorry, you forgot to add text please add text to continue!")
  6. Text6.SetFocus
  7. ElseIf Text6.Text <> "" Then      
  8.  
  9. Open App.Path + "\usermate.txt" For Output As #1 'file is opened as inWrite because it is Writing back into the program
  10.                 Write #1, , Text6.Text
  11.  
  12.                 Close #1
  13.  
  14. Dim GoSplit As Variant
  15. Dim strGetWords As String
  16.  
  17. FileName = "\usermate.txt"
  18. f = FreeFile
  19. Open App.Path + FileName For Input As #1
  20. Do While Not EOF(f)
  21. Line Input #1, strGetWords
  22. GoSplit = Split(strGetWords, " ")
  23.  
  24. If InStrB(strGetWords, "cicle") <> 0 Then
  25. this and than here...
  26. Then start an inner loop in here to go grab audio files or grab colours in storage and match them up
  27.  
  28. End If
  29.  
  30.  
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
Mar 30 '08 #1
Share this Question
Share on Google+
1 Reply


Dököll
Expert 100+
P: 2,364
Please disregard, this can be achieved using wonderful powerpoint presentations:-)

Closing thread...
Apr 1 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.