• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Small sound problem with applet

 
colin shuker
Ranch Hand
Posts: 750
  • Mark post as helpful
  • send pies
  • 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 ]
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic