Sound - } //Play the sound -- the sound restarts each time...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
import java.applet.AudioClip; public class Sound { //The clip to be played by the Sound object private AudioClip sound; /** * Create a new Sound based on the given AudioClip * * @param sound - the AudioClip used to create the object */ public Sound(AudioClip sound) { this.sound = sound;
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: } //Play the sound -- the sound restarts each time this is called and //stops automatically at the end. public void playSound() { sound.play(); } //Stop the sound public void stopSound() { sound.stop(); } //Loop the sound public void loopSound() { sound.loop(); } }...
View Full Document

This note was uploaded on 06/10/2011 for the course COMP 110 taught by Professor Stotts during the Spring '08 term at UNC.

Ask a homework question - tutors are online