Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

How to play sounds on java

void playSound(String soundFile) {
    File f = new File("./" + soundFile);
    AudioInputStream audioIn = AudioSystem.getAudioInputStream(f.toURI().toURL());  
    Clip clip = AudioSystem.getClip();
    clip.open(audioIn);
    clip.start();
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #How #play #sounds #java
ADD COMMENT
Topic
Name
2+9 =