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 |
---|---|---|---|
isPlaying | readonly | boolean | Returns true if the audio is playing |
loop | boolean | Indicates whether the audio should start over when it is finished playing | |
playbackRate | number | Returns the audio playback rate | |
volume | number | Returns the audio volume, gos from O (muted) to 1 (max volume) |
Methods
Method | Modifiers | Description |
---|---|---|
pause() | pause the audio | |
play() | play the audio | |
stop() | stop the audio, this will reset the audio to the beginning |