Sounds
You can directly use an instance of this class.
sounds
A class containing multiple Sound instances
Constructor Summary
Public Constructor | ||
public |
Create an instance of Sounds |
Method Summary
Public Methods | ||
public |
Adds a Sound instance to the Sounds |
|
public |
Returns a new instance of Sounds |
|
public |
Sets the Sounds class to enabled or disabled |
|
public |
Returns a specific Sound instance |
|
public |
Initializes the Sounds class. |
|
public |
Sets the Sounds class to muted or unmuted |
|
public |
Remove a Sound instance from the Sounds |
Public Constructors
Public Methods
public add(name: String, audio: Audio | String): Sound source
Adds a Sound instance to the Sounds
Return:
Sound | Returns the Sound instance |
public enable(enable: Boolean) source
Sets the Sounds class to enabled or disabled
Params:
Name | Type | Attribute | Description |
enable | Boolean | If true the Sound instances will be enabled |
public get(name: String): Sound source
Returns a specific Sound instance
Params:
Name | Type | Attribute | Description |
name | String | The Sound identifier |
Return:
Sound | The Sound which is represented by the identifier |
public init(): Promise source
Initializes the Sounds class. This is needed to enable Audio on some devices