Properties

autoplay:Null<Bool>

Set to true to automatically start playback when sound is loaded.

format:Null<Array<String>>

howler.js automatically detects your file format from the extension, but you may also specify a format in situations where extraction won't work (such as with a SoundCloud stream).

html5:Null<Bool>

Set to true to force HTML5 Audio. This should be used for large audio files so that you don't have to wait for the full file to be downloaded and decoded before playing.

loop:Null<Bool>

Set to true to automatically loop the sound forever.

mute:Null<Bool>

Set to true to load the audio muted.

onend:Null<Int ‑> Void>

Fires when the sound finishes playing (if it is looping, it'll fire at the end of each loop). The first parameter is the ID of the sound.

onfade:Null<Int ‑> Void>

Fires when the current sound finishes fading in/out. The first parameter is the ID of the sound.

onload:Null<Void ‑> Void>

Fires when the sound is loaded.

onloaderror:Null<Void ‑> Void>

Fires when the sound is unable to load.

onmute:Null<Int ‑> Void>

Fires when the sound has been muted/unmuted. The first parameter is the ID of the sound.

onpause:Null<Int ‑> Void>

Fires when the sound has been paused. The first parameter is the ID of the sound.

onplay:Null<Int ‑> Void>

Fires when the sound begins playing. The first parameter is the ID of the sound.

onrate:Null<Int ‑> Void>

Fires when the sound's playback rate has changed. The first parameter is the ID of the sound.

onseek:Null<Int ‑> Void>

Fires when the sound has been seeked. The first parameter is the ID of the sound.

onstop:Null<Int ‑> Void>

Fires when the sound has been stopped. The first parameter is the ID of the sound.

onvolume:Null<Int ‑> Void>

Fires when the sound's volume has changed. The first parameter is the ID of the sound.

pool:Null<Int>

The size of the inactive sounds pool. Once sounds are stopped or finish playing, they are marked as ended and ready for cleanup. We keep a pool of these to recycle for improved performance. Generally this doesn't need to be changed. It is important to keep in mind that when a sound is paused, it won't be removed from the pool and will still be considered active so that it can be resumed later.

preload:Null<Bool>

Automatically begin downloading the audio file when the Howl is defined.

rate:Null<Float>

The rate of playback. 0.5 to 4.0, with 1.0 being normal speed.

sprite:Null<Dynamic>

Define a sound sprite for the sound. The offset and duration are defined in milliseconds. A third (optional) parameter is available to set a sprite as looping.

{
  key: [offset, duration, (loop)]
}

src:Null<Array<String>>

The sources to the track(s) to be loaded for the sound (URLs or base64 data URIs). These should be in order of preference, howler.js will automatically load the first one that is compatible with the current browser. If your files have no extensions, you will need to explicitly specify the extension using the ext property.

volume:Null<Float>

The volume of the specific track, from 0.0 to 1.0.