Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

play sound in 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: #play #sound #java
ADD COMMENT
Topic
Name
3+3 =