Constructor
new Sound($parameters)
- Description:
- Creates a new sound.
- Source:
Examples
// minimal
const sound = new Sound({
$audio: audio
});
// full
const sound = new Sound({
$audio: audio,
$durationFadeOut: 125,
$loop: false,
$volume: 1
});
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
$parameters |
Object | The given parameters. | |
$parameters.$audio |
string | The audio source. | |
$parameters.$durationFadeOut |
number |
<optional> |
The fade out duration (in ms) (must be positive). |
$parameters.$loop |
boolean |
<optional> |
The loop status. |
$parameters.$volume |
number |
<optional> |
The volume. |
Members
audio :string
- Description:
- Gets the audio source.
- Source:
Gets the audio source.
Type:
- string
durationFadeOut :number
- Description:
- Gets fade out duration (in ms) (must be positive).
- Source:
Gets fade out duration (in ms) (must be positive).
Type:
- number
loop :boolean
- Description:
- Gets the loop status.
- Source:
Gets the loop status.
Type:
- boolean
volume :number
- Description:
- Gets the volume.
- Source:
Gets the volume.
Type:
- number