Members
The list of extensions that can be played. This is the preferred order of playback. If you want to priority the order of playback, you can use this array to do so.
The list of browser supported audio formats.
Properties:
Name | Type | Description |
---|---|---|
aiff |
boolean |
|
caf |
boolean |
|
mid |
boolean |
|
mp3 |
boolean |
|
mpeg |
boolean |
|
oga |
boolean |
|
ogg |
boolean |
|
opus |
boolean |
|
wav |
boolean |
|
wma |
boolean |
|
Methods
Create a new "Audio" stream based on given audio path and project uri; returns the audio object.
Name | Type | Attributes | Description |
---|---|---|---|
url |
string |
Full path of the file to play. |
|
callback |
Function |
<optional> |
Callback when complete. |
Returns:
Type | Description |
---|---|
string | New audio element alias. |
Render image as Texture. Only supported with WebAudio
Name | Type | Attributes | Description |
---|---|---|---|
sound |
Sound |
Instance of sound to render |
|
options |
RenderOptions |
<optional> |
Custom rendering options |
Returns:
Type | Description |
---|---|
TextureSource | Result texture |
sineTone (hertz, seconds) Sound
Create a new sound for a sine wave-based tone. Only supported with WebAudio
Name | Type | Default | Description |
---|---|---|---|
hertz |
number | 200 |
Frequency of sound. |
seconds |
number | 1 |
Duration of sound in seconds. |
Returns:
Type | Description |
---|---|
Sound | New sound. |
Function to validate file type formats. This is called when the library initializes, but can
be called again if you need to recognize a format not listed in utils.extensions
at
initialization.
Name | Type | Attributes | Description |
---|---|---|---|
typeOverrides |
Record<string, string> |
<optional> |
|