dcsimg
how to use one thread to handle sound playing and drawing the slider on drawn waveform
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Piyush_Srivastava
Posted On:   Monday, June 16, 2003 02:03 AM

Hi All
I am working on a swing application in which i have to load
a sound and play it and a slider should run along
with the the playing sound in doing this i am using
two separate threads to handle sound playing and
vertical bar (slider),but this thread lacks behind and the
sound runs faster than slider and sometimes tha slider
leaves some space and then gets drawn,so i am
now thinking to put the two run () into one will it
work?,and if any one has the code for this or separate
thraed than please mail me at
whizkid_piyush@rediffmail.com.

thanks

Re: how to use one thread to handle sound playing and drawing the slider on drawn waveform

Posted By:   C_Murphy  
Posted On:   Monday, June 16, 2003 04:39 AM

Separate threads is correct. What you need to do is synchronize the screen slider to the cuorrent state of the sound thread. A mailbox allowing loose coupling between threads would allow you to do this.


See the following link for an article and download on this topic -


http://liemur.co.uk/Articles/ThreadCommunication.html

About | Sitemap | Contact