adding_sound_to_your_application
This is an old revision of the document!
Table of Contents
Adding Sound to Your Application
Here is a Java method to play a short bell sound effect that is in a wav format.
You will need the file bell.wav
import javax.sound.sampled.AudioSystem; import javax.sound.sampled.Clip; public void playBell() { File bellFile = new File("bell.wav"); try { bell = AudioSystem.getClip(); bell.open(AudioSystem.getAudioInputStream(bellFile)); bell.start(); } catch (Exception e) { e.printStackTrace(); } }
Getting sound effect files to play
Making and Editting your own sounds
I recommend Audacity
adding_sound_to_your_application.1778082435.txt.gz · Last modified: by frchris
