Constructor
(private) new Channel(manager, sound, optionsopt)
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
manager |
pc.AudioManager | The AudioManager instance | |||||||||||||||||||||
sound |
pc.Sound | The sound to playback | |||||||||||||||||||||
options |
Object |
<optional> |
Optional options object.
Properties
|
- Source:
Methods
(private) getLoop() → {Boolean}
Get the current looping state of the Channel
- Source:
Returns:
The loop property for the channel.
- Type
- Boolean
(private) getPitch() → {Number}
Get the current pitch of the Channel
- Source:
Returns:
The pitch of the channel.
- Type
- Number
(private) getVolume() → {Number}
Get the current value for the volume. Between 0 and 1.
- Source:
Returns:
The volume of the channel.
- Type
- Number
(private) onManagerResume()
Handle the manager's 'resume' event.
- Source:
(private) onManagerSuspend()
Handle the manager's 'suspend' event.
- Source:
(private) onManagerVolumeChange()
Handle the manager's 'volumechange' event.
- Source:
(private) pause()
Pause playback of sound. Call unpause() to resume playback from the same position
- Source:
(private) play()
Begin playback of sound
- Source:
(private) setLoop(loop)
Enable/disable the loop property to make the sound restart from the beginning when it reaches the end.
Parameters:
Name | Type | Description |
---|---|---|
loop |
Boolean | true to loop the sound, false otherwise. |
- Source:
(private) setVolume(volume)
Set the volume of playback between 0 and 1.
Parameters:
Name | Type | Description |
---|---|---|
volume |
Number | The volume of the sound. Will be clamped between 0 and 1. |
- Source:
(private) stop()
Stop playback of sound. Calling play() again will restart playback from the beginning of the sound.
- Source:
(private) unpause()
Resume playback of the sound. Playback resumes at the point that the audio was paused
- Source: