Thread - Waiting Screen - Button In Application That Starts A Function To Play Sounds

Mar 20, 2009

I have a button in my application that starts a function to play sounds. But when the function starts a have a problem that my application stops working until all the sounds are played. Then a want to display a waiting screen to show the status of the current application. To this i thought to create a new thread to open the waiting window and then show the messages. But i have a problem that when my thread finishes, it closes the waiting screen. I tryied to put a loop inside my thread, but this crashes my aplication until the loop condition is satisfied.

View 2 Replies


ADVERTISEMENT

Button In Application That Starts A Function To Play Sounds?

Mar 18, 2009

i have a button in my application that starts a function to play sounds.But when the function starts a have a problem that my application stops working until all the sounds are played. Then a want to display a waiting screen to show the status of the current application. To this i thought to create a new thread to open the waiting window and then show the messages.

But i have a problem that when my thread finishes, it closes the waiting screen. I tryied to put a loop inside my thread, but this crashes my aplication until the loop condition is satisfied.

View 1 Replies

Waiting For Threads - Thread.join Suspend Execution Of Code On Calling Thread Until Spawned Thread Finishes Or Is Aborted

Sep 2, 2010

My understanding is that thread.join will suspend the execution of code on the calling thread until the spawned thread finishes or is aborted...

With that in mind, I tried this:

For i = 1 to 50
threads = New Thread(AddressOf test)
threads.IsBackground = True
threads.SetApartmentState(ApartmentState.STA)

[CODE]...

However, the rest of the code runs when the loop finishes, not waiting for all the spawned threads to finish. Since the rest of the code needs the threads to finish (otherwise the rest will error).

View 4 Replies

Multi-threading - Thread Starts When A Button Is Clicked But Can't See The Result?

Sep 13, 2008

I am using a background thread in my application. The problem is: this thread starts when a button is clicked and it works well. After finishing it's work i can see the result. But when i try to start again, it gives me an error. How to restart a thread?

[code]...

When i press ToolStripButton1 for the first time it works really well. But when i press it second time it shows me error that, the thread has already been started.How to resolve it? I think how to restart thread is my question.

View 2 Replies

Programmatically Set Either A Splash Screen OR The MainForm When The Application Starts Up?

Jan 27, 2011

I know one can select Spash Screen as the application startup as per this illustration. I can't do that however because the application is called by another program which passes in parameters via Process.Start(). Depending on the passed in arguments, I need to either

Go Directly to the MainForm or Go First to a Splash Screen which will then to the the Mainform after 5 seconds.

I definitely need Step 2 above because of the slow startup time of creating an SocketConnection and the population of some Custom Controls only after the Socket connection has been established.

Would I use a startup class or module and then use that as the application startup 'form' which could be establishing the SocketConnection while also launching a Splash Screen?

View 7 Replies

How To Play Sounds In Vb 9

Nov 25, 2009

well i wanted to make a piano with visual basic 2008 and i searched around the internet to see how to play a sound but my search returned results relating only to visual basic 2005 & 6 so i am again forced to waste your time

View 3 Replies

Play Wav And Mp3 Sounds Using .net?

Apr 23, 2010

i need a way to play wav and mp3 sounds using vb net. its has to be able to play more than one sound at same time and also to play the same sound again even if it has not finished playing

i tried this

Code:
Dim ch As String
ch = Chr(34) & TextBox1.Text & Chr(34)
mciSendString("open " & ch & " alias s1", Nothing, 0, 0)
mciSendString("play s1", Nothing, 0, 0)

it plays the sound once then will not play any other sound at all.

View 1 Replies

Play 2 Or More Sounds At The Same Time

May 4, 2011

What is the simplest way to play two or more sounds at the same time? It should be a light software.

View 3 Replies

Possible To Play Two Or More Sounds At Same Time?

Feb 2, 2009

Is it possible to play two or more sounds at the same time (i.e., one plays in the background and one plays a sound effect) and if so, how can I do this? I am having problems because it is cancelling one of the sounds out when the other starts.

View 7 Replies

Resolved How To Play Sounds In Vb 9

Oct 29, 2009

i wanted to make a piano with visual basic 2008 and i searched around the internet to see how to play a sound but my search returned results relating only to visual basic 2005 & 6 so i am again forced to waste your time (sorry about that) oh and i also have the wav soundfiles i only want vb to read them in the final exe

View 3 Replies

Sounds - Play Two .WAV Files At Once

Dec 7, 2009

I am making a program that plays a sound whenever you hit a button, and was wondering if there was a way to play two .WAV files at once. Here is what the code looks like:

