Audiocomponentdata

AudioComponentData interface

Data for the AudioComponent, see ComponentManager.create() on how to create a component

Signature:

export interface AudioComponentData extends Component3DData 

Extends: Component3DData

Properties

Property

Modifiers

Type

Description

ambient?

boolean

(Optional) weather the audio is used to play a background music. Defaults to false

autoPlay

false

Whether the audio should start playing automatically. Defaults to false

id?

string

(Optional) if not provided, an auto id will be generated

loop

false

Whether the audio should loop. Defaults to false

name?

string

(Optional) name for the component. Defaults to ""

playbackRate?

number

(Optional) audio playback rate. Defaults to 1

position?

XYZ

(Optional) Position of the audio in the space. Defaults to {x: 0, y: 0, z: 0}

rotation?

XYZ

(Optional) Rotation of the audio in the space. Defaults to {x: 0, y: 0, z: 0}

scale?

XYZ

(Optional) Scale of the audio in the space. Defaults to {x: 1, y: 1, z: 1}

type

"audio"

Type of the component

url

string

url of the audio file

volume?

number

(Optional) Volume of the audio, from 0 to 1. Defaults to 1