Search
 
SCRIPT & CODE EXAMPLE
 

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();
}
Comment

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();
}
Comment

play sound in java

playSound("sounds/effects/sheep1.wav");
Comment

PREVIOUS NEXT
Code Example
Java :: java sleep in code 
Java :: spring enable debug log level 
Java :: spigot cancel repeating task 
Java :: how to close a jframe in java with an if statement 
Java :: priority queue reverse order java 
Java :: select a random element from a list java 
Java :: how to check if a string contains only alphabets and numbers in java 
Java :: fullscreen activity android 
Java :: android open browser 
Java :: nanotime to milliseconds java 
Java :: zufallszahlen in java 
Java :: java random numbers in specific range 
Java :: change visibility of textview andoird 
Java :: Thread inline ajva 
Java :: spigot run task later 
Java :: java convert string to int 
Java :: java parse boolean to string 
Java :: apk full form 
Java :: hibernate dependency 
Java :: java double to string with comma 
Java :: java find substring between two strings 
Java :: spigot get commandmap 
Java :: CellStyle change backgroung color java 
Java :: java send an image over a socket 
Java :: bundletool aab to apk 
Java :: javafx get window in controller 
Java :: shakescleare merchant of venice 
Java :: Utils code for plugin minecraft 
Java :: filesaver javafx 
Java :: android studio print console 
ADD CONTENT
Topic
Content
Source link
Name
7+1 =