Adding Sound to APPLICATIONS
Ive been digging into Google for hours now and I cant find one tutorial for adding sounds to applications. They are all just for Applets. If I try to use the Applet tutorial code, I get this error in the line:
Code:
import java.applet.AudioClip;
public class SoundManager {
private static AudioClip[] sounds = new AudioClip[32];
private static int count = 0;
public void loadSound(String file){
sounds[count++] = getAudioClip(getCodeBase(), file);
}
}
"The Method getCodeBase() is undefined for the class"
How do I fix this problem, OR how do I implement sounds into APPLICATIONS
Re: Adding Sound to APPLICATIONS
There's a static method in the Applet class: newAudioClip( ... ); it loads an audio clip for you; there's no need to worry about that Applet class, i.e. you don't need to build an applet, you're just using a static method from that class (the method is in the wrong class i.m.h.o.)
kind regards,
Jos
Re: Adding Sound to APPLICATIONS
there can be one other way too.....but it will use your computer's pre-installed products like windows media player,etc...
search for exec method that will indirectly use the command line to play audio files.....