Skip to content

Class: PositionAudio

Dynamic audio component, with volume varying based on the relative position of the monitor

Hierarchy

Constructors

Properties

Accessors

Methods

Constructors

constructor

new PositionAudio(): PositionAudio

Returns

PositionAudio

Overrides

StaticAudio.constructor

Defined in

packages/media-extention/PositionAudio.ts:14

Properties

panner

panner: PannerNode

Defined in

packages/media-extention/PositionAudio.ts:9


context

context: AudioContext = null

Inherited from

StaticAudio.context

Defined in

packages/media-extention/StaticAudio.ts:9


gainNode

gainNode: GainNode = null

Inherited from

StaticAudio.gainNode

Defined in

packages/media-extention/StaticAudio.ts:10


source

source: AudioBufferSourceNode = null

Inherited from

StaticAudio.source

Defined in

packages/media-extention/StaticAudio.ts:11


playing

playing: boolean = false

Inherited from

StaticAudio.playing

Defined in

packages/media-extention/StaticAudio.ts:16


object3D

object3D: Object3D = null

owner object3D

Inherited from

StaticAudio.object3D

Defined in

src/components/ComponentBase.ts:17


isDestroyed

Optional isDestroyed: boolean

Inherited from

StaticAudio.isDestroyed

Defined in

src/components/ComponentBase.ts:38

Accessors

refDistance

get refDistance(): number

Returns

number

Defined in

packages/media-extention/PositionAudio.ts:99

set refDistance(value): void

Parameters

NameType
valuenumber

Returns

void

Defined in

packages/media-extention/PositionAudio.ts:102


rolloffFactor

get rolloffFactor(): number

Returns

number

Defined in

packages/media-extention/PositionAudio.ts:108

set rolloffFactor(value): void

Parameters

NameType
valuenumber

Returns

void

Defined in

packages/media-extention/PositionAudio.ts:111


distanceModel

get distanceModel(): DistanceModelType

Returns

DistanceModelType

Defined in

packages/media-extention/PositionAudio.ts:114

set distanceModel(value): void

Parameters

NameType
valueDistanceModelType

Returns

void

Defined in

packages/media-extention/PositionAudio.ts:117


maxDistance

get maxDistance(): number

Returns

number

Defined in

packages/media-extention/PositionAudio.ts:120

set maxDistance(value): void

Parameters

NameType
valuenumber

Returns

void

Defined in

packages/media-extention/PositionAudio.ts:123


eventDispatcher

get eventDispatcher(): CEventDispatcher

Returns

CEventDispatcher

Inherited from

StaticAudio.eventDispatcher

Defined in

src/components/ComponentBase.ts:23

set eventDispatcher(value): void

Parameters

NameType
valueCEventDispatcher

Returns

void

Inherited from

StaticAudio.eventDispatcher

Defined in

src/components/ComponentBase.ts:28


isStart

get isStart(): boolean

Returns

boolean

Inherited from

StaticAudio.isStart

Defined in

src/components/ComponentBase.ts:40


transform

get transform(): Transform

Return the Transform component attached to the Object3D.

Returns

Transform

Inherited from

StaticAudio.transform

Defined in

src/components/ComponentBase.ts:47


enable

get enable(): boolean

Enable/disable components. The enabled components can be updated, while the disabled components cannot be updated.

Returns

boolean

Inherited from

StaticAudio.enable

Defined in

src/components/ComponentBase.ts:68

set enable(value): void

Enable/disable components. The enabled components can be updated, while the disabled components cannot be updated.

Parameters

NameType
valueboolean

Returns

void

Inherited from

StaticAudio.enable

Defined in

src/components/ComponentBase.ts:54

Methods

setLisenter

setLisenter(listener): this

Parameters

NameType
listenerAudioListener

Returns

this

Overrides

StaticAudio.setLisenter

Defined in

packages/media-extention/PositionAudio.ts:17


showHelper

showHelper(thickness?, step?): void

Parameters

NameType
thickness?number
step?number

Returns

void

Defined in

packages/media-extention/PositionAudio.ts:24


hideHelper

hideHelper(): void

Returns

void

Defined in

packages/media-extention/PositionAudio.ts:78


toggleHelper

toggleHelper(): void

Returns

void

Defined in

packages/media-extention/PositionAudio.ts:87


updateHeler

updateHeler(): void

Returns

void

Defined in

packages/media-extention/PositionAudio.ts:95


setDirectionalCone

setDirectionalCone(coneInnerAngle, coneOuterAngle, coneOuterGain): PositionAudio

Parameters

