Skip to content
← Back to Community
How can I play a sound (.wav file) in my Java program in repl.it, please?
Profile icon
shamat

try{
ais2=AudioSystem.getAudioInputStream(new File("error.wav"));
clip2=AudioSystem.getClip();
clip2.open(ais2);
clip2.start();
}
catch (Exception e){ e.printStackTrace();}

The above code doesn't work in repl.it

Voters
Profile icon
shamat