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

PropertyModifiersTypeDescription
autoPlayfalseWhether the audio should start playing automatically. Defaults to false
id?string(Optional) if not provided, an auto id will be generated
loopfalseWhether the audio should loop. Defaults to false
name?string(Optional) name for the component. Defaults to ""
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"
urlstringurl of the audio file
volume?number(Optional) Volume of the audio, from 0 to 1. Defaults to 1