Audio
- custom type representing the internal audio statepublic interface AudioEnvironment<Audio>
ServiceLoader
can find it - e.g. use
ServiceProvider
annotation. Possibly
one can register the provider into Contexts.newBuilder()
, in
case the implementation is somehow associated
with the actual BrwsrCtx
(works since version 0.8.3).Modifier and Type | Method and Description |
---|---|
Audio |
create(String src)
Checks if the provided URL can be a supported audio stream
and if so, it create an object to represent it.
|
boolean |
isSupported(Audio a)
Checks whether given audio is supported
|
void |
pause(Audio a)
Pauses playback of the audio.
|
void |
play(Audio a)
Starts playback of the audio.
|
void |
setVolume(Audio a,
double volume)
Changes volume for the playback of the audio.
|
Audio create(String src)
AudioEnvironment.play(java.lang.Object)
).src
- the URL pointing to the media streamnull
if this
environment does not know how to handle such streamvoid play(Audio a)
a
- the internal representation of the audio as created by AudioEnvironment.create(java.lang.String)
method.void pause(Audio a)
a
- the internal representation of the audio as created by AudioEnvironment.create(java.lang.String)
method.void setVolume(Audio a, double volume)
a
- the internal representation of the audio as created by AudioEnvironment.create(java.lang.String)
method.volume
- value between 0.0 and 1.0boolean isSupported(Audio a)
a
- the internal representation of the audio as created by AudioEnvironment.create(java.lang.String)
method.true
or false
Copyright © 2018 NetBeans. All rights reserved.