Ye, just like that. No exception… nothing… just silence :-/
Even Sun’s “JavaSoundDemo” is silent… no wav, no aif, no midi, no rmf… silence
Win98se, sb128, directx9 (dx tests work flawlessly) [dunno if direct sound is used].
Ye, just like that. No exception… nothing… just silence :-/
Even Sun’s “JavaSoundDemo” is silent… no wav, no aif, no midi, no rmf… silence
Win98se, sb128, directx9 (dx tests work flawlessly) [dunno if direct sound is used].
Well yes, something seems broken with Java 1.5 sound.
The official Javasound Demo does produce these results on a Win2000 box:
0. 1-welcome.wav : works
My own little code outputting some wavs which worked with Java 1.4.x does produce some hiccup with Java 1.5.0: you hear something but it’s wrong.
for me it seems like sound clips under 1 second in length for the most time produces silence and sometimes static noice. ???
I had a problem too with 1.5 and javasound. The initialization behaved differently, causing initialization to fail. I filed a bug report but I have to check if they fixed that one.
Dunno if it’s the same problem though…
EDIT: Just checked, should be fixed in the RC version.
No sounds in Puppy Invaders (applet we’ve got) either. Bugger.
Cas
Does this mean that many games won’t sound correct (or be silent?) when being used with the new Java 1.5 ?
If so: Erik, could you please post the URL to your bug report so that we can vote on this. Maybe we should even start a general topic to ask people to vote for a bug fix.
A JVM which produces wrong or no sounds is very bad for games!
Sun article from 30-Sep-2004… Tiger Roars: The Release of Java 2 Platform, Standard Edition (J2SE) 5.0, an Interview with Sun Fellow Graham Hamilton. (He’s the lead architect for J2SE releases 1.3, 1.4, and now, 5.0.)
[quote]I’m also happy to report that Tiger looks like our highest quality J2SE release ever. Quality had been job #1 throughout the release development and this has paid off. In his recent blog, Mark Reinhold, Chief Engineer for J2SE, talks about how well we are doing on our various quality metrics. (…)
Theme #1 is quality. By quality, we mean stability, robustness, and compatibility. We want your earlier applications to just plain work with Tiger. We want to maintain previous behavior. We want this to be a release that can stay up for months or years at a time.
[/quote]
Ahem. So nobody of those many quality testers of “job #1” ever run the Java sound demo with Java 1.5 ? Sigh, maybe they shouldn’t hear music with headphones at work.
“Tiger squeaks” may have been a better title.
Cas
[quote]Does this mean that many games won’t sound correct (or be silent?) when being used with the new Java 1.5 ?
If so: Erik, could you please post the URL to your bug report so that we can vote on this. Maybe we should even start a general topic to ask people to vote for a bug fix.
A JVM which produces wrong or no sounds is very bad for games!
[/quote]
The problem was that bahaviour of initialization was different than before, but in cases where initialization was not done correctly. Because that wrong way of initializing was a very common mistake, they decided to revert back to old behaviour.
Should be fixed in 1.5.0 RC.
Read about it here: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5053380
Apparently, this mis-use of DataLine.Info’s audio format is quite common.
Hm… yea… very funny. I only found examples which “mis-use” that.
So what’s the proper way then? And why don’t they mention it?
Should I try open() without params, because that wrong way was commonly used and got fixed?
Bah. It’s so screwed.
why couldn’t they, for backward compatibility purposes, make them both work?
Thanks, good to hear. So it’s just the JavaSound demo which is partly broken and many sound play routines, including mine. So we’re to blame?
I checked my routine against the format parameter and it’s there. I don’t see what I am doing wrong to play a simple clip…
I tried to follow the Sound programmer’s guide in the Javadoc. Here’s my version. Does anybody see what’s the problem?
BufferedInputStream is = new BufferedInputStream(new FileInputStream("Sam.wav"));
AudioInputStream audiostream = AudioSystem.getAudioInputStream(is);
AudioFormat audioformat = audiostream.getFormat();
int bytelength = (int) (audioformat.getFrameSize() * audiostream.getFrameLength());
byte[] sampledata = new byte[bytelength];
audiostream.read(sampledata, 0, bytelength);
DataLine.Info datalineinfo = new DataLine.Info(Clip.class, audioformat, bytelength);
Clip klip = (Clip) AudioSystem.getLine(datalineinfo);
klip.open(audioformat, sampledata, 0, bytelength);
klip.start();
I’m using java.applet.AudioClip (wich is very old but has been working until now).
Some of my wav’s has gone silent…most of them are less than 1 sec but some works and some don’t.
Has anyone filed a bug report regarding the sound problems?
[quote]Does anybody see what’s the problem?
[/quote]
Looks fine to me.
If this worked in 1.4, maybe you can use it to create a small test case and file a bug report (if it’s not there already)?
In any way, even if there was something wrong, bahaviour shouldn’t change with a new version I think.
It worked fine for all Java 1.4 versions.
Plus I can’t see the “missing format parameter” which your originally quoted bug mentioned. So I think this sample should work. Which it doesn’t. I think I’m going to issue a bug report soon.
Wmjoers: Yes, “Applet.AudioClip” ist very easy to use, but isn’t one problem of it that you can’t play the same Clip (which maps to a wav file for example) several times at once?
Well anyway… i’ve used AudioClip in a game(not an applet) and it allways worked perfect (even in the 1.5 beta) but suddenly in 5.0 (1.5) some of the wav files are silent. It seems to me that some fundamental things has been broken in Java Sound. :’(
As a small note about AudioClips and WAVs. I’ve had nothing but problems with them… Some work, some don’t. My solution, which seems to always work, is to only use AIFF format. You’ll have to convert your existing sounds, but you can get Audacity from sourceForge and you’ll be on your way.
Dr. A>
same here, short sounds don’t work (occasionally? they do), longer ones work (some do not).
Does’nt seem to have to do anything with the audio format because I’m generating them (not loading from a file)
Looks like there’s some real bug in there…
Would some of you knowing more about Javasound, like to file a bug report to SUN’s database?
Kickin midi events manually in surprisingly works.
Playing rmf also (sometimes) works if you play, pause, wait, unpause… alright (midi should “work” like that too)… but of course - just for the fun of it - the last seconds are cut off. Yea, very funny indeed :-/