Modifier and Type | Method and Description |
---|---|
static AudioClip |
create(java.lang.String src)
Creates new instance of an audio clip based on the provided URL.
|
abstract boolean |
isSupported()
Check whether the audio clip is supported and can be played.
|
abstract void |
pause()
Pauses playback of the clip
|
abstract void |
play()
Plays the clip from begining to the end.
|
abstract void |
setVolume(double volume)
Specifies the volume of the audio.
|
public static AudioClip create(java.lang.String src)
AudioClip.isSupported()
method.
The src
can be absolute URL or it can be relative
to current browser context
- e.g. usually to the
page that is just being displayed.
src
- the URL where to find the audio clipjava.lang.NullPointerException
- if src is null
public abstract void play()
public abstract void pause()
public abstract void setVolume(double volume)
volume
- for the playbackpublic abstract boolean isSupported()
AudioClip.play()
a sound will be producedCopyright © 2021 The Apache Software Foundation. All rights reserved.