Ask coding questions

← Back to all posts
How can I play a sound (.wav file) in my Java program in repl.it, please?
shamat (0)

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