Package arc.audio
Class Audio
java.lang.Object
arc.audio.Audio
- All Implemented Interfaces:
Disposable
- Direct Known Subclasses:
MockAudio
High-level wrapper for the Soloud library.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
countPlaying
(AudioSource source) void
dispose()
Releases all resources of this object.void
fadeFilterParam
(int voice, int filter, int attribute, float value, float timeSec) protected void
Intializes Soloud audio.boolean
boolean
isPlaying
(int soundId) Loads music, logging an error and returning a dummy track upon failure.Loads a sound, logging an error and returning a dummy track upon failure.int
play
(AudioSource source, float volume, float pitch, float pan, boolean loop) void
protect
(int voice, boolean protect) void
set
(int soundId, float pan, float volume) void
setFilter
(int index, AudioFilter filter) void
setFilterParam
(int voice, int filter, int attribute, float value) void
setLooping
(int soundId, boolean looping) void
setPaused
(int soundId, boolean paused) void
setPitch
(int soundId, float pitch) void
setVolume
(int soundId, float volume) void
stop
(int soundId) void
stop
(AudioSource source) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface arc.util.Disposable
isDisposed
-
Field Details
-
globalPitch
public float globalPitch -
falloff
public float falloffFalloff when playing audio. -
soundBus
Global bus for all sounds. -
musicBus
Global bus for all music.
-
-
Constructor Details
-
Audio
public Audio()Initializes Soloud audio by default. May throw an exception if initialization fails. -
Audio
public Audio(boolean enabled) Conditionally initializes audio. If enabled is false, does nothing.
-
-
Method Details
-
initialized
public boolean initialized() -
initialize
protected void initialize()Intializes Soloud audio. If this fails, prints an error and disables audio. -
newSound
Loads a sound, logging an error and returning a dummy track upon failure. -
newMusic
Loads music, logging an error and returning a dummy track upon failure. -
isPlaying
public boolean isPlaying(int soundId) -
protect
public void protect(int voice, boolean protect) -
play
-
stop
-
stop
public void stop(int soundId) -
setPaused
public void setPaused(int soundId, boolean paused) -
setLooping
public void setLooping(int soundId, boolean looping) -
setPitch
public void setPitch(int soundId, float pitch) -
setVolume
public void setVolume(int soundId, float volume) -
set
public void set(int soundId, float pan, float volume) -
fadeFilterParam
public void fadeFilterParam(int voice, int filter, int attribute, float value, float timeSec) -
setFilterParam
public void setFilterParam(int voice, int filter, int attribute, float value) -
setFilter
-
countPlaying
-
dispose
public void dispose()Description copied from interface:Disposable
Releases all resources of this object.- Specified by:
dispose
in interfaceDisposable
-