Sunday, April 5, 2015

Simple Wave File Player


This post presents a simple Wave File Player written in Java, using the sampled sound API. Since we are not using JavaFX, it will not support the mp3 format.


We will be using API from the javax.sound.sampled package. Hence we make the following imports at the beginning of the program.
import javax.sound.sampled.AudioFormat;
import javax.sound.sampled.AudioInputStream;
import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.Clip;
import javax.sound.sampled.DataLine;

Progress bar

We will use a JSlider as a progress bar. The scale are from 0 to 10000, which is simple to represent 0 to 100% with two decimal place. To update the progress, the following method will be invoked by a Swing Timer on every 30ms.

Sample Wave File

  epic_loop.wav : Orchestral Adventure by RevampedPRO, CC BY 3.0 license 

  twoTone2.wav : "63 Digital sound effects" by Kenney, CC0 license,
The wave files are inside a github project. Follow the following link to download the project as a zip file.

Source Code


  1. Poker Kiu Kiu Online Android is a large company based on legal online gambling which is equipped with a high level of security.

  2. Slot Deposit Pulsa is a legal gambling company based in Indonesia with more than 10 million people.

  3. Judi Deposit Pulsa Indonesian gambling companies are on the rise because the security on their website is very strong.

  4. Ceme Online Idnplay a trusted online gambling company from Indonesia.

  5. Daftar Idnplay the largest online gambling company in the world located in the country of Indonesia.

  6. Bola Gelinding a company that comes from Indonesia with the best website system.

  7. Daftar Sbobet gambling company which is one of the largest and most trusted companies in southeast asia.

  8. Judi Deposit Pulsa88 is the largest gambling company in Southeast Asia originating from Indonesia.

  9. Poker Deposit Pulsa88 is an Indonesian gambling company that is well known throughout Southeast Asia.

  10. Dadu Online is a gambling company originating from Indonesia with more than 2 million users from all over the world.

  11. Bola88 a gambling company that originated from Indonesia.

  12. Idnplay Poker medium-sized companies engaged in gambling games and their websites and applications.