aspose file tools*
The moose likes Beginning Java and the fly likes Add music to applet? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Add music to applet?" Watch "Add music to applet?" New topic
Author

Add music to applet?

may tan
Greenhorn

Joined: Jul 22, 2005
Posts: 22
Hello.. i have this coding in my applet..

{

AudioClip audioClip = getAudioClip(getCodeBase(), "17 Track 17.WAV");
audioClip.loop();

}
may tan
Greenhorn

Joined: Jul 22, 2005
Posts: 22
Sorry.. havent type finish my previuos qns..

okay i have the coding in my public void paint() method

{
AudioClip audioClip = getAudioClip(getCodeBase(), "17 Track 17.WAV");
audioClip.loop();
}

And also the follwoing html file in my "class" folder

<HTML>
<TITLE> Sound Demo APPLET </TITLE>
<APPLET CODE = "ComputeResistance.class" WIDTH=900 HEIGHT=1000></APPLET>
</HTML>

but why it doesnt seems to play any music?


Btw is it possible to add "4.17MB" song into my java?
will it hangs?

And what is the extension if it frm "window media player"??
is it .WAV?


Thanks =)
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9047
    
  10
Sorry.. havent type finish my previuos qns..

You can edit any of your own posts by clicking on the icon (that looks like a paper and pencil) of the post you want to edit.

okay i have the coding in my public void paint() method
{
AudioClip audioClip = getAudioClip(getCodeBase(), "17 Track 17.WAV");
audioClip.loop();
}


but why it doesnt seems to play any music?

paint() is for visual, not audio. I would suggest using another method for this.

Also, you might want to rename the .wav file to one with no spaces (at least to start with). Also remember that Java is case sensitive. Is your wav file really in all caps?

Btw is it possible to add "4.17MB" song into my java?
Will it hang?


After you get the small wav running, you can try with a larger file.

And what is the extension if it from "window media player"??
is it .WAV?


It depends on the operating system. Windows media player does indeed play wav files, but whether or not it is the default is system dependent.


JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Add music to applet?