Package snap.gfx
Class SoundClip
java.lang.Object
snap.gfx.SoundClip
A class to manage the loading and playing of a sound.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic SoundClip
create()
Creates a new empty clip.static SoundClip
Creates a new SnapSound for file name.static SoundClip
Returns a sound for a given source.abstract int
Returns the sound length in milliseconds.protected static WebURL
getSoundURL
(Class aClass, String aName) Creates a new SnapSound for file name.abstract int
getTime()
Returns the sound time in milliseconds.abstract boolean
Returns whether sound is playing.abstract boolean
Returns whether sound is recording.abstract void
pause()
Pauses a sound.abstract void
play()
Plays the sound.abstract void
play
(int aCount) Plays the sound repeatedly for given count.abstract void
Starts a recording.abstract void
Stops a recording.abstract void
save()
Saves this sound.abstract void
setTime
(int aTime) Sets the sound time in milliseconds.abstract void
stop()
Tells sound to stop playing.
-
Constructor Details
-
SoundClip
public SoundClip()
-
-
Method Details
-
isPlaying
public abstract boolean isPlaying()Returns whether sound is playing. -
play
public abstract void play()Plays the sound. -
play
public abstract void play(int aCount) Plays the sound repeatedly for given count. -
stop
public abstract void stop()Tells sound to stop playing. -
pause
public abstract void pause()Pauses a sound. -
getLength
public abstract int getLength()Returns the sound length in milliseconds. -
getTime
public abstract int getTime()Returns the sound time in milliseconds. -
setTime
public abstract void setTime(int aTime) Sets the sound time in milliseconds. -
isRecording
public abstract boolean isRecording()Returns whether sound is recording. -
recordStart
public abstract void recordStart()Starts a recording. -
recordStop
public abstract void recordStop()Stops a recording. -
save
Saves this sound.- Throws:
IOException
-
get
Returns a sound for a given source. -
get
Creates a new SnapSound for file name. -
create
Creates a new empty clip. -
getSoundURL
Creates a new SnapSound for file name.
-