AudioComponent class
Audio component, used to play audio in the game
See AudioComponentData for the data schema used to create an audio component
Signature:
export declare class AudioComponent extends Component3D<AudioComponentData>
Extends: Component3D<AudioComponentData>
Properties
Property |
Modifiers |
Type |
Description |
---|---|---|---|
|
{ volume: (value: any) => void; loop: (value: any) => void; playbackRate: (value: any) => void; autoPlay: (value: any) => void; } | ||
boolean |
weather the audio is used to play a background music. Defaults to false | ||
boolean | |||
|
boolean |
Returns true if the audio is playing | |
boolean |
Whether the audio should loop. Defaults to false | ||
number |
audio playback rate. Defaults to 1 | ||
number |
Volume of the audio, from 0 to 1. Defaults to 1 |
Methods
Method |
Modifiers |
Description |
---|---|---|
| ||
| ||
| ||
| ||
pause the audio | ||
play the audio | ||
stop the audio, this will reset the audio to the beginning |