Breaking News
Home / Java / Java Snippets / Sound Player for .WAV and .AU Files

Sound Player for .WAV and .AU Files

Sound Player for AU and WAV

This snippet shows how to play .wav or .au file. The following steps need to be done.

– Get the AudioInputStream for the audio file

– Check the PCM_SIGNED encoding, else convert

– Create the AudioClip using the DataLine object

– Finally play the clip and close stream and clip when done.

 [pb_builder]

Check Also

How to progamatically get the Java version?

Snippet The key here is to use the system property java.version and get minor and …

Advertisment ad adsense adlogger