Playing sound in Java - pt.1

PHOTO EMBED

Thu Jun 30 2022 12:40:06 GMT+0000 (Coordinated Universal Time)

Saved by @Mahmouxd #java #sound

final File soundFile = new File("./res/my_sound.wav");
  
try {
  mClip = AudioSystem.getClip();
  mClip.open(AudioSystem.getAudioInputStream(soundFile));

} catch (LineUnavailableException | IOException | UnsupportedAudioFileException e) {
  throw new RuntimeException(e);
}
content_copyCOPY