United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6251460 REGRESSION: BUG:5070730 is NOT fixed - short sounds do not play.
JDK-6251460 : REGRESSION: BUG:5070730 is NOT fixed - short sounds do not play.

Details
Type:
Bug
Submit Date:
2005-04-06
Status:
Resolved
Updated Date:
2011-01-19
Project Name:
JDK
Resolved Date:
2005-08-17
Component:
client-libs
OS:
windows_98,windows_xp,windows_2000
Sub-Component:
javax.sound
CPU:
x86
Priority:
P1
Resolution:
Fixed
Affected Versions:
1.4.2,5.0,5.0u5,6
Fixed Versions:

Related Reports
Backport:
Duplicate:
Duplicate:
Duplicate:
Duplicate:
Duplicate:
Relates:
Relates:

Sub Tasks

Description
FULL PRODUCT VERSION :
java version "1.5.0_02"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_02-b09)
Java HotSpot(TM) Client VM (build 1.5.0_02-b09, mixed mode, sharing)

ADDITIONAL OS VERSION INFORMATION :
Windows XP, 2000 professional - that I have tested on.

A DESCRIPTION OF THE PROBLEM :
I would like to re-open the bug 5070730. Its not fixed for short AU clips. I have a game website that depends on the using the asynchronous use of the Applet getAudioClip and AudioClip.play. This has worked fine for JVM 1.1 , 1.3 etc. But I have realised that in 1.5.0_02 (and 1.5.0, 1.4.x) it does not work correctly.
This is a regression.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :


Use the applet as described in this case

Please retrieve the nock.au file from:
http://www.play3dpool.com/pool/nock.au


EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
when you run the above applet (either in a browser or appletviewer) using say JDK 1.3 or early you will hear a many small "click" sounds very close together.
However if you use JDK1.5 to run the same applet you will hear only 1 click, or nothing, or sometimes a couple.


REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------

import java.applet.*;
import java.net.*;
/**
 *
 *
 */
public class SoundApplet extends java.applet.Applet {

	public void start() {

		try {

      URL url = SoundApplet.class.getResource("/nock.au");
      System.out.println("URL:"+url.toString());
			AudioClip ac = getAudioClip(url);
			for (int i = 1; i < 60; i++) {
				try {
					Thread.sleep(10);
				} catch (InterruptedException e1) {
					e1.printStackTrace();
				}
				ac.play();
			}

			Thread.sleep(1000);
		} catch (Exception e) {
			e.printStackTrace();
		}

	}

}

---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
I have no workaround.

Release Regression From : 1.3.1
The above release value was the last known release where this 
bug was known to work. Since then there has been a regression.
###@###.### 2005-04-06 17:49:13 GMT

                                    

Comments
EVALUATION

The problem is that now JavaSoundAudioClip.lastPlayCall keeps time of
last startImpl(...) method call (but not real sound playing start).
lastPlayCall should keep time of last sound playing  start.

###@###.### 2005-05-27 14:30:40 GMT
                                     
2005-05-27
EVALUATION

Another issue found (related with short sounds) in DirectSound drain() implementation (native code)
                                     
2005-08-09



Hardware and Software, Engineered to Work Together