-
Bug
-
Resolution: Not an Issue
-
P3
-
None
-
1.3.0
-
x86
-
windows_nt
Name: krT82822 Date: 01/25/2000
(see also 4257986)
java version "1.3beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3beta-O)
Java(TM) HotSpot Client VM (build 1.3beta-O, mixed mode)
I am trying to play a wav file. My code worked under java 1.2.2 and jmf 2.0.
Now under java 1.3 and jmf 2.0, nothing plays and I get the following error
messages -
===========================================================
Open log file: E:\prototype\projects\jmf.log
java.lang.NoClassDefFoundError: javax/sound/sampled/DataLine
at com.sun.media.renderer.audio.JavaSoundRenderer.createDevice
(JavaSoundRenderer.java:108)
at com.sun.media.renderer.audio.AudioRenderer.initDevice
(AudioRenderer.java:276)
at com.sun.media.renderer.audio.JavaSoundRenderer.initDevice
(JavaSoundRenderer.java:104)
at com.sun.media.renderer.audio.JavaSoundRenderer.open
(JavaSoundRenderer.java:75)
at com.sun.media.BasicRendererModule.doPrefetch
(BasicRendererModule.java:153)
at com.sun.media.MediaEngine$TControl.prefetchTrack
(MediaEngine.java:2596)
at com.sun.media.MediaEngine.doPrefetch(MediaEngine.java:687)
at com.sun.media.PrefetchWorkThread.process(BasicController.java:1398)
at com.sun.media.StateTransitionWorkThread.run
(BasicController.java:1307)
===========================================================
The jmf.log file has -
===========================================================
#
# JMF Version 2.0
#
## Platform: Windows NT, x86, 4.0
## Java VM: Sun Microsystems Inc., 1.3beta
$$ Profile: instantiation: 31 ms
## Player created: com.sun.media.content.unknown.Handler@c8aea
## using DataSource: com.sun.media.protocol.file.DataSource@28402c
$$ Profile: parsing: 47 ms
## Building flow graph for: file:audio/brilliant.wav
## Building Track: 0
## Input: LINEAR, 22050.0 Hz, 16-bit, Mono, LittleEndian, Signed, FrameSize=16
bits
## Here's the completed flow graph:
com.sun.media.parser.audio.WavParser@559d3c
connects to: com.sun.media.renderer.audio.JavaSoundRenderer@3bc1a1
format: LINEAR, 22050.0 Hz, 16-bit, Mono, LittleEndian, Signed,
FrameSize=16 bits
protocol: 3
$$ Profile: graph building: 188 ms
$$ Profile: realize, post graph building: 16 ms
==============================================================
The routine used to play the wav file is below.
==============================================================
import java.net.URL;
import javax.media.ControllerEvent;
import javax.media.ControllerListener;
import javax.media.EndOfMediaEvent;
import javax.media.Manager;
import javax.media.Player;
...
private Player _player;
private boolean _audioPlaying = false;
...
/**
* Play an audio clip, and wait for it to finish.
*/
private boolean play(URL clip)
{
if(clip == null)
return false;
// Play the clip, and wait for it to finish.
synchronized(this) {
// wait until previous audio is done
try {
while(_audioPlaying) {
wait();
}
} catch (InterruptedException ex) { }
try {
_player = Manager.createRealizedPlayer(clip);
_player.addControllerListener(this);
} catch (Exception ex) {
return false;
}
// Play the clip
_audioPlaying = true;
_player.start();
// wait until audio is done
try {
while(_audioPlaying) {
wait();
}
} catch (InterruptedException ex) { }
// Get rid of the player; we're done with it.
_player.stop(); // just in case; ignored if already stopped.
_player.deallocate();
_player.close();
_player = null;
}
return true;
}
===========================================================
The java 1.3 man pages say that DataLine is in javax.media.sound.sampled.
But the error message reproduced below suggests that it's looking in
javax.sound.sampled. Is this discrepancy the reason for the error?
"java.lang.NoClassDefFoundError: javax/sound/sampled/DataLine"
------------------
1/5/2000 email back from user, in response to our request for a couple of sample .WAV files:
It works for every wav file I've tried. I've attached
2 below. I'm not sure how they were recorded. We had
them professionally done; so probably not with the
Sound Recorder.
NOTE - Since I posted the bug report this morning, I
realised I omitted an important fact. I had first
installed jmf 2.0, and then java 1.3 beta.
I just reinstalled jmf 2.0, AFTER java 1.3 beta.
Now running and trying to play wav is worse?!
My program doesn't give out the diagnostics that it
did earlier about
java.lang.NoClassDefFoundError:
javax/sound/sampled/DataLine
at
com.sun.media.renderer.audio.JavaSoundRenderer.createDevice(JavaSoundRenderer.java:108)
at
com.sun.media.renderer.audio.AudioRenderer.initDevice(AudioRenderer.java:276)
Now it hangs, and just prints out -
DataLine not supported: LINEAR, 22050.0 Hz, 16-bit,
Mono, LittleEndian, Signed
---------------------------
1/5/2000 in reply to our request for a sample .WAV file demosntrating the problem, we got two by mail, with the comment that none apparently work:
It works [doesn't, that is] for every wav file I've tried. I've attached
2 below. I'm not sure how they were recorded. We had
them professionally done; so probably not with the
Sound Recorder.
NOTE - Since I posted the bug report this morning, I
realised I omitted an important fact. I had first
installed jmf 2.0, and then java 1.3 beta.
I just reinstalled jmf 2.0, AFTER java 1.3 beta.
Now running and trying to play wav is worse?!
My program doesn't give out the diagnostics that it
did earlier about
java.lang.NoClassDefFoundError:
javax/sound/sampled/DataLine
at
com.sun.media.renderer.audio.JavaSoundRenderer.createDevice(JavaSoundRenderer.java:108)
at
com.sun.media.renderer.audio.AudioRenderer.initDevice(AudioRenderer.java:276)
Now it hangs, and just prints out -
DataLine not supported: LINEAR, 22050.0 Hz, 16-bit,
Mono, LittleEndian, Signed
(Review ID: 99631)
======================================================================