import javax.media.*;
import java.net.URL;
public class AudioPlayer {
public static void main(String[] args) {
try {
Player player = Manager.createPlayer(new URL("file:/path/to/audio/file.wav"));
player.start();
player.realize();
player.prefetch();
player.waitToEnd();
player.deallocate();
player.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}