Basics
Guides
API Reference
Basics
Guides
API Reference
[20:7] extends: EngineService
Wraps FXGL's AudioPlayer
(com.almasb.fxgl.audio.AudioPlayer), the engine service that
tracks active Music and Sound instances, manages global volume,
and pauses/resumes music when the window minimizes.
Obtain at runtime via fxgl.getAudioPlayer(); the wrapper
provides the play/pause/stop/loop API plus the bulk operations
(stopAllSounds, stopAllMusic, stopAllSoundsAndMusic). Sound /
Music wrappers from the existing aus/fxgl/Sound.aus and
Music.aus pair with this service.
AudioPlayer (Ajo = null)
Creates an AudioPlayer wrapper. Empty by default; the (Ajo) form wraps the running engine's instance.
Ajo is an optional AussomJavaObject around an AudioPlayer.adopt (object Ajo)
Wraps an existing AudioPlayer AussomJavaObject.
Ajo is an AussomJavaObject around an AudioPlayer.A new wrapper.playSound (object SoundObj)
Plays the given Sound (one-shot effect).
SoundObj is a Sound wrapper.this objectstopSound (object SoundObj)
Stops the given Sound mid-playback.
SoundObj is a Sound wrapper.this objectstopAllSounds ()
Stops every currently-playing sound.
this objectplayMusic (object MusicObj)
Plays the given Music track (single play).
MusicObj is a Music wrapper.this objectloopMusic (object MusicObj)
Loops the given Music track indefinitely.
MusicObj is a Music wrapper.this objectpauseMusic (object MusicObj)
Pauses the given Music track. Resumes on resumeMusic.
MusicObj is a Music wrapper.this objectresumeMusic (object MusicObj)
Resumes a paused Music track.
MusicObj is a Music wrapper.this objectstopMusic (object MusicObj)
Stops the given Music track mid-playback.
MusicObj is a Music wrapper.this objectpauseAllMusic ()
Pauses every currently-playing Music track.
this objectresumeAllMusic ()
Resumes every paused Music track.
this objectplayAllMusic ()
Plays every active Music track.
this objectstopAllMusic ()
Stops every active Music track.
this objectstopAllSoundsAndMusic ()
Stops every active Sound and Music track.
this objectloadAudio (string TypeName, string UrlString, bool IsMobile = false)
Loads an Audio object from the given URL string and AudioType. Use for loading audio assets outside the normal AssetLoader path.
TypeName is the AudioType name ("MUSIC" or "SOUND").UrlString is the URL to load from.IsMobile is true to use the mobile-optimized loader.An AussomJavaObject around the loaded Audio.
Aussom
Write once. Embed everywhere.
Copyright 2026 Austin Lehman. All rights reserved.