Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problem with countdown 2

Status
Not open for further replies.

Greenleaf

Programmer
Feb 14, 2002
93
IT
Hello, I wrote some code for a countdown and I use an object timer that changes my text every second. When there are 5 minutes left I'd like to play a sound; now I'm using a wav sound and the problem is that the sound makes the countdown freeze; i.e. as long as the sound is playing the countdown doesn't go on. How can I solve this problem?
 
If the object you're using to play the .WAV is single-threaded (sounds like it is), then one way is to declare a new thread and play the .WAV within it.

The Delphi help file has some good stuff to get you started on writing a thread, but post back here if you need more help.
 
Griffyn, That was my thought yesterday when I read the OP, but I've never done any work with threads and wasn't positive that was the solution. Thanks for confirmation, makes me feel like, maybe I've learned more than I think sometimes!

Leslie
 
Great! Thank you so much! It works, this is the first time I use more than one thread. Thank you, again!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top