|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectkiwi.ui.AudioClip
This class represents an audio clip. The audio data is restricted to the 8000Hz, single-channel u-law format. The class relies on the undocumented sun.audio package and thus may not be portable.
AudioClip
s may be read from streams, from files, or loaded as
system resources using a ResourceManager
or
ResourceLoader
.
ResourceManager.getSound(java.lang.String)
,
ResourceLoader.getResourceAsURL(java.lang.String)
Field Summary | |
private sun.audio.AudioData |
audioData
|
private sun.audio.AudioDataStream |
audioStream
|
private sun.audio.ContinuousAudioDataStream |
cAudioStream
|
(package private) static int |
length
|
private java.lang.String |
name
|
Constructor Summary | |
AudioClip(java.io.InputStream stream)
Construct a new AudioClip . |
|
AudioClip(java.lang.String file)
Construct a new AudioClip . |
|
AudioClip(java.net.URL url)
Construct a new AudioClip . |
Method Summary | |
java.lang.String |
getName()
Get the audio clip's name. |
void |
loop()
Play the audio clip continuously. |
void |
play()
Play the audio clip. |
void |
setName(java.lang.String name)
Set the audio clip's name. |
void |
stop()
Stop playing the audio clip. |
java.lang.String |
toString()
Get a string representation of this object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
static int length
private sun.audio.AudioData audioData
private sun.audio.AudioDataStream audioStream
private sun.audio.ContinuousAudioDataStream cAudioStream
private java.lang.String name
Constructor Detail |
public AudioClip(java.net.URL url) throws java.io.IOException
AudioClip
.
url
- The location of the audio data.
java.io.IOException
- If there is a problem reading from the
specified URL.public AudioClip(java.lang.String file) throws java.io.IOException
AudioClip
.
java.io.IOException
- If there is a problem reading from the
specified file.public AudioClip(java.io.InputStream stream) throws java.io.IOException
AudioClip
.
stream
- The stream to read the audio data from.
java.io.IOException
- If there is a problem reading from the
specified stream.Method Detail |
public void play()
play
in interface java.applet.AudioClip
public void loop()
loop
in interface java.applet.AudioClip
public void stop()
stop
in interface java.applet.AudioClip
public void setName(java.lang.String name)
name
- The name.public java.lang.String getName()
public java.lang.String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |