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 :: how to generate random number in java 
Java :: sorting char array in java 
Java :: print star pattern in java 
Java :: how to increment character in java 
Java :: how to add to a file in java 
Java :: all devisor of a number java 
Java :: Calculator Program in Java. 
Java :: java calendar hour vs hour of day 
Java :: java string padding 
Java :: como calcular a raiz quadrada em java 
Java :: java random primary key 
Java :: java filenotfoundexception 
Java :: java jframe example 
Java :: remove spaces at beginning and end of string java 
Java :: android BottomSheetDialogFragment not opening fully on landscape 
Java :: java scanner netLine 
Java :: how to iterate list of string array in java 
Java :: how to add animation between activity in android 
Java :: declare hashmap java 
Java :: java selenium implicitly wait 
Java :: java detect new line in string 
Java :: java array to collection 
Java :: string to byte array java 
Java :: java to check if its a number scanner 
Java :: java how to make a number 
Java :: reading from a text file in java 
Java :: charcodeat java 
Java :: android studio create a Uri 
Java :: get random number from enum in java 
Java :: set java path on linux ubuntu 
ADD CONTENT
Topic
Content
Source link
Name
6+2 =