• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Small sound problem with applet

 
Ranch Hand
Posts: 750
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello there,

I have a JApplet that plays chess, and has a PGN player
(plays chess games(.pgn files)).
On the server, I have a collection of about 26 small .wav files.
This allows the chess moves to be spoken..
eg The move Qxa7#, would use the sound files...
"Queen","takes","a","7","Checkmate".

In the init method of applet, I load in all the sounds...


So, for playing the move above, I would use the code below...
This doesn't run in any separate thread, but just belongs in a method,
and is called by EDT (I think).

So putting in the sleep allows time for the currently playing sound to
complete before playing the next sound.

So my problem...
The sounds play perfectly fine, but every now and then the sound for
the move is not played, or only the beginning or the end of the sound
for the move is played.

Please feel free to try the applet(Java 1.5 needed)...
JChess2

To demonstrate this problem best..
Click File->Analysis.. then LOAD PGN FILE... then load in one of the pgn files, and press the play button in the lower right corner.

Thanks any input, perhaps I should try running playing the sequence of sounds for a move inside a new Thread, I',m not sure.
[ September 09, 2007: Message edited by: colin shuker ]
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not experiencing the problem on OS X. All sounds play in full.
 
colin shuker
Ranch Hand
Posts: 750
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I installed Firefox on my pc(Win XP), and I didn't notice a single broken sound.
It was just on IE7, where I had the problem, so perhaps its not the codes fault, and its the browser.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic