Answers for "how to play music in java"

-1

how to play a clip of audio in java when needed

Clip clip;

try {
	AudioInputStream input=AudioSystem.getAudioInputStream(new File("audio.wav"));
	clip=AudioSystem.getClip();
	clip.open(input);
	clip.start();
} catch (UnsupportedAudioFileException e) {
	e.printStackTrace();
} catch (IOException e) {
	e.printStackTrace();
} catch (LineUnavailableException e) {
	e.printStackTrace();
}
Posted by: Guest on July-04-2020
-2

how to play music in java

just dont
Posted by: Guest on February-09-2021

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language