HowlerTrack
Class representing a Howler audio track.
Implements
Constructors
new HowlerTrack()
new HowlerTrack(
trackId
,category
,audioManager
,volume
,loop
):HowlerTrack
Create a new Howler audio track.
Parameters
• trackId: string
The ID of the audio track.
• category: string
The category of the audio track.
• audioManager: IAudioManager
The audio manager for the audio track.
• volume: number
= 1
The volume of the audio track.
• loop: boolean
= false
Whether the audio track should loop.
Returns
Source
Properties
FILE_EXTENSIONS
static
FILE_EXTENSIONS:string
[]
File extensions that Howler will attempt to load audio files with, in this order.
Default
Source
Accessors
id
get
id():string
Get the ID of the audio track.
Returns
string
The ID of the audio track.
Source
Methods
fadeTo()
fadeTo(
volume
,milliseconds
):void
Fade the audio track to a specified volume over a specified duration.
Parameters
• volume: number
The target volume.
• milliseconds: number
The duration of the fade.
Returns
void
Implementation of
Source
getDuration()
getDuration():
number
Get the duration of the audio track.
Returns
number
The duration of the audio track.
Implementation of
Source
getPitch()
getPitch():
number
Get the pitch of the audio track.
Returns
number
The pitch of the audio track.
Implementation of
Source
getSource()
getSource():
Howl
Get the source of the audio track.
Returns
Howl
The source of the audio track.
Source
getTimePos()
getTimePos():
number
Get the time position of the audio track.
Returns
number
The time position of the audio track.
Implementation of
Source
getVolume()
getVolume():
number
Get the volume of the audio track.
Returns
number
The volume of the audio track.
Implementation of
Source
isLooped()
isLooped():
boolean
Check if the audio track is looped.
Returns
boolean
Whether the audio track is looped.
Implementation of
Source
isMuted()
isMuted():
boolean
Check if the audio track is muted.
Returns
boolean
Whether the audio track is muted.
Implementation of
Source
isPlaying()
isPlaying():
boolean
Check if the audio track is playing.
Returns
boolean
Whether the audio track is playing.
Implementation of
Source
loadSource()
loadSource():
void
Load the source of the audio track.
Returns
void
Implementation of
Source
off()
off(
eventName
,callback
?):void
Remove an event listener from the audio track.
Parameters
• eventName: string
The name of the event.
• callback?
The callback function.
Returns
void
Implementation of
Source
on()
on(
eventName
,callback
):void
Add an event listener to the audio track.
Parameters
• eventName: string
The name of the event.
• callback
The callback function.
Returns
void
Implementation of
Source
once()
once(
eventName
,callback
):void
Add an event listener to the audio track that will be called once.
Parameters
• eventName: string
The name of the event.
• callback
The callback function.
Returns
void
Implementation of
Source
pause()
pause():
void
Pause the audio track.
Returns
void
Implementation of
Source
play()
play():
void
Play the audio track.
Returns
void
Implementation of
Source
setLooped()
setLooped(
pLoop
):void
Set whether the audio track is looped.
Parameters
• pLoop: boolean
Whether the audio track should be looped.
Returns
void
Implementation of
Source
setMuted()
setMuted(
value
):void
Set whether the audio track is muted.
Parameters
• value: boolean
Whether the audio track should be muted.
Returns
void
Implementation of
Source
setPitch()
setPitch(
pitch
?):void
Set the pitch of the audio track.
Parameters
• pitch?: number
The pitch of the audio track.
Returns
void
Implementation of
Source
setTimePos()
setTimePos(
pPos
):void
Set the time position of the audio track.
Parameters
• pPos: number
The time position of the audio track.
Returns
void
Implementation of
Source
setVolume()
setVolume(
volume
):void
Set the volume of the audio track.
Parameters
• volume: number
The volume of the audio track.
Returns
void
Implementation of
Source
setVolumeWithModifiers()
setVolumeWithModifiers(
volume
,masterVolume
,categoryVolume
):void
Set the volume of the audio track with modifiers.
Parameters
• volume: number
The volume of the audio track.
• masterVolume: number
The master volume.
• categoryVolume: number
The category volume.
Returns
void
Implementation of
IAudioTrack
.setVolumeWithModifiers
Source
stop()
stop():
void
Stop the audio track.
Returns
void
Implementation of
Source
unloadSource()
unloadSource():
void
Unload the source of the audio track.
Returns
void