Constructor

new (options:HowlOptions)

Create an audio group controller.

Parameters:

{HowlOptions}

o Passed in properties for this group.

Methods

duration ():Float

Get the duration of this sound.

Returns:

{Float} Audio duration.

fade (from:Float, to:Float, len:Int, ?id:Int):Howl

Fade a currently playing sound between two volumes (if no id is passsed, all sounds will fade).

Parameters:

{Float}

from The value to fade from (0.0 to 1.0).

{Float}

to The volume to fade to (0.0 to 1.0).

{Float}

len Time in milliseconds to fade.

{Int}

id The sound id (omit to fade all sounds).

Returns:

{Howl}

init (o:Dynamic):Howl

Initialize a new Howl group object.

Parameters:

{Object}

o Passed in properties for this group.

Returns:

{Howl}

load ():Howl

Load the audio file.

Returns:

{Howl}

loop ():Bool

loop (loop:Bool, id:Int):Howl

loop (loop:Bool):Howl

loop (id:Int):Bool

Get/set the loop parameter on a sound. This method can optionally take 0, 1 or 2 arguments. loop() -> Returns the group's loop value. loop(id) -> Returns the sound id's loop value. loop(loop) -> Sets the loop value for all sounds in this Howl group. loop(loop, id) -> Sets the loop value of passed sound id.

Returns:

{Howl/Bool} Returns self or current loop value.

mute (muted:Bool = true, ?id:Int):Howl

Mute/unmute a single sound or all sounds in this Howl group.

Parameters:

{Bool}

muted Set to true to mute and false to unmute.

{Int}

id The sound ID to update (omit to mute/unmute all).

Returns:

{Howl}

off (event:String, ?fn:Void ‑> Void, ?id:Int):Howl

off (event:String, fn:Int ‑> Void, ?id:Int):Howl

Remove a custom event.

Parameters:

{String}

event Event name.

{Function}

fn (optional) Listener to remove. Leave empty to remove all.

{Number}

id (optional) Only remove events for this sound.

Returns:

{Howl}

on (event:String, fn:Void ‑> Void, ?id:Int):Howl

on (event:String, fn:Int ‑> Void, ?id:Int):Howl

Listen to a custom event.

Parameters:

{String}

event Event name.

{Function}

fn Listener to call.

{Int}

id (optional) Only listen to events for this sound.

Returns:

{Howl}

once (event:String, fn:Void ‑> Void, ?id:Int):Howl

once (event:String, fn:Int ‑> Void, ?id:Int):Howl

Listen to a custom event and remove it once fired.

Parameters:

{String}

event Event name.

{Function}

fn Listener to call.

{Int}

id (optional) Only listen to events for this sound.

Returns:

{Howl}

pause (?id:Int):Howl

Pause playback and save current position.

Parameters:

{Int}

id The sound ID (empty to pause all in group).

Returns:

{Howl}

play (?sprite:EitherType<String, Int>):Int

Play a sound or resume previous playback.

Parameters:

{String/Int}

sprite Sprite name for sprite playback or sound id to continue previous.

Returns:

{Int} Sound ID.

playing (?id:Int):Bool

Check if a specific sound is currently playing or not.

Parameters:

{Number}

id The sound id to check. If none is passed, first sound is used.

Returns:

{Bool} True if playing and false if not.

rate ():EitherType<Howl, Float>

rate (rate:Float, id:Int):EitherType<Howl, Float>

rate (rate:Float):EitherType<Howl, Float>

rate (id:Int):EitherType<Howl, Float>

Get/set the playback rate of a sound. This method can optionally take 0, 1 or 2 arguments. rate() -> Returns the first sound node's current playback rate. rate(id) -> Returns the sound id's current playback rate. rate(rate) -> Sets the playback rate of all sounds in this Howl group. rate(rate, id) -> Sets the playback rate of passed sound id.

Returns:

{Howl/Float} Returns self or the current playback rate.

seek ():EitherType<Howl, Float>

seek (seek:Float, id:Int):EitherType<Howl, Float>

seek (seek:Float):EitherType<Howl, Float>

seek (id:Int):EitherType<Howl, Float>

Get/set the seek position of a sound. This method can optionally take 0, 1 or 2 arguments. seek() -> Returns the first sound node's current seek position. seek(id) -> Returns the sound id's current seek position. seek(seek) -> Sets the seek position of the first sound node. seek(seek, id) -> Sets the seek position of passed sound id.

Returns:

{Howl/Float} Returns self or the current seek position.

state ():String

Returns the current loaded state of this Howl.

Returns:

{String} 'unloaded', 'loading', 'loaded'

stop (?id:Int):Howl

Stop playback and reset to start.

Parameters:

{Int}

id The sound ID (empty to stop all in group).

Returns:

{Howl}

unload ():Void

Unload and destroy the current Howl object. This will immediately stop all sound instances attached to this group.

volume ():Float

volume (vol:Float, id:Int):Dynamic

volume (vol:Float):Dynamic

volume (id:Int):Float

Get/set the volume of this sound or of the Howl group. This method can optionally take 0, 1 or 2 arguments. volume() -> Returns the group's volume value. volume(id) -> Returns the sound id's current volume. volume(vol) -> Sets the volume of all sounds in this Howl group. volume(vol, id) -> Sets the volume of passed sound id.

Returns:

{Howl/Float} Returns self or current volume.