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

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() {; } //Stop the sound public void stopSound() { sound.stop(); } //Loop the sound public void loopSound() { sound.loop(); } }...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online