JDK-6233477 : Regression: java.applet.Applet.play() method is not working on Tiger U2 B07. Sound will be crumpled.
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.sound
  • Affected Version: 5.0u2
  • Priority: P2
  • Status: Closed
  • Resolution: Not an Issue
  • OS: windows_2000
  • CPU: generic
  • Submitted: 2005-02-26
  • Updated: 2010-08-17
  • Resolved: 2005-05-13
Related Reports
Relates :  
Relates :  
Description
System: all windows platforms
build: Tiger U2 B07
//The ac.play() and ac.loop() methods in below will play the audio clip but the sound will be crumpled

AudioClip ac = Applet.newAudioClip(Bug.class.getRosource("0.au");
ac.play();
ac.loop();


###@###.### 2005-2-26 01:21:12 GMT

Comments
EVALUATION Both AudioClip.play() and AudioClip.loop() are defined as asynchronous; each starts playing the clip from the beginning then returns to the calling thread. The code segment shown in the description is: AudioClip ac = Applet.newAudioClip(Bug.class.getRosource("0.au"); ac.play(); ac.loop(); The ac.play() call will begin the audio clip. The ac.loop() call will interrupt it and start it from the beginning. ###@###.### 2005-3-01 01:59:02 GMT The ac.play() will need to put the VM to sleep, Thread.sleep(delay) in order to play the clip completely. And users will run into the problem of having no way to query the audio clip at runtime. ###@###.### 2005-03-01 18:49:48 GMT The API for AudioClip.play() says it STARTS the clip. It does NOT say it plays the clip to completion. AudioClip is not intended for the type of program that wants the sound to play before control returns. If it is absolutely necessary to wait for a clip to complete, the addLineListener function can be used to associate an event listener that can be executed when the clip completes playing. The program can also use the getFramePosition(), getLongFramePosition() or getMicrosecondPosition() to determine how much of a clip has been played. ###@###.### 2005-03-01 19:27:34 GMT As stated above, the behavior the test program exhibits is correct according to the API specification. This is not a bug. Closing this problem. ###@###.### 2005-05-13 22:17:51 GMT
01-03-2005