Class AudioSource
java.lang.Object
dev.prozilla.pine.common.asset.audio.AudioSource
- All Implemented Interfaces:
Asset
,AudioSourceContext
,Destructible
,Initializable
public class AudioSource
extends Object
implements Initializable, Destructible, Asset, AudioSourceContext
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
destroy()
Destroys this object.double[]
getAverageMagnitudes
(int intervalCount) double[]
getPath()
Returns the path to the file this asset was loaded from.void
init()
Initializes this object to prepare its usage.boolean
boolean
void
pause()
void
play()
void
rewind()
void
setAttribute
(int attribute, boolean value) void
setAttribute
(int attribute, float value) void
setAttribute
(int attribute, int value) void
setCapture
(boolean capture) void
setLoop
(boolean loop) void
setPitch
(float pitch) void
setVolume
(float volume) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface dev.prozilla.pine.common.asset.audio.AudioSourceContext
restart, stop, togglePause
-
Constructor Details
-
AudioSource
-
-
Method Details
-
init
Description copied from interface:Initializable
Initializes this object to prepare its usage.- Specified by:
init
in interfaceInitializable
- Throws:
IllegalStateException
-
destroy
public void destroy()Description copied from interface:Destructible
Destroys this object.- Specified by:
destroy
in interfaceAsset
- Specified by:
destroy
in interfaceDestructible
-
getPath
Description copied from interface:Asset
Returns the path to the file this asset was loaded from. -
setCapture
public void setCapture(boolean capture) -
isCaptured
public boolean isCaptured() -
rewind
public void rewind()- Specified by:
rewind
in interfaceAudioSourceContext
-
play
public void play()- Specified by:
play
in interfaceAudioSourceContext
-
pause
public void pause()- Specified by:
pause
in interfaceAudioSourceContext
-
isPlaying
public boolean isPlaying()- Specified by:
isPlaying
in interfaceAudioSourceContext
-
setVolume
- Specified by:
setVolume
in interfaceAudioSourceContext
- Throws:
IllegalStateException
-
setPitch
- Specified by:
setPitch
in interfaceAudioSourceContext
- Throws:
IllegalStateException
-
setLoop
- Specified by:
setLoop
in interfaceAudioSourceContext
- Throws:
IllegalStateException
-
setAttribute
- Throws:
IllegalStateException
-
setAttribute
- Throws:
IllegalStateException
-
setAttribute
- Throws:
IllegalStateException
-
getAverageMagnitudes
public double[] getAverageMagnitudes(int intervalCount) -
getMagnitudes
public double[] getMagnitudes()
-