Hello,


Can someone point out where the javadoc for AudioPlayer.player is?
This is the code I currently have...

import sun.audio.*;
import java.io.*;
...
...
...
         InputStream input = new FileInputStream("Stop.wav");
         AudioStream sound = new AudioStream(input);
         AudioPlayer.player.start(sound);

If there is no loop method for this, what's the easiest way to go about creating a looping method for AudioStream?

Not having much luck. I'm finding stuff under javax which is kinda confusing, but nothing under sun.audio. Is there a java doc for that? I still can't find it.

Ezzaral, I would suggest you read this to, if you have not before, as a sun.audio.* class is not "an old part of the api", I'm sorry to say.

Have fun reading. ;-)

Yes, sun.audio may not be an old part, honestly I don't know and didn't take a long time to look into it since I am am currently at work. I did run across an old (1997) article about using some of those classes to get audio to play in desktop java apps before it was officially supported by the public reference APIs.

Perhaps "old part of the api" was the wrong choice of words, but I did want to convey that he should look into the public javax.sound API instead. Maybe simply stating "Don't directly use sun.* packages" would have been a more appropriate suggestion.

Sorry for any confusion this may have generated.

Well thanks for the info. In the end I just used the javax stuff instead. Much more usable than what I had earlier.

BTW: What value should I use for DefaultCloseOperation if I don't want all the windows to close at once?

edit: never mind

This article has been dead for over six months. Start a new discussion instead.