NameType
coneInnerAnglenumber
coneOuterAnglenumber
coneOuterGainnumber

Returns

PositionAudio

Defined in

packages/media-extention/PositionAudio.ts:130


start

start(): void

Returns

void

Overrides

StaticAudio.start

Defined in

packages/media-extention/PositionAudio.ts:142


stop

stop(): this

Returns

this

Overrides

StaticAudio.stop

Defined in

packages/media-extention/PositionAudio.ts:144


onUpdate

onUpdate(): void

Returns

void

Overrides

StaticAudio.onUpdate

Defined in

packages/media-extention/PositionAudio.ts:147


destroy

destroy(force?): void

Parameters

NameType
force?boolean

Returns

void

Overrides

StaticAudio.destroy

Defined in

packages/media-extention/PositionAudio.ts:170


load

load(url, options?): Promise<void>

Parameters

NameType
urlstring
optionsObject

Returns

Promise<void>

Inherited from

StaticAudio.load

Defined in

packages/media-extention/StaticAudio.ts:40


loadBuffer

loadBuffer(buffer, options?): Promise<void>

Parameters

NameType
bufferArrayBuffer
optionsObject

Returns

Promise<void>

Inherited from

StaticAudio.loadBuffer

Defined in

packages/media-extention/StaticAudio.ts:46


play

play(): this

Returns

this

Inherited from

StaticAudio.play

Defined in

packages/media-extention/StaticAudio.ts:55


pause

pause(): this

Returns

this

Inherited from

StaticAudio.pause

Defined in

packages/media-extention/StaticAudio.ts:78


setVolume

setVolume(value): this

Parameters

NameType
valuenumber

Returns

this

Inherited from

StaticAudio.setVolume

Defined in

packages/media-extention/StaticAudio.ts:94


init

init(param?): void

Parameters

NameType
param?any

Returns

void

Inherited from

StaticAudio.init

Defined in

src/components/ComponentBase.ts:112


onEnable

onEnable(view?): any

Parameters

NameType
view?View3D

Returns

any

Inherited from

StaticAudio.onEnable

Defined in

src/components/ComponentBase.ts:115


onDisable

onDisable(view?): any

Parameters

NameType
view?View3D

Returns

any

Inherited from

StaticAudio.onDisable

Defined in

src/components/ComponentBase.ts:116


onLateUpdate

onLateUpdate(view?): any

Parameters

NameType
view?View3D

Returns

any

Inherited from

StaticAudio.onLateUpdate

Defined in

src/components/ComponentBase.ts:118


onBeforeUpdate

onBeforeUpdate(view?): any

Parameters

NameType
view?View3D

Returns

any

Inherited from

StaticAudio.onBeforeUpdate

Defined in

src/components/ComponentBase.ts:119


onCompute

onCompute(view?, command?): any

Parameters

NameType
view?View3D
command?GPUCommandEncoder

Returns

any

Inherited from

StaticAudio.onCompute

Defined in

src/components/ComponentBase.ts:120


onGraphic

onGraphic(view?): any

Parameters

NameType
view?View3D

Returns

any

Inherited from

StaticAudio.onGraphic

Defined in

src/components/ComponentBase.ts:121


onParentChange

onParentChange(lastParent?, currentParent?): any

Parameters

NameType
lastParent?Object3D
currentParent?Object3D

Returns

any

Inherited from

StaticAudio.onParentChange

Defined in

src/components/ComponentBase.ts:122


onAddChild

onAddChild(child): any

Parameters

NameType
childObject3D

Returns

any

Inherited from

StaticAudio.onAddChild

Defined in

src/components/ComponentBase.ts:123


onRemoveChild

onRemoveChild(child): any

Parameters

NameType
childObject3D

Returns

any

Inherited from

StaticAudio.onRemoveChild

Defined in

src/components/ComponentBase.ts:124


cloneTo

cloneTo(obj): void

clone component data to target object3D

Parameters

NameTypeDescription
objObject3Dtarget object3D

Returns

void

Inherited from

StaticAudio.cloneTo

Defined in

src/components/ComponentBase.ts:131


copyComponent

copyComponent(from): this

Parameters

NameType
fromthis

Returns

this

Inherited from

StaticAudio.copyComponent

Defined in

src/components/ComponentBase.ts:133


beforeDestroy

beforeDestroy(force?): void

before release this component, object refrences are not be set null now.

Parameters

NameType
force?boolean

Returns

void

Inherited from

StaticAudio.beforeDestroy

Defined in

src/components/ComponentBase.ts:200

Released under the MIT License