|
-
Apr 15th, 2016, 11:38 PM
#1
Thread Starter
New Member
Morse Code Translator - Play Audio & Image Sequentially Issue
The Morse Code Translator is for a school project. I'm fairly inexperienced with coding. I'll try to explain the program the best I can.
There are 2 Textboxes and 1 Button. Input a character, word or sentence into TextBox1, Click the Translate Button, and then TextBox2 will show those characters in Morse Code.
The button also plays Audio from my resources. (If I type A and click the button, a 'dit + dah' (.-) will play)
The button also flashes a picturebox with an image of a light that corresponds to the dits and dahs.
The Problem
When there are 2 or more characters entered, only the audio for the last letter plays. (Type CAT, only audio for T plays)
I countered this by using WaitToComplete instead of Background
My.Computer.Audio.Play(My.Resources.MorseA, _
AudioPlayMode.WaitToComplete)
And it worked, it played the audio for C, A then T. BUT WaitToComplete stops executing code, and now my pictureboxes won't flash. I've tried using timers and progressbars, but I'm really struggling to get it right.
Is there a way to play the audio files sequentially, without stopping the code from executing, allowing the pictureboxes to flash with the audio?
This is probably not a great explanation, but please do ask questions if you don't understand something. And thanks in advance for the help!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|