-
Notifications
You must be signed in to change notification settings - Fork 4
Audio
Eric edited this page Apr 28, 2026
·
13 revisions
Audiois an object that makes the link between stored audio files in Cache andHowler.js. All sounds added to thepreloadtag ofapp.jsonwill be stored in OGX.JS's cache and can be accessed or played usingAudio. All sounds are played via Howler.
OGX.JS supports
mp3oggwebmandwavfiles.
OGX.JS provides a mechanism to preload and store sounds. Add references to the sounds to be preload in the app.json configuration such as
{...,
preload:{
"/snd":["click.mp3", "msg.mp3"]
}, ...
}
To play a cached sound.
Optionsis an optional object to configureHowler
OGX.Audio.play(_ID_, _OPTIONS_);
A practical example
OGX.Audio.play('click', {volume: 0.5, loop: false});
To retrieve a preloaded sound
OGX.Audio.get(_ID_);
To convert all preloaded sounds into
Howls.Optionsis an optional object to configureHowler. If sounds are not prepared, each sound will be converted to aHowlat runtime.
OGX.Audio.prepare(_OPTIONS_);
- Welcome
- Changelog
- Structure
- Configuration
- Getting started
- CLI
- Poly
- Core
- Templating
- Routing
- Controllers
- Components
- Extra Components
- Helpers
- Styling
- Debugging