[Code]...

View 8 Replies

VS 2008 Play 2 Sounds At Once?

Dec 11, 2009

How do i play 2 sounds at once? i have a sound effect on a button, and when i press it, it does the sound effect of the button and stops the music sound

View 3 Replies

How To Play Non Default System Sounds In .NET

May 12, 2011

I want to play system sounds with .NET code in my app - no problem if I want to use Beep, Asterisk etc as I can just use: My.Computer.Audio.Play SystemSound(Media.SystemSounds.Asterisk)But what if I want to play something like 'Menu Pop-up'? This sound is off by default in the Windows Default Sound Scheme, but if the user has set this sound up to do something then I want to play it.The user could have assigned any wav file to this action so I want to find which (if any) sound they have assigned and play it. Compatibility with Windows versions back to XP is also essential.

View 1 Replies

Play Sounds On Receiving Message In Asp.net?

Feb 20, 2012

I am developing a chat application in asp.net using vb.net. In this, if a user receives a new message from other users then I want to play a sound to let him know that he received a message. I wanted to play some .wav files.

View 2 Replies

Play Sounds When Certain Events Occur?

Oct 22, 2009

me and a partner need to play sounds when certain events occur, however, every method we try..

My.Computer.Audo.Play("file.wav")
or?
Sound.PlayWaveFile("file.wav") from this class: http:[url]....etc they all don't work

They do NOT throw any exceptions, they just dont play the music, the test demo of the Sound Class works like a charm, its just not working in our project..same with My.Computer. Audio. Play.what could we have done to make it so that we can't play sounds from our application?

PS: this problem occurs on all of the computers we test it on, yet the normal sound-playing methods seem to work on all of those computers when they are implemented in other projects.. its just not working in these instances

View 5 Replies

Forms :: How To Access And Play System Sounds

Oct 5, 2009

I know how to access and play the system sounds using vb.net, and I also know that using the registry to save users' settings isn't ideal, however, The details of my project are rather long and drawn out, so I'll skip most of them Basically my program is loaded onto several computers on our network. The entire purpose of this program is to sound various alarms on different dates and times. Apparently I am to set up the program so that the different alarm sounds can be configured through Windows' control panel.

I can add the program into the appropriate part of the Registry in order to make that happen. The problem is reading the the information back. Under the name of the app, I have four different subkeys, each with the name of one of the alarms. Under those keys are two other subkeys, .default and .current. How do I get the sound from .current to play? For some weird reason I get null returned any time I try to read the key that I created.

View 5 Replies

Play Default Windows Sounds (not Beeps)?

Dec 7, 2011

What is the easiest way to play a sound from windows sounds? Does .NET built-in library for that?

View 1 Replies

Play Multiple Sounds Simultaneously From Resources?

Dec 13, 2010

I want to play multiple sounds simultaneously from My.Resources in Visual Basic 2010. I have tried:My.Computer.Audio.Play(My.Resources.SoundName, AudioPlayMode.Background)

I have also tried using multiple Windows Media Player controls, but that also didn't work.The first sound is cut off when the next sound plays.When searching around the internet I found people suggesting using 'DirectSound', but there are only tutorials for DirectSound in VB 6.0.

View 1 Replies

Play The Usual MIDI Sounds In A VB Program?

Jan 14, 2010

I am looking for a way to play the usual MIDI sounds in a VB program. Similar to the beep program (ie console.beep, leading to timer1.start etc.)but instead of an annoying bleep, have a MIDI sound (like a flute, violin, clarinet, etc.). Is this possible in VB 2008?

View 10 Replies

VS 2008 - Using Media.SoundPlayer() To Play 2 Sounds

Jan 6, 2010

I am using the following code to play sounds in my VB.NET application: [Code] now this works fine for any sound file. However there is a second sound file (sound2.wav) which I want to play sometimes too. I want sound2 to have priority over sound1, however if I play sound2 using this method and then sound1 also plays a second later, sound2 will be canceled for sound1 to play.

So I'd like to know if there's a way to either play both sounds at once, or to check if sound2 is playing before I play sound1, and then only play sound1 if sound2 is not currently playing.

View 1 Replies

Play Sounds From User Specified Buttons + Save Settings?

Nov 20, 2008

For an application I am building, I need to have the user specify button labels and be able to click on them to play a sound they specify. I would like them to be able to specify the number of buttons, the label for the buttons, and the sound file to be played. I would then like the user to be able to save those settings. How do I go about doing this? Also, how do I get the file they've opened's name to show up in the title bar of the app?

View 2 Replies

VS 2010 Put Music/sounds Inside Program And Play Them?

Sep 20, 2010

I am wanting to simply insert a sound/music file into my program, and perhaps make a button function to make it play?

View 5 Replies

How To Play MP3 Music When The Program Starts

Jun 22, 2010

I'm working at a project and I want to add a MP3 song an play it when the program that i made will be started.

View 4 Replies

Waiting For A Thread To Finish?

Mar 11, 2009

I am trying to make a marquee progress bar run while my long function is running. When the function is done running, I want the progress bar to disappear.

[code]...

If I don't do t.Join(), the progress bar disappears right away and then the thread runs. If I do Join(), the progress bar doesn't appear until the message box pops up after the thread is done!How would I get the effect of the progress bar running while the thread is running and then stopping when it's done?

View 15 Replies

Suspend A Thread While Waiting For Event?

Jul 1, 2011

I am trying to use a separate thread to handle specific events in VB.Net. The idea being that I do not want the main application to be held up if a particular event handler takes awhile to finish. How do I get my main thread loop to suspend the thread while allowing it to handle events when they occur?When I create a Windows Forms application, there is a UI thread that handles the UI events. I do not imagine that this thread is continuously polling some variable to see if someone has pressed a button. I imagine the thread is suspended until the OS tells it there is something to do. I was trying to figure out how to ensure that my event handlers were not being executed by the UI thread. From what I have read, I can do this by raising the events from a different thread. But what does that thread do while it is waiting for other events, just exit?

I wanted to know how to create a thread that works like the UI thread, only it processes the events I want it to process. I am not sure how events work in .Net. I understand that event handlers are run on the thread that raises the event. I believe that .Net allocates threads from some thread pool to process events such as timer events. I am not clear on how it works, though, and what those threads are doing when they are not handling events.

View 2 Replies

VS 2008 : Blocking In DoWork() While Waiting For Another Thread To Finish?

May 6, 2009

In my DoWork() function I register with our sip server. Then I have to wait for a response back. However, the response I get is received in another event. However, before I am able to check the flag in the DoWork() the DoWork() has all ready finished and the response comes after.

I am trying to find a way to wait in the DoWork() until I get a response in the Diagnotic event. I have a global flag that is set in that event that I have to check in the DoWork().I was thinking of maybe blocking in the DoWork() until the other event is finished. Maybe using a join.

' Do work in background worker
'Will return less than 8 if there are no error message from the library
If (Not Me.bgwProcessLogin.CancellationPending) Then
' Register and wait for response

[code]....

View 3 Replies

VS 2010 Waiting For A Screen Re-draw To Finish Before Continuing?

Oct 16, 2011

I'm writing a simple program that takes a screenshot of tab1 of the GUI, then takes a screenshot of tab2, then tab3, etc. I've got the screenshot code down pat, but the problem with my current code is that it's taking the screenshot of each tab before the screen has a chance to fully redraw, so the resulting images are screwed up.Is there a way to get the program to wait for each tab (and all the controls in it) to be fully visible before each screenshot is taken?I'd like to avoid using a timer for this, as the screen redraw speed will vary depending on the user's computer, and the contents of each tab, etc.[code]

View 2 Replies

MultiThreading-Insuring A Thread Starts On Each Processor?

Apr 20, 2011

How do I ensure that a process has a thread on each processor?

What I am asking is how do I address processors to ensure a thread is running on it?

View 8 Replies

Module With Functions (thread 1) That Starts A BeginRead For A TCPClient?

Jul 2, 2010

Even though there are many examples of Invoke operations, I can't find something that works for me. (I'm using VS 2008, and working in VB)Here is what i have:

A main module with functions (thread 1) that starts a BeginRead for a TCPClient. When the callback function executes (on thread 3), I want to call a function from the main module, in the main thread. All I get even with Invokes is calling functions that always run in thread 3, not the parent thread.

I call:MsgBox("Function name: " & Thread.CurrentThread.ManagedThreadId)

in each of my functions do determine on what thread it is executed. At some point, from the infinite read callback function I will have to get a function to show a form, but that function gets caught in the callback thread and freezes, instead of running in the main thread.PS: the callback that I pass to the BeginRead of the TCPClient is a function, not a class, so I can't use raise events.All I need is to call a function to run in the main thread (main module) from another thread.

View 14 Replies

Make A Play Button Play/stop Toggle?

Feb 9, 2010

How can you make a play button play/stop toggle? Currently my button plays a file in WMP but when I click it again, it just restarts the file. I would like it to toggle on and off, play and stop, not play and pause.

View 8 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved