Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 4948663
Votes 0
Synopsis JavaSoundDemo cannot playback loaded wav files
Category java:classes_sound
Reported Against 1.4.2
Release Fixed 1.5(tiger-b30)
State 10-Fix Delivered, bug
Priority: 3-Medium
Related Bugs 5011285
Submit Date 04-NOV-2003
Description


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

FULL OS VERSION :
 customer  Windows 2000 [Version 5.00.2195

A DESCRIPTION OF THE PROBLEM :
JavaSoundDemo cannot playback sample wav file or any recorded and then saved wav file.



STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Open JavaSounddemo. Go to capture/playback tab.
Load file "1-Welcome.wav" from the samples.
It is displayed properly.
But clicking on Play causes the following console output:
  Unable to reset the stream
  java.io.IOException: mark/reset not supported

Tested on three machines, two with JDK 1.4.2, one with JRE 1.4.2: Failed on all.
Tested with JRE 1.4.1 and JDK 1.4.1: works.

I have an app which uses code similar to the SoundDemo, and so this app is broken, too. That's why I consider the problem critical.


REPRODUCIBILITY :
This bug can be reproduced always.

CUSTOMER SUBMITTED WORKAROUND :
Using 1.4.1 instead.
(Incident Review ID: 223124) 
======================================================================
Work Around
N/A
Evaluation
This bug is caused primarily by a recent change in PushBackInputStream: AudioInputStream used PushBackInputStream internally in order to cope with irregular frame size reads of the underlying input stream. 
The fix removes usage of PushBackInputStream. This has the added benefit of one less layer when reading from the stream, and therefore better performance. 
Fix is very low risk, since only AudioInputStream is affected, easy to test correct behavior with the existing unit tests and TCK tests.
  xxxxx@xxxxx   2003-11-13

Note that the Java Sound Demo uses an undocumented feature of AudioInputStream: calling reset() will rewind it to the start position of audio data. This is NOT a recommended way of rewinding. If your program uses that code, reconsider using something portable. The Java Sound Examples (http://www.jsresources.org/examples/) show how to correctly do such tasks.
  xxxxx@xxxxx   2003-11-17
Comments
  
  Include a link with my name & email   

Submitted On 24-DEC-2003
wknauf@hg-online.de
This fix is not included in build 1.4.2_03-b02, is it ?
Just tested it and the problem still hapens.

Please tell me when this will happen. Currently I don't 
see how to do the workaround described in your 
comment. Do I have to create a byte array and recreate 
the AudioInputStream each time I reset the stream ?



PLEASE NOTE: JDK6 is formerly known as Project Mustang