@babylonjs/core 7.52.1 → 7.52.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AudioV2/abstractAudio/abstractAudioBus.d.ts +11 -0
- package/AudioV2/abstractAudio/abstractAudioBus.js +10 -0
- package/AudioV2/abstractAudio/abstractAudioBus.js.map +1 -1
- package/AudioV2/abstractAudio/abstractSound.d.ts +11 -5
- package/AudioV2/abstractAudio/abstractSound.js +11 -5
- package/AudioV2/abstractAudio/abstractSound.js.map +1 -1
- package/AudioV2/abstractAudio/audioBus.d.ts +5 -6
- package/AudioV2/abstractAudio/audioBus.js +1 -5
- package/AudioV2/abstractAudio/audioBus.js.map +1 -1
- package/AudioV2/abstractAudio/audioEngineV2.d.ts +1 -2
- package/AudioV2/abstractAudio/audioEngineV2.js +1 -5
- package/AudioV2/abstractAudio/audioEngineV2.js.map +1 -1
- package/AudioV2/abstractAudio/components/spatialAudioAttacherComponent.d.ts +43 -0
- package/AudioV2/abstractAudio/components/spatialAudioAttacherComponent.js +71 -0
- package/AudioV2/abstractAudio/components/spatialAudioAttacherComponent.js.map +1 -0
- package/AudioV2/abstractAudio/mainAudioBus.d.ts +2 -2
- package/AudioV2/abstractAudio/mainAudioBus.js.map +1 -1
- package/AudioV2/abstractAudio/staticSound.d.ts +6 -6
- package/AudioV2/abstractAudio/staticSound.js +5 -5
- package/AudioV2/abstractAudio/staticSound.js.map +1 -1
- package/AudioV2/abstractAudio/streamingSound.d.ts +2 -2
- package/AudioV2/abstractAudio/streamingSound.js +3 -3
- package/AudioV2/abstractAudio/streamingSound.js.map +1 -1
- package/AudioV2/abstractAudio/subNodes/abstractAudioSubGraph.d.ts +30 -6
- package/AudioV2/abstractAudio/subNodes/abstractAudioSubGraph.js +44 -21
- package/AudioV2/abstractAudio/subNodes/abstractAudioSubGraph.js.map +1 -1
- package/AudioV2/abstractAudio/subNodes/audioAnalyzerSubNode.d.ts +24 -0
- package/AudioV2/abstractAudio/subNodes/audioAnalyzerSubNode.js +30 -0
- package/AudioV2/abstractAudio/subNodes/audioAnalyzerSubNode.js.map +1 -0
- package/AudioV2/abstractAudio/subNodes/audioSubNode.d.ts +1 -0
- package/AudioV2/abstractAudio/subNodes/audioSubNode.js +1 -0
- package/AudioV2/abstractAudio/subNodes/audioSubNode.js.map +1 -1
- package/AudioV2/abstractAudio/subNodes/spatialAudioSubNode.d.ts +15 -0
- package/AudioV2/abstractAudio/subNodes/spatialAudioSubNode.js +38 -3
- package/AudioV2/abstractAudio/subNodes/spatialAudioSubNode.js.map +1 -1
- package/AudioV2/abstractAudio/subNodes/stereoAudioSubNode.js.map +1 -1
- package/AudioV2/abstractAudio/subProperties/abstractAudioAnalyzer.d.ts +86 -0
- package/AudioV2/abstractAudio/subProperties/abstractAudioAnalyzer.js +29 -0
- package/AudioV2/abstractAudio/subProperties/abstractAudioAnalyzer.js.map +1 -0
- package/AudioV2/abstractAudio/subProperties/abstractSpatialAudio.d.ts +29 -8
- package/AudioV2/abstractAudio/subProperties/abstractSpatialAudio.js +1 -0
- package/AudioV2/abstractAudio/subProperties/abstractSpatialAudio.js.map +1 -1
- package/AudioV2/abstractAudio/subProperties/abstractSpatialAudioListener.d.ts +28 -1
- package/AudioV2/abstractAudio/subProperties/abstractSpatialAudioListener.js +5 -1
- package/AudioV2/abstractAudio/subProperties/abstractSpatialAudioListener.js.map +1 -1
- package/AudioV2/abstractAudio/subProperties/audioAnalyzer.d.ts +35 -0
- package/AudioV2/abstractAudio/subProperties/audioAnalyzer.js +96 -0
- package/AudioV2/abstractAudio/subProperties/audioAnalyzer.js.map +1 -0
- package/AudioV2/abstractAudio/subProperties/index.d.ts +1 -0
- package/AudioV2/abstractAudio/subProperties/index.js +1 -0
- package/AudioV2/abstractAudio/subProperties/index.js.map +1 -1
- package/AudioV2/abstractAudio/subProperties/spatialAudio.d.ts +16 -1
- package/AudioV2/abstractAudio/subProperties/spatialAudio.js +48 -14
- package/AudioV2/abstractAudio/subProperties/spatialAudio.js.map +1 -1
- package/AudioV2/abstractAudio/subProperties/spatialAudioListener.d.ts +21 -0
- package/AudioV2/abstractAudio/subProperties/spatialAudioListener.js +39 -4
- package/AudioV2/abstractAudio/subProperties/spatialAudioListener.js.map +1 -1
- package/AudioV2/index.d.ts +1 -0
- package/AudioV2/index.js +1 -0
- package/AudioV2/index.js.map +1 -1
- package/AudioV2/spatialAudioAttachmentType.d.ts +5 -0
- package/AudioV2/spatialAudioAttachmentType.js +7 -0
- package/AudioV2/spatialAudioAttachmentType.js.map +1 -0
- package/AudioV2/webAudio/components/spatialWebAudioUpdaterComponent.d.ts +13 -0
- package/AudioV2/webAudio/components/spatialWebAudioUpdaterComponent.js +38 -0
- package/AudioV2/webAudio/components/spatialWebAudioUpdaterComponent.js.map +1 -0
- package/AudioV2/webAudio/subNodes/spatialWebAudioSubNode.d.ts +13 -14
- package/AudioV2/webAudio/subNodes/spatialWebAudioSubNode.js +39 -39
- package/AudioV2/webAudio/subNodes/spatialWebAudioSubNode.js.map +1 -1
- package/AudioV2/webAudio/subNodes/webAudioAnalyzerSubNode.d.ts +37 -0
- package/AudioV2/webAudio/subNodes/webAudioAnalyzerSubNode.js +85 -0
- package/AudioV2/webAudio/subNodes/webAudioAnalyzerSubNode.js.map +1 -0
- package/AudioV2/webAudio/subNodes/webAudioBaseSubGraph.d.ts +5 -3
- package/AudioV2/webAudio/subNodes/webAudioBaseSubGraph.js +25 -2
- package/AudioV2/webAudio/subNodes/webAudioBaseSubGraph.js.map +1 -1
- package/AudioV2/webAudio/subNodes/webAudioBusAndSoundSubGraph.d.ts +2 -1
- package/AudioV2/webAudio/subNodes/webAudioBusAndSoundSubGraph.js +32 -17
- package/AudioV2/webAudio/subNodes/webAudioBusAndSoundSubGraph.js.map +1 -1
- package/AudioV2/webAudio/subProperties/spatialWebAudio.d.ts +6 -2
- package/AudioV2/webAudio/subProperties/spatialWebAudio.js +13 -15
- package/AudioV2/webAudio/subProperties/spatialWebAudio.js.map +1 -1
- package/AudioV2/webAudio/subProperties/spatialWebAudioListener.d.ts +1 -1
- package/AudioV2/webAudio/subProperties/spatialWebAudioListener.js +41 -56
- package/AudioV2/webAudio/subProperties/spatialWebAudioListener.js.map +1 -1
- package/AudioV2/webAudio/webAudioBus.d.ts +3 -0
- package/AudioV2/webAudio/webAudioBus.js +23 -2
- package/AudioV2/webAudio/webAudioBus.js.map +1 -1
- package/AudioV2/webAudio/webAudioEngine.d.ts +3 -1
- package/AudioV2/webAudio/webAudioEngine.js +11 -3
- package/AudioV2/webAudio/webAudioEngine.js.map +1 -1
- package/AudioV2/webAudio/webAudioStaticSound.d.ts +3 -0
- package/AudioV2/webAudio/webAudioStaticSound.js +23 -2
- package/AudioV2/webAudio/webAudioStaticSound.js.map +1 -1
- package/AudioV2/webAudio/webAudioStreamingSound.d.ts +3 -0
- package/AudioV2/webAudio/webAudioStreamingSound.js +23 -2
- package/AudioV2/webAudio/webAudioStreamingSound.js.map +1 -1
- package/Engines/WebGPU/webgpuTextureManager.d.ts +0 -1
- package/Engines/WebGPU/webgpuTextureManager.js +2 -57
- package/Engines/WebGPU/webgpuTextureManager.js.map +1 -1
- package/Engines/abstractEngine.d.ts +6 -0
- package/Engines/abstractEngine.js +3 -3
- package/Engines/abstractEngine.js.map +1 -1
- package/Engines/engine.common.js +4 -0
- package/Engines/engine.common.js.map +1 -1
- package/Engines/nativeEngine.d.ts +1 -0
- package/Engines/nativeEngine.js +3 -0
- package/Engines/nativeEngine.js.map +1 -1
- package/Engines/nullEngine.d.ts +1 -0
- package/Engines/nullEngine.js +1 -0
- package/Engines/nullEngine.js.map +1 -1
- package/Engines/thinEngine.d.ts +1 -0
- package/Engines/thinEngine.js +7 -4
- package/Engines/thinEngine.js.map +1 -1
- package/Engines/webgpuEngine.d.ts +2 -1
- package/Engines/webgpuEngine.js +12 -9
- package/Engines/webgpuEngine.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphDataSwitchBlock.d.ts +48 -0
- package/FlowGraph/Blocks/Data/flowGraphDataSwitchBlock.js +54 -0
- package/FlowGraph/Blocks/Data/flowGraphDataSwitchBlock.js.map +1 -0
- package/FlowGraph/Blocks/Data/index.d.ts +1 -0
- package/FlowGraph/Blocks/Data/index.js +1 -0
- package/FlowGraph/Blocks/Data/index.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.d.ts +1 -0
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.js +19 -13
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.js +3 -5
- package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCancelDelayBlock.js +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCancelDelayBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSetDelayBlock.js +2 -4
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSetDelayBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.js +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.js +1 -2
- package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.js.map +1 -1
- package/FlowGraph/Blocks/flowGraphBlockFactory.js +2 -0
- package/FlowGraph/Blocks/flowGraphBlockFactory.js.map +1 -1
- package/FlowGraph/Blocks/flowGraphBlockNames.d.ts +2 -1
- package/FlowGraph/Blocks/flowGraphBlockNames.js +1 -0
- package/FlowGraph/Blocks/flowGraphBlockNames.js.map +1 -1
- package/FlowGraph/CustomTypes/flowGraphInteger.d.ts +1 -0
- package/FlowGraph/CustomTypes/flowGraphInteger.js +3 -0
- package/FlowGraph/CustomTypes/flowGraphInteger.js.map +1 -1
- package/FlowGraph/CustomTypes/flowGraphMatrix.d.ts +2 -0
- package/FlowGraph/CustomTypes/flowGraphMatrix.js +6 -0
- package/FlowGraph/CustomTypes/flowGraphMatrix.js.map +1 -1
- package/FlowGraph/flowGraphExecutionBlock.d.ts +1 -0
- package/FlowGraph/flowGraphExecutionBlock.js +4 -0
- package/FlowGraph/flowGraphExecutionBlock.js.map +1 -1
- package/FlowGraph/utils.d.ts +2 -1
- package/FlowGraph/utils.js +7 -2
- package/FlowGraph/utils.js.map +1 -1
- package/FrameGraph/Node/Blocks/PostProcesses/bloomPostProcessBlock.js +2 -2
- package/FrameGraph/Node/Blocks/PostProcesses/bloomPostProcessBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/PostProcesses/depthOfFieldPostProcessBlock.js +2 -2
- package/FrameGraph/Node/Blocks/PostProcesses/depthOfFieldPostProcessBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/PostProcesses/ssrPostProcessBlock.d.ts +126 -0
- package/FrameGraph/Node/Blocks/PostProcesses/ssrPostProcessBlock.js +497 -0
- package/FrameGraph/Node/Blocks/PostProcesses/ssrPostProcessBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.d.ts +6 -0
- package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.js +30 -4
- package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/index.d.ts +1 -0
- package/FrameGraph/Node/Blocks/index.js +1 -0
- package/FrameGraph/Node/Blocks/index.js.map +1 -1
- package/FrameGraph/Node/nodeRenderGraph.js +1 -1
- package/FrameGraph/Node/nodeRenderGraph.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/bloomTask.d.ts +2 -3
- package/FrameGraph/Tasks/PostProcesses/bloomTask.js +3 -4
- package/FrameGraph/Tasks/PostProcesses/bloomTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/blurTask.js +2 -2
- package/FrameGraph/Tasks/PostProcesses/blurTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldTask.d.ts +2 -3
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldTask.js +4 -5
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/postProcessTask.d.ts +6 -0
- package/FrameGraph/Tasks/PostProcesses/postProcessTask.js +14 -0
- package/FrameGraph/Tasks/PostProcesses/postProcessTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/ssrBlurTask.d.ts +11 -0
- package/FrameGraph/Tasks/PostProcesses/ssrBlurTask.js +18 -0
- package/FrameGraph/Tasks/PostProcesses/ssrBlurTask.js.map +1 -0
- package/FrameGraph/Tasks/PostProcesses/ssrRenderingPipelineTask.d.ts +76 -0
- package/FrameGraph/Tasks/PostProcesses/ssrRenderingPipelineTask.js +170 -0
- package/FrameGraph/Tasks/PostProcesses/ssrRenderingPipelineTask.js.map +1 -0
- package/FrameGraph/Tasks/PostProcesses/ssrTask.d.ts +16 -0
- package/FrameGraph/Tasks/PostProcesses/ssrTask.js +45 -0
- package/FrameGraph/Tasks/PostProcesses/ssrTask.js.map +1 -0
- package/FrameGraph/Tasks/Rendering/geometryRendererTask.d.ts +10 -0
- package/FrameGraph/Tasks/Rendering/geometryRendererTask.js +29 -0
- package/FrameGraph/Tasks/Rendering/geometryRendererTask.js.map +1 -1
- package/FrameGraph/frameGraph.d.ts +7 -3
- package/FrameGraph/frameGraph.js +10 -4
- package/FrameGraph/frameGraph.js.map +1 -1
- package/FrameGraph/frameGraphTextureManager.d.ts +2 -1
- package/FrameGraph/frameGraphTextureManager.js +4 -3
- package/FrameGraph/frameGraphTextureManager.js.map +1 -1
- package/FrameGraph/index.d.ts +1 -0
- package/FrameGraph/index.js +1 -0
- package/FrameGraph/index.js.map +1 -1
- package/Materials/PBR/pbrBaseMaterial.js +1 -1
- package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
- package/Materials/effectRenderer.js +1 -1
- package/Materials/effectRenderer.js.map +1 -1
- package/Materials/material.js +5 -3
- package/Materials/material.js.map +1 -1
- package/Materials/materialHelper.geometryrendering.d.ts +7 -5
- package/Materials/materialHelper.geometryrendering.js +8 -3
- package/Materials/materialHelper.geometryrendering.js.map +1 -1
- package/Materials/standardMaterial.js +1 -1
- package/Materials/standardMaterial.js.map +1 -1
- package/Meshes/geometry.js +18 -7
- package/Meshes/geometry.js.map +1 -1
- package/Meshes/mesh.vertexData.d.ts +1 -1
- package/Meshes/mesh.vertexData.js +2 -1
- package/Meshes/mesh.vertexData.js.map +1 -1
- package/Particles/particleSystemComponent.d.ts +2 -1
- package/Particles/particleSystemComponent.js +2 -2
- package/Particles/particleSystemComponent.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/ssrRenderingPipeline.d.ts +23 -30
- package/PostProcesses/RenderPipeline/Pipelines/ssrRenderingPipeline.js +226 -411
- package/PostProcesses/RenderPipeline/Pipelines/ssrRenderingPipeline.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/thinSSRRenderingPipeline.d.ts +222 -0
- package/PostProcesses/RenderPipeline/Pipelines/thinSSRRenderingPipeline.js +373 -0
- package/PostProcesses/RenderPipeline/Pipelines/thinSSRRenderingPipeline.js.map +1 -0
- package/PostProcesses/thinDepthOfFieldEffect.d.ts +4 -4
- package/PostProcesses/thinDepthOfFieldEffect.js.map +1 -1
- package/PostProcesses/thinSSRBlurCombinerPostProcess.d.ts +41 -0
- package/PostProcesses/thinSSRBlurCombinerPostProcess.js +185 -0
- package/PostProcesses/thinSSRBlurCombinerPostProcess.js.map +1 -0
- package/PostProcesses/thinSSRBlurPostProcess.d.ts +18 -0
- package/PostProcesses/thinSSRBlurPostProcess.js +47 -0
- package/PostProcesses/thinSSRBlurPostProcess.js.map +1 -0
- package/PostProcesses/thinSSRPostProcess.d.ts +94 -0
- package/PostProcesses/thinSSRPostProcess.js +416 -0
- package/PostProcesses/thinSSRPostProcess.js.map +1 -0
- package/Rendering/IBLShadows/iblShadowsRenderPipeline.d.ts +2 -0
- package/Rendering/IBLShadows/iblShadowsRenderPipeline.js +2 -0
- package/Rendering/IBLShadows/iblShadowsRenderPipeline.js.map +1 -1
- package/Rendering/iblCdfGenerator.js +1 -1
- package/Rendering/iblCdfGenerator.js.map +1 -1
- package/Shaders/screenSpaceReflection2BlurCombiner.fragment.js +13 -2
- package/Shaders/screenSpaceReflection2BlurCombiner.fragment.js.map +1 -1
- package/ShadersWGSL/geometry.fragment.js +1 -1
- package/ShadersWGSL/geometry.fragment.js.map +1 -1
- package/ShadersWGSL/screenSpaceReflection2BlurCombiner.fragment.js +13 -2
- package/ShadersWGSL/screenSpaceReflection2BlurCombiner.fragment.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spatialAudioSubNode.js","sourceRoot":"","sources":["../../../../../../dev/core/src/AudioV2/abstractAudio/subNodes/spatialAudioSubNode.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"spatialAudioSubNode.js","sourceRoot":"","sources":["../../../../../../dev/core/src/AudioV2/abstractAudio/subNodes/spatialAudioSubNode.ts"],"names":[],"mappings":"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","sourcesContent":["import type { Quaternion, Vector3 } from \"../../../Maths/math.vector\";\nimport type { Node } from \"../../../node\";\nimport type { Nullable } from \"../../../types\";\nimport type { SpatialAudioAttachmentType } from \"../../spatialAudioAttachmentType\";\nimport type { AudioEngineV2 } from \"../audioEngineV2\";\nimport { _SpatialAudioAttacherComponent } from \"../components/spatialAudioAttacherComponent\";\nimport type { ISpatialAudioOptions } from \"../subProperties/abstractSpatialAudio\";\nimport { _SpatialAudioDefaults } from \"../subProperties/abstractSpatialAudio\";\nimport type { _AbstractAudioSubGraph } from \"./abstractAudioSubGraph\";\nimport { _AbstractAudioSubNode } from \"./abstractAudioSubNode\";\nimport { AudioSubNode } from \"./audioSubNode\";\n\n/** @internal */\nexport abstract class _SpatialAudioSubNode extends _AbstractAudioSubNode {\n private _attacherComponent: Nullable<_SpatialAudioAttacherComponent> = null;\n\n protected constructor(engine: AudioEngineV2) {\n super(AudioSubNode.SPATIAL, engine);\n }\n\n public abstract coneInnerAngle: number;\n public abstract coneOuterAngle: number;\n public abstract coneOuterVolume: number;\n public abstract distanceModel: DistanceModelType;\n public abstract maxDistance: number;\n public abstract panningModel: PanningModelType;\n public abstract position: Vector3;\n public abstract referenceDistance: number;\n public abstract rolloffFactor: number;\n public abstract rotation: Vector3;\n public abstract rotationQuaternion: Quaternion;\n public abstract inNode: AudioNode;\n\n /** @internal */\n public get isAttached(): boolean {\n return this._attacherComponent !== null && this._attacherComponent.isAttached;\n }\n\n /** @internal */\n public attach(sceneNode: Node, useBoundingBox: boolean, attachmentType: SpatialAudioAttachmentType): void {\n this.detach();\n\n if (!this._attacherComponent) {\n this._attacherComponent = new _SpatialAudioAttacherComponent(this);\n }\n\n this._attacherComponent.attach(sceneNode, useBoundingBox, attachmentType);\n }\n\n /** @internal */\n public detach(): void {\n this._attacherComponent?.detach();\n }\n\n /** @internal */\n public override dispose(): void {\n super.dispose();\n\n this._attacherComponent?.dispose();\n this._attacherComponent = null;\n }\n\n /** @internal */\n public setOptions(options: Partial<ISpatialAudioOptions>): void {\n this.coneInnerAngle = options.spatialConeInnerAngle ?? _SpatialAudioDefaults.coneInnerAngle;\n this.coneOuterAngle = options.spatialConeOuterAngle ?? _SpatialAudioDefaults.coneOuterAngle;\n this.coneOuterVolume = options.spatialConeOuterVolume ?? _SpatialAudioDefaults.coneOuterVolume;\n this.distanceModel = options.spatialDistanceModel ?? _SpatialAudioDefaults.distanceModel;\n this.maxDistance = options.spatialMaxDistance ?? _SpatialAudioDefaults.maxDistance;\n this.panningModel = options.spatialPanningModel ?? _SpatialAudioDefaults.panningModel;\n this.referenceDistance = options.spatialReferenceDistance ?? _SpatialAudioDefaults.referenceDistance;\n this.rolloffFactor = options.spatialRolloffFactor ?? _SpatialAudioDefaults.rolloffFactor;\n\n if (options.spatialPosition) {\n this.position = options.spatialPosition.clone();\n }\n\n if (options.spatialRotationQuaternion) {\n this.rotationQuaternion = options.spatialRotationQuaternion.clone();\n } else if (options.spatialRotation) {\n this.rotation = options.spatialRotation.clone();\n } else {\n this.rotationQuaternion = _SpatialAudioDefaults.rotationQuaternion.clone();\n }\n\n this.update();\n }\n\n /** @internal */\n public update(): void {\n if (this.isAttached) {\n this._attacherComponent?.update();\n } else {\n this.updatePosition();\n this.updateRotation();\n }\n }\n\n public abstract updatePosition(): void;\n public abstract updateRotation(): void;\n}\n\n/** @internal */\nexport function _GetSpatialAudioSubNode(subGraph: _AbstractAudioSubGraph): Nullable<_SpatialAudioSubNode> {\n return subGraph.getSubNode<_SpatialAudioSubNode>(AudioSubNode.SPATIAL);\n}\n\n/** @internal */\nexport function _GetSpatialAudioProperty<K extends keyof typeof _SpatialAudioDefaults>(subGraph: _AbstractAudioSubGraph, property: K): (typeof _SpatialAudioDefaults)[K] {\n return _GetSpatialAudioSubNode(subGraph)?.[property] ?? _SpatialAudioDefaults[property];\n}\n\n/** @internal */\nexport function _SetSpatialAudioProperty<K extends keyof typeof _SpatialAudioDefaults>(subGraph: _AbstractAudioSubGraph, property: K, value: _SpatialAudioSubNode[K]): void {\n subGraph.callOnSubNode<_SpatialAudioSubNode>(AudioSubNode.SPATIAL, (node) => {\n node[property] = value;\n });\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stereoAudioSubNode.js","sourceRoot":"","sources":["../../../../../../dev/core/src/AudioV2/abstractAudio/subNodes/stereoAudioSubNode.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAE,MAAM,mDAAmD,CAAC;AAG1F,OAAO,EAAE,oBAAoB,EAAE,MAAM,uDAAuD,CAAC;AAG7F,gBAAgB;AAChB,MAAM,OAAgB,mBAAoB,SAAQ,qBAAqB;IACnE,YAAsB,MAAqB;QACvC,KAAK,qCAAsB,MAAM,CAAC,CAAC;IACvC,CAAC;IAID,gBAAgB;IACT,UAAU,CAAC,OAAqC;QACnD,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,SAAS,IAAI,oBAAoB,CAAC,GAAG,CAAC;IAC7D,CAAC;CACJ;AAED,gBAAgB;AAChB,MAAM,UAAU,sBAAsB,CAAC,QAAgC;IACnE,OAAO,QAAQ,CAAC,UAAU,oCAA0C,CAAC;AACzE,CAAC;AAED,gBAAgB;AAChB,MAAM,UAAU,uBAAuB,CAA8C,QAAgC,EAAE,QAAW;IAC9H,OAAO,sBAAsB,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,oBAAoB,CAAC,QAAQ,CAAC,CAAC;AAC1F,CAAC;AAED,gBAAgB;AAChB,MAAM,UAAU,uBAAuB,CAA8C,QAAgC,EAAE,QAAW,EAAE,KAA6B;IAC7J,QAAQ,CAAC,aAAa,qCAA2C,CAAC,IAAI,EAAE,EAAE;QACtE,IAAI,CAAC,QAAQ,CAAC,GAAG,KAAK,CAAC;IAC3B,CAAC,CAAC,CAAC;AACP,CAAC","sourcesContent":["import type { Nullable } from \"../../../types\";\nimport type { AudioEngineV2 } from \"../../abstractAudio/audioEngineV2\";\nimport { _AbstractAudioSubNode } from \"../../abstractAudio/subNodes/abstractAudioSubNode\";\nimport { AudioSubNode } from \"../../abstractAudio/subNodes/audioSubNode\";\nimport type { IStereoAudioOptions } from \"../../abstractAudio/subProperties/abstractStereoAudio\";\nimport { _StereoAudioDefaults } from \"../../abstractAudio/subProperties/abstractStereoAudio\";\nimport type { _AbstractAudioSubGraph } from \"./abstractAudioSubGraph\";\n\n/** @internal */\nexport abstract class _StereoAudioSubNode extends _AbstractAudioSubNode {\n protected constructor(engine: AudioEngineV2) {\n super(AudioSubNode.STEREO, engine);\n }\n\n abstract pan: number;\n\n /** @internal */\n public setOptions(options: Partial<IStereoAudioOptions>): void {\n this.pan = options.stereoPan ?? _StereoAudioDefaults.pan;\n }\n}\n\n/** @internal */\nexport function _GetStereoAudioSubNode(subGraph: _AbstractAudioSubGraph): Nullable<_StereoAudioSubNode> {\n return subGraph.getSubNode<_StereoAudioSubNode>(AudioSubNode.STEREO);\n}\n\n/** @internal */\nexport function _GetStereoAudioProperty<K extends keyof typeof _StereoAudioDefaults>(subGraph: _AbstractAudioSubGraph, property: K): (typeof _StereoAudioDefaults)[K] {\n return _GetStereoAudioSubNode(subGraph)?.[property] ?? _StereoAudioDefaults[property];\n}\n\n/** @internal */\nexport function _SetStereoAudioProperty<K extends keyof typeof _StereoAudioDefaults>(subGraph: _AbstractAudioSubGraph, property: K, value: _StereoAudioSubNode[K]): void {\n subGraph.callOnSubNode<_StereoAudioSubNode>(AudioSubNode.STEREO, (node) => {\n node[property] = value;\n });\n}\n"]}
|
|
1
|
+
{"version":3,"file":"stereoAudioSubNode.js","sourceRoot":"","sources":["../../../../../../dev/core/src/AudioV2/abstractAudio/subNodes/stereoAudioSubNode.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAE,MAAM,mDAAmD,CAAC;AAG1F,OAAO,EAAE,oBAAoB,EAAE,MAAM,uDAAuD,CAAC;AAG7F,gBAAgB;AAChB,MAAM,OAAgB,mBAAoB,SAAQ,qBAAqB;IACnE,YAAsB,MAAqB;QACvC,KAAK,qCAAsB,MAAM,CAAC,CAAC;IACvC,CAAC;IAID,gBAAgB;IACT,UAAU,CAAC,OAAqC;QACnD,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,SAAS,IAAI,oBAAoB,CAAC,GAAG,CAAC;IAC7D,CAAC;CACJ;AAED,gBAAgB;AAChB,MAAM,UAAU,sBAAsB,CAAC,QAAgC;IACnE,OAAO,QAAQ,CAAC,UAAU,oCAA0C,CAAC;AACzE,CAAC;AAED,gBAAgB;AAChB,MAAM,UAAU,uBAAuB,CAA8C,QAAgC,EAAE,QAAW;IAC9H,OAAO,sBAAsB,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,oBAAoB,CAAC,QAAQ,CAAC,CAAC;AAC1F,CAAC;AAED,gBAAgB;AAChB,MAAM,UAAU,uBAAuB,CAA8C,QAAgC,EAAE,QAAW,EAAE,KAA6B;IAC7J,QAAQ,CAAC,aAAa,qCAA2C,CAAC,IAAI,EAAE,EAAE;QACtE,IAAI,CAAC,QAAQ,CAAC,GAAG,KAAK,CAAC;IAC3B,CAAC,CAAC,CAAC;AACP,CAAC","sourcesContent":["import type { Nullable } from \"../../../types\";\nimport type { AudioEngineV2 } from \"../../abstractAudio/audioEngineV2\";\nimport { _AbstractAudioSubNode } from \"../../abstractAudio/subNodes/abstractAudioSubNode\";\nimport { AudioSubNode } from \"../../abstractAudio/subNodes/audioSubNode\";\nimport type { IStereoAudioOptions } from \"../../abstractAudio/subProperties/abstractStereoAudio\";\nimport { _StereoAudioDefaults } from \"../../abstractAudio/subProperties/abstractStereoAudio\";\nimport type { _AbstractAudioSubGraph } from \"./abstractAudioSubGraph\";\n\n/** @internal */\nexport abstract class _StereoAudioSubNode extends _AbstractAudioSubNode {\n protected constructor(engine: AudioEngineV2) {\n super(AudioSubNode.STEREO, engine);\n }\n\n public abstract pan: number;\n\n /** @internal */\n public setOptions(options: Partial<IStereoAudioOptions>): void {\n this.pan = options.stereoPan ?? _StereoAudioDefaults.pan;\n }\n}\n\n/** @internal */\nexport function _GetStereoAudioSubNode(subGraph: _AbstractAudioSubGraph): Nullable<_StereoAudioSubNode> {\n return subGraph.getSubNode<_StereoAudioSubNode>(AudioSubNode.STEREO);\n}\n\n/** @internal */\nexport function _GetStereoAudioProperty<K extends keyof typeof _StereoAudioDefaults>(subGraph: _AbstractAudioSubGraph, property: K): (typeof _StereoAudioDefaults)[K] {\n return _GetStereoAudioSubNode(subGraph)?.[property] ?? _StereoAudioDefaults[property];\n}\n\n/** @internal */\nexport function _SetStereoAudioProperty<K extends keyof typeof _StereoAudioDefaults>(subGraph: _AbstractAudioSubGraph, property: K, value: _StereoAudioSubNode[K]): void {\n subGraph.callOnSubNode<_StereoAudioSubNode>(AudioSubNode.STEREO, (node) => {\n node[property] = value;\n });\n}\n"]}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
export type AudioAnalyzerFFTSizeType = 32 | 64 | 128 | 256 | 512 | 1024 | 2048 | 4096 | 8192 | 16384 | 32768;
|
|
2
|
+
export declare const _AudioAnalyzerDefaults: {
|
|
3
|
+
readonly fftSize: AudioAnalyzerFFTSizeType;
|
|
4
|
+
readonly minDecibels: number;
|
|
5
|
+
readonly maxDecibels: number;
|
|
6
|
+
readonly smoothing: number;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Options for the AudioAnalyzer
|
|
10
|
+
*/
|
|
11
|
+
export interface IAudioAnalyzerOptions {
|
|
12
|
+
/**
|
|
13
|
+
* Enable the audio analyzer. Defaults to false.
|
|
14
|
+
*/
|
|
15
|
+
analyzerEnabled: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* The size of the FFT (fast fourier transform) to use when converting time-domain data to frequency-domain data. Default is 2048.
|
|
18
|
+
*/
|
|
19
|
+
analyzerFFTSize: AudioAnalyzerFFTSizeType;
|
|
20
|
+
/**
|
|
21
|
+
* The minimum decibel value for the range of the analyzer. Default is -100.
|
|
22
|
+
*/
|
|
23
|
+
analyzerMinDecibels: number;
|
|
24
|
+
/**
|
|
25
|
+
* The maximum decibel value for the range of the analyzer. Default is -30.
|
|
26
|
+
*/
|
|
27
|
+
analyzerMaxDecibels: number;
|
|
28
|
+
/**
|
|
29
|
+
* A number between 0 and 1 that determines how quickly the analyzer's value changes. Default is 0.8.
|
|
30
|
+
*/
|
|
31
|
+
analyzerSmoothing: number;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* @param options The audio analyzer options to check.
|
|
35
|
+
* @returns `true` if audio analyzer options are defined, otherwise `false`.
|
|
36
|
+
*/
|
|
37
|
+
export declare function _HasAudioAnalyzerOptions(options: Partial<IAudioAnalyzerOptions>): boolean;
|
|
38
|
+
/**
|
|
39
|
+
* An AudioAnalyzer converts time-domain audio data into the frequency-domain.
|
|
40
|
+
*/
|
|
41
|
+
export declare abstract class AbstractAudioAnalyzer {
|
|
42
|
+
/**
|
|
43
|
+
* The size of the FFT (fast fourier transform) to use when converting time-domain data to frequency-domain data. Default is 2048.
|
|
44
|
+
*/
|
|
45
|
+
abstract fftSize: AudioAnalyzerFFTSizeType;
|
|
46
|
+
/**
|
|
47
|
+
* The number of data values that will be returned when calling getByteFrequencyData() or getFloatFrequencyData(). This is always half the `fftSize`.
|
|
48
|
+
*/
|
|
49
|
+
get frequencyBinCount(): number;
|
|
50
|
+
/**
|
|
51
|
+
* Whether the analyzer is enabled or not.
|
|
52
|
+
* - The `getByteFrequencyData` and `getFloatFrequencyData` functions return `null` if the analyzer is not enabled.
|
|
53
|
+
* @see {@link enable}
|
|
54
|
+
*/
|
|
55
|
+
abstract isEnabled: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* The minimum decibel value for the range of the analyzer. Default is -100.
|
|
58
|
+
*/
|
|
59
|
+
abstract minDecibels: number;
|
|
60
|
+
/**
|
|
61
|
+
* The maximum decibel value for the range of the analyzer. Default is -30.
|
|
62
|
+
*/
|
|
63
|
+
abstract maxDecibels: number;
|
|
64
|
+
/**
|
|
65
|
+
* A number between 0 and 1 that determines how quickly the analyzer's value changes. Default is 0.8.
|
|
66
|
+
*/
|
|
67
|
+
abstract smoothing: number;
|
|
68
|
+
/**
|
|
69
|
+
* Releases associated resources.
|
|
70
|
+
*/
|
|
71
|
+
abstract dispose(): void;
|
|
72
|
+
/**
|
|
73
|
+
* Enables the analyzer
|
|
74
|
+
*/
|
|
75
|
+
abstract enable(): Promise<void>;
|
|
76
|
+
/**
|
|
77
|
+
* Gets the current frequency data as a byte array
|
|
78
|
+
* @returns a Uint8Array if the analyzer is enabled, otherwise `null`
|
|
79
|
+
*/
|
|
80
|
+
abstract getByteFrequencyData(): Uint8Array;
|
|
81
|
+
/**
|
|
82
|
+
* Gets the current frequency data as a float array
|
|
83
|
+
* @returns a Float32Array if the analyzer is enabled, otherwise `null`
|
|
84
|
+
*/
|
|
85
|
+
abstract getFloatFrequencyData(): Float32Array;
|
|
86
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export const _AudioAnalyzerDefaults = {
|
|
2
|
+
fftSize: 2048,
|
|
3
|
+
minDecibels: -100,
|
|
4
|
+
maxDecibels: -30,
|
|
5
|
+
smoothing: 0.8,
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* @param options The audio analyzer options to check.
|
|
9
|
+
* @returns `true` if audio analyzer options are defined, otherwise `false`.
|
|
10
|
+
*/
|
|
11
|
+
export function _HasAudioAnalyzerOptions(options) {
|
|
12
|
+
return (options.analyzerEnabled ||
|
|
13
|
+
options.analyzerFFTSize !== undefined ||
|
|
14
|
+
options.analyzerMinDecibels !== undefined ||
|
|
15
|
+
options.analyzerMaxDecibels !== undefined ||
|
|
16
|
+
options.analyzerSmoothing !== undefined);
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* An AudioAnalyzer converts time-domain audio data into the frequency-domain.
|
|
20
|
+
*/
|
|
21
|
+
export class AbstractAudioAnalyzer {
|
|
22
|
+
/**
|
|
23
|
+
* The number of data values that will be returned when calling getByteFrequencyData() or getFloatFrequencyData(). This is always half the `fftSize`.
|
|
24
|
+
*/
|
|
25
|
+
get frequencyBinCount() {
|
|
26
|
+
return this.fftSize / 2;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=abstractAudioAnalyzer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"abstractAudioAnalyzer.js","sourceRoot":"","sources":["../../../../../../dev/core/src/AudioV2/abstractAudio/subProperties/abstractAudioAnalyzer.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,sBAAsB,GAAG;IAClC,OAAO,EAAE,IAAgC;IACzC,WAAW,EAAE,CAAC,GAAa;IAC3B,WAAW,EAAE,CAAC,EAAY;IAC1B,SAAS,EAAE,GAAa;CAClB,CAAC;AA+BX;;;GAGG;AACH,MAAM,UAAU,wBAAwB,CAAC,OAAuC;IAC5E,OAAO,CACH,OAAO,CAAC,eAAe;QACvB,OAAO,CAAC,eAAe,KAAK,SAAS;QACrC,OAAO,CAAC,mBAAmB,KAAK,SAAS;QACzC,OAAO,CAAC,mBAAmB,KAAK,SAAS;QACzC,OAAO,CAAC,iBAAiB,KAAK,SAAS,CAC1C,CAAC;AACN,CAAC;AAED;;GAEG;AACH,MAAM,OAAgB,qBAAqB;IAMvC;;OAEG;IACH,IAAW,iBAAiB;QACxB,OAAO,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC;IAC5B,CAAC;CA6CJ","sourcesContent":["export type AudioAnalyzerFFTSizeType = 32 | 64 | 128 | 256 | 512 | 1024 | 2048 | 4096 | 8192 | 16384 | 32768;\n\nexport const _AudioAnalyzerDefaults = {\n fftSize: 2048 as AudioAnalyzerFFTSizeType,\n minDecibels: -100 as number,\n maxDecibels: -30 as number,\n smoothing: 0.8 as number,\n} as const;\n\n/**\n * Options for the AudioAnalyzer\n */\nexport interface IAudioAnalyzerOptions {\n /**\n * Enable the audio analyzer. Defaults to false.\n */\n analyzerEnabled: boolean;\n /**\n * The size of the FFT (fast fourier transform) to use when converting time-domain data to frequency-domain data. Default is 2048.\n */\n analyzerFFTSize: AudioAnalyzerFFTSizeType;\n\n /**\n * The minimum decibel value for the range of the analyzer. Default is -100.\n */\n analyzerMinDecibels: number;\n\n /**\n * The maximum decibel value for the range of the analyzer. Default is -30.\n */\n analyzerMaxDecibels: number;\n\n /**\n * A number between 0 and 1 that determines how quickly the analyzer's value changes. Default is 0.8.\n */\n analyzerSmoothing: number;\n}\n\n/**\n * @param options The audio analyzer options to check.\n * @returns `true` if audio analyzer options are defined, otherwise `false`.\n */\nexport function _HasAudioAnalyzerOptions(options: Partial<IAudioAnalyzerOptions>): boolean {\n return (\n options.analyzerEnabled ||\n options.analyzerFFTSize !== undefined ||\n options.analyzerMinDecibels !== undefined ||\n options.analyzerMaxDecibels !== undefined ||\n options.analyzerSmoothing !== undefined\n );\n}\n\n/**\n * An AudioAnalyzer converts time-domain audio data into the frequency-domain.\n */\nexport abstract class AbstractAudioAnalyzer {\n /**\n * The size of the FFT (fast fourier transform) to use when converting time-domain data to frequency-domain data. Default is 2048.\n */\n public abstract fftSize: AudioAnalyzerFFTSizeType;\n\n /**\n * The number of data values that will be returned when calling getByteFrequencyData() or getFloatFrequencyData(). This is always half the `fftSize`.\n */\n public get frequencyBinCount(): number {\n return this.fftSize / 2;\n }\n\n /**\n * Whether the analyzer is enabled or not.\n * - The `getByteFrequencyData` and `getFloatFrequencyData` functions return `null` if the analyzer is not enabled.\n * @see {@link enable}\n */\n public abstract isEnabled: boolean;\n\n /**\n * The minimum decibel value for the range of the analyzer. Default is -100.\n */\n public abstract minDecibels: number;\n\n /**\n * The maximum decibel value for the range of the analyzer. Default is -30.\n */\n public abstract maxDecibels: number;\n\n /**\n * A number between 0 and 1 that determines how quickly the analyzer's value changes. Default is 0.8.\n */\n public abstract smoothing: number;\n\n /**\n * Releases associated resources.\n */\n public abstract dispose(): void;\n\n /**\n * Enables the analyzer\n */\n public abstract enable(): Promise<void>;\n\n /**\n * Gets the current frequency data as a byte array\n * @returns a Uint8Array if the analyzer is enabled, otherwise `null`\n */\n public abstract getByteFrequencyData(): Uint8Array;\n\n /**\n * Gets the current frequency data as a float array\n * @returns a Float32Array if the analyzer is enabled, otherwise `null`\n */\n public abstract getFloatFrequencyData(): Float32Array;\n}\n"]}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { Quaternion, Vector3 } from "../../../Maths/math.vector";
|
|
2
|
+
import type { Node } from "../../../node";
|
|
3
|
+
import type { SpatialAudioAttachmentType } from "../../spatialAudioAttachmentType";
|
|
2
4
|
export declare const _SpatialAudioDefaults: {
|
|
3
5
|
readonly coneInnerAngle: number;
|
|
4
6
|
readonly coneOuterAngle: number;
|
|
@@ -67,13 +69,14 @@ export interface ISpatialAudioOptions {
|
|
|
67
69
|
*/
|
|
68
70
|
spatialMaxDistance: number;
|
|
69
71
|
/**
|
|
70
|
-
* The
|
|
71
|
-
* -
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
* The minimum update time in seconds of the spatialization if it is attached to a mesh or transform node. Defaults to `0`.
|
|
73
|
+
* - The spatialization's position and rotation will not update faster than this time, but they may update slower depending on the frame rate.
|
|
74
|
+
*/
|
|
75
|
+
spatialMinUpdateTime: number;
|
|
76
|
+
/**
|
|
74
77
|
* Possible values are:
|
|
75
78
|
* - `"equalpower"`: Represents the equal-power panning algorithm, generally regarded as simple and efficient.
|
|
76
|
-
* - `"HRTF"`:Renders a stereo output of higher quality than `"equalpower"` — it uses a convolution with measured impulse responses from human subjects.
|
|
79
|
+
* - `"HRTF"`: Renders a stereo output of higher quality than `"equalpower"` — it uses a convolution with measured impulse responses from human subjects.
|
|
77
80
|
*/
|
|
78
81
|
spatialPanningModel: "equalpower" | "HRTF";
|
|
79
82
|
/**
|
|
@@ -140,16 +143,23 @@ export declare abstract class AbstractSpatialAudio {
|
|
|
140
143
|
* @see {@link spatialRolloffFactor}
|
|
141
144
|
*/
|
|
142
145
|
abstract distanceModel: "linear" | "inverse" | "exponential";
|
|
146
|
+
/**
|
|
147
|
+
* Whether the audio source is attached to a mesh or transform node.
|
|
148
|
+
*/
|
|
149
|
+
abstract isAttached: boolean;
|
|
143
150
|
/**
|
|
144
151
|
* The maximum distance between the audio source and the listener, after which the volume is not reduced any further. Defaults to 10000.
|
|
145
152
|
* - This value is used only when the {@link distanceModel} is set to `"linear"`.
|
|
146
153
|
* @see {@link distanceModel}
|
|
147
154
|
*/
|
|
148
155
|
abstract maxDistance: number;
|
|
156
|
+
/**
|
|
157
|
+
* The minimum update time in seconds of the spatialization if it is attached to a mesh or transform node. Defaults to `0`.
|
|
158
|
+
* - The spatialization's position and rotation will not update faster than this time, but they may update slower depending on the frame rate.
|
|
159
|
+
*/
|
|
160
|
+
abstract minUpdateTime: number;
|
|
149
161
|
/**
|
|
150
162
|
* The spatial panning model. Defaults to "equalpower".
|
|
151
|
-
* - "equalpower" requires less CPU than "HRTF" but is less realistic for listeners with headphones or speakers close to the ears.
|
|
152
|
-
* - "HRTF" requires more CPU but is more realistic for listeners with headphones or speakers close to the ears.
|
|
153
163
|
*
|
|
154
164
|
* Possible values are:
|
|
155
165
|
* - `"equalpower"`: Represents the equal-power panning algorithm, generally regarded as simple and efficient.
|
|
@@ -181,7 +191,18 @@ export declare abstract class AbstractSpatialAudio {
|
|
|
181
191
|
*/
|
|
182
192
|
abstract rotationQuaternion: Quaternion;
|
|
183
193
|
/**
|
|
184
|
-
*
|
|
194
|
+
* Attaches the audio source to a scene object.
|
|
195
|
+
* @param sceneNode The scene node to attach the audio source to.
|
|
196
|
+
* @param useBoundingBox Whether to use the bounding box of the node for positioning. Defaults to `false`.
|
|
197
|
+
* @param attachmentType Whather to attach to the node's position and/or rotation. Defaults to `PositionAndRotation`.
|
|
198
|
+
*/
|
|
199
|
+
abstract attach(sceneNode: Node, useBoundingBox?: boolean, attachmentType?: SpatialAudioAttachmentType): void;
|
|
200
|
+
/**
|
|
201
|
+
* Detaches the audio source from the currently attached graphics node.
|
|
202
|
+
*/
|
|
203
|
+
abstract detach(): void;
|
|
204
|
+
/**
|
|
205
|
+
* Updates the position and rotation in the audio engine to the current values.
|
|
185
206
|
*/
|
|
186
207
|
abstract update(): void;
|
|
187
208
|
}
|
|
@@ -24,6 +24,7 @@ export function _HasSpatialAudioOptions(options) {
|
|
|
24
24
|
options.spatialConeOuterVolume !== undefined ||
|
|
25
25
|
options.spatialDistanceModel !== undefined ||
|
|
26
26
|
options.spatialMaxDistance !== undefined ||
|
|
27
|
+
options.spatialMinUpdateTime !== undefined ||
|
|
27
28
|
options.spatialPanningModel !== undefined ||
|
|
28
29
|
options.spatialPosition !== undefined ||
|
|
29
30
|
options.spatialReferenceDistance !== undefined ||
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abstractSpatialAudio.js","sourceRoot":"","sources":["../../../../../../dev/core/src/AudioV2/abstractAudio/subProperties/abstractSpatialAudio.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAEjE,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACjC,cAAc,EAAE,aAAuB;IACvC,cAAc,EAAE,aAAuB;IACvC,eAAe,EAAE,CAAW;IAC5B,aAAa,EAAE,SAA8B;IAC7C,WAAW,EAAE,KAAe;IAC5B,YAAY,EAAE,YAAgC;IAC9C,QAAQ,EAAE,OAAO,CAAC,IAAI,EAAE;IACxB,iBAAiB,EAAE,CAAW;IAC9B,aAAa,EAAE,CAAW;IAC1B,QAAQ,EAAE,OAAO,CAAC,IAAI,EAAE;IACxB,kBAAkB,EAAE,IAAI,UAAU,EAAE;CAC9B,CAAC;AA4FX;;;GAGG;AACH,MAAM,UAAU,uBAAuB,CAAC,OAAsC;IAC1E,OAAO,CACH,OAAO,CAAC,cAAc;QACtB,OAAO,CAAC,iBAAiB,KAAK,SAAS;QACvC,OAAO,CAAC,qBAAqB,KAAK,SAAS;QAC3C,OAAO,CAAC,qBAAqB,KAAK,SAAS;QAC3C,OAAO,CAAC,sBAAsB,KAAK,SAAS;QAC5C,OAAO,CAAC,oBAAoB,KAAK,SAAS;QAC1C,OAAO,CAAC,kBAAkB,KAAK,SAAS;QACxC,OAAO,CAAC,mBAAmB,KAAK,SAAS;QACzC,OAAO,CAAC,eAAe,KAAK,SAAS;QACrC,OAAO,CAAC,wBAAwB,KAAK,SAAS;QAC9C,OAAO,CAAC,oBAAoB,KAAK,SAAS;QAC1C,OAAO,CAAC,eAAe,KAAK,SAAS;QACrC,OAAO,CAAC,yBAAyB,KAAK,SAAS,CAClD,CAAC;AACN,CAAC;AAED;;;;GAIG;AACH,MAAM,OAAgB,oBAAoB;CAoFzC","sourcesContent":["import { Quaternion, Vector3 } from \"../../../Maths/math.vector\";\n\nexport const _SpatialAudioDefaults = {\n coneInnerAngle: 6.28318530718 as number,\n coneOuterAngle: 6.28318530718 as number,\n coneOuterVolume: 0 as number,\n distanceModel: \"inverse\" as DistanceModelType,\n maxDistance: 10000 as number,\n panningModel: \"equalpower\" as PanningModelType,\n position: Vector3.Zero(),\n referenceDistance: 1 as number,\n rolloffFactor: 1 as number,\n rotation: Vector3.Zero(),\n rotationQuaternion: new Quaternion(),\n} as const;\n\n/**\n * Options for spatial audio.\n */\nexport interface ISpatialAudioOptions {\n /**\n * Whether to automatically update the spatial properties of the audio node. Defaults to `true`.\n */\n spatialAutoUpdate: boolean;\n /**\n * The spatial cone inner angle, in radians. Defaults to 2π.\n * - When the listener is inside the cone inner angle, the volume is at its maximum.\n */\n spatialConeInnerAngle: number;\n /**\n * The spatial cone outer angle, in radians. Defaults to 2π.\n * - When the listener is between the the cone inner and outer angles, the volume fades to its minimum as the listener approaches the outer angle.\n * - When the listener is outside the cone outer angle, the volume is at its minimum.\n */\n spatialConeOuterAngle: number;\n /**\n * The amount of volume reduction outside the {@link spatialConeOuterAngle}. Defaults to 0.\n */\n spatialConeOuterVolume: number;\n /**\n * The algorithm to use to reduce the volume of the audio source as it moves away from the listener. Defaults to \"inverse\".\n *\n * Possible values are:\n * - `\"linear\"`: The volume is reduced linearly as the source moves away from the listener.\n * - `\"inverse\"`: The volume is reduced inversely as the source moves away from the listener.\n * - `\"exponential\"`: The volume is reduced exponentially as the source moves away from the listener.\n *\n * @see {@link spatialMaxDistance}\n * @see {@link spatialReferenceDistance}\n * @see {@link spatialRolloffFactor}\n */\n spatialDistanceModel: \"linear\" | \"inverse\" | \"exponential\";\n /**\n * Enable spatial audio. Defaults to false.\n *\n * When set to `true`, the audio node's spatial properties will be initialized on creation and there will be no\n * delay when setting the first spatial value.\n *\n * When not specified, or set to `false`, the audio node's spatial properties will not be initialized on creation\n * and there will be a small delay when setting the first spatial value.\n *\n * - This option is ignored if any other spatial options are set.\n */\n spatialEnabled: boolean;\n /**\n * The maximum distance between the audio source and the listener, after which the volume is not reduced any further. Defaults to 10000.\n * - This value is used only when the {@link spatialDistanceModel} is set to `\"linear\"`.\n * @see {@link spatialDistanceModel}\n */\n spatialMaxDistance: number;\n /**\n * The spatial panning model. Defaults to \"equalpower\".\n * - \"equalpower\" requires less CPU than \"HRTF\" but is less realistic for listeners with headphones or speakers close to the ears.\n * - \"HRTF\" requires more CPU but is more realistic for listeners with headphones or speakers close to the ears.\n *\n * Possible values are:\n * - `\"equalpower\"`: Represents the equal-power panning algorithm, generally regarded as simple and efficient.\n * - `\"HRTF\"`:Renders a stereo output of higher quality than `\"equalpower\"` — it uses a convolution with measured impulse responses from human subjects.\n */\n spatialPanningModel: \"equalpower\" | \"HRTF\";\n /**\n * The spatial position. Defaults to (0, 0, 0).\n */\n spatialPosition: Vector3;\n /**\n * The distance for reducing volume as the audio source moves away from the listener – i.e. the distance the volume reduction starts at. Defaults to 1.\n * - This value is used by all distance models.\n * @see {@link spatialDistanceModel}\n */\n spatialReferenceDistance: number;\n /**\n * How quickly the volume is reduced as the source moves away from the listener. Defaults to 1.\n * - This value is used by all distance models.\n * @see {@link spatialDistanceModel}\n */\n spatialRolloffFactor: number;\n /**\n * The spatial rotation, as Euler angles. Defaults to (0, 0, 0).\n */\n spatialRotation: Vector3;\n /**\n * The spatial rotation, as a quaternion. Defaults to (0, 0, 0, 1).\n */\n spatialRotationQuaternion: Quaternion;\n}\n\n/**\n * @param options The spatial audio options to check.\n * @returns `true` if spatial audio options are defined, otherwise `false`.\n */\nexport function _HasSpatialAudioOptions(options: Partial<ISpatialAudioOptions>): boolean {\n return (\n options.spatialEnabled ||\n options.spatialAutoUpdate !== undefined ||\n options.spatialConeInnerAngle !== undefined ||\n options.spatialConeOuterAngle !== undefined ||\n options.spatialConeOuterVolume !== undefined ||\n options.spatialDistanceModel !== undefined ||\n options.spatialMaxDistance !== undefined ||\n options.spatialPanningModel !== undefined ||\n options.spatialPosition !== undefined ||\n options.spatialReferenceDistance !== undefined ||\n options.spatialRolloffFactor !== undefined ||\n options.spatialRotation !== undefined ||\n options.spatialRotationQuaternion !== undefined\n );\n}\n\n/**\n * Abstract class representing the `spatial` audio property on a sound or audio bus.\n *\n * @see {@link AudioEngineV2.listener}\n */\nexport abstract class AbstractSpatialAudio {\n /**\n * The spatial cone inner angle, in radians. Defaults to 2π.\n * - When the listener is inside the cone inner angle, the volume is at its maximum.\n */\n public abstract coneInnerAngle: number;\n\n /**\n * The spatial cone outer angle, in radians. Defaults to 2π.\n * - When the listener is between the the cone inner and outer angles, the volume fades to its minimum as the listener approaches the outer angle.\n * - When the listener is outside the cone outer angle, the volume is at its minimum.\n */\n public abstract coneOuterAngle: number;\n\n /**\n * The amount of volume reduction outside the {@link coneOuterAngle}. Defaults to 0.\n */\n public abstract coneOuterVolume: number;\n\n /**\n * The algorithm to use to reduce the volume of the audio source as it moves away from the listener. Defaults to \"inverse\".\n *\n * Possible values are:\n * - `\"linear\"`: The volume is reduced linearly as the source moves away from the listener.\n * - `\"inverse\"`: The volume is reduced inversely as the source moves away from the listener.\n * - `\"exponential\"`: The volume is reduced exponentially as the source moves away from the listener.\n *\n * @see {@link spatialMaxDistance}\n * @see {@link spatialReferenceDistance}\n * @see {@link spatialRolloffFactor}\n */\n public abstract distanceModel: \"linear\" | \"inverse\" | \"exponential\";\n\n /**\n * The maximum distance between the audio source and the listener, after which the volume is not reduced any further. Defaults to 10000.\n * - This value is used only when the {@link distanceModel} is set to `\"linear\"`.\n * @see {@link distanceModel}\n */\n public abstract maxDistance: number;\n\n /**\n * The spatial panning model. Defaults to \"equalpower\".\n * - \"equalpower\" requires less CPU than \"HRTF\" but is less realistic for listeners with headphones or speakers close to the ears.\n * - \"HRTF\" requires more CPU but is more realistic for listeners with headphones or speakers close to the ears.\n *\n * Possible values are:\n * - `\"equalpower\"`: Represents the equal-power panning algorithm, generally regarded as simple and efficient.\n * - `\"HRTF\"`:Renders a stereo output of higher quality than `\"equalpower\"` — it uses a convolution with measured impulse responses from human subjects.\n */\n public abstract panningModel: \"equalpower\" | \"HRTF\";\n\n /**\n * The spatial position. Defaults to (0, 0, 0).\n */\n public abstract position: Vector3;\n\n /**\n * The distance for reducing volume as the audio source moves away from the listener – i.e. the distance the volume reduction starts at. Defaults to 1.\n * - This value is used by all distance models.\n * @see {@link distanceModel}\n */\n public abstract referenceDistance: number;\n\n /**\n * How quickly the volume is reduced as the source moves away from the listener. Defaults to 1.\n * - This value is used by all distance models.\n * @see {@link distanceModel}\n */\n public abstract rolloffFactor: number;\n\n /**\n * The spatial rotation. Defaults to (0, 0, 0).\n */\n public abstract rotation: Vector3;\n\n /**\n * The spatial rotation quaternion. Defaults to (0, 0, 0, 1).\n */\n public abstract rotationQuaternion: Quaternion;\n\n /**\n * Updates the position and rotation properties.\n */\n public abstract update(): void;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"abstractSpatialAudio.js","sourceRoot":"","sources":["../../../../../../dev/core/src/AudioV2/abstractAudio/subProperties/abstractSpatialAudio.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAIjE,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACjC,cAAc,EAAE,aAAuB;IACvC,cAAc,EAAE,aAAuB;IACvC,eAAe,EAAE,CAAW;IAC5B,aAAa,EAAE,SAA8B;IAC7C,WAAW,EAAE,KAAe;IAC5B,YAAY,EAAE,YAAgC;IAC9C,QAAQ,EAAE,OAAO,CAAC,IAAI,EAAE;IACxB,iBAAiB,EAAE,CAAW;IAC9B,aAAa,EAAE,CAAW;IAC1B,QAAQ,EAAE,OAAO,CAAC,IAAI,EAAE;IACxB,kBAAkB,EAAE,IAAI,UAAU,EAAE;CAC9B,CAAC;AA6FX;;;GAGG;AACH,MAAM,UAAU,uBAAuB,CAAC,OAAsC;IAC1E,OAAO,CACH,OAAO,CAAC,cAAc;QACtB,OAAO,CAAC,iBAAiB,KAAK,SAAS;QACvC,OAAO,CAAC,qBAAqB,KAAK,SAAS;QAC3C,OAAO,CAAC,qBAAqB,KAAK,SAAS;QAC3C,OAAO,CAAC,sBAAsB,KAAK,SAAS;QAC5C,OAAO,CAAC,oBAAoB,KAAK,SAAS;QAC1C,OAAO,CAAC,kBAAkB,KAAK,SAAS;QACxC,OAAO,CAAC,oBAAoB,KAAK,SAAS;QAC1C,OAAO,CAAC,mBAAmB,KAAK,SAAS;QACzC,OAAO,CAAC,eAAe,KAAK,SAAS;QACrC,OAAO,CAAC,wBAAwB,KAAK,SAAS;QAC9C,OAAO,CAAC,oBAAoB,KAAK,SAAS;QAC1C,OAAO,CAAC,eAAe,KAAK,SAAS;QACrC,OAAO,CAAC,yBAAyB,KAAK,SAAS,CAClD,CAAC;AACN,CAAC;AAED;;;;GAIG;AACH,MAAM,OAAgB,oBAAoB;CAyGzC","sourcesContent":["import { Quaternion, Vector3 } from \"../../../Maths/math.vector\";\nimport type { Node } from \"../../../node\";\nimport type { SpatialAudioAttachmentType } from \"../../spatialAudioAttachmentType\";\n\nexport const _SpatialAudioDefaults = {\n coneInnerAngle: 6.28318530718 as number,\n coneOuterAngle: 6.28318530718 as number,\n coneOuterVolume: 0 as number,\n distanceModel: \"inverse\" as DistanceModelType,\n maxDistance: 10000 as number,\n panningModel: \"equalpower\" as PanningModelType,\n position: Vector3.Zero(),\n referenceDistance: 1 as number,\n rolloffFactor: 1 as number,\n rotation: Vector3.Zero(),\n rotationQuaternion: new Quaternion(),\n} as const;\n\n/**\n * Options for spatial audio.\n */\nexport interface ISpatialAudioOptions {\n /**\n * Whether to automatically update the spatial properties of the audio node. Defaults to `true`.\n */\n spatialAutoUpdate: boolean;\n /**\n * The spatial cone inner angle, in radians. Defaults to 2π.\n * - When the listener is inside the cone inner angle, the volume is at its maximum.\n */\n spatialConeInnerAngle: number;\n /**\n * The spatial cone outer angle, in radians. Defaults to 2π.\n * - When the listener is between the the cone inner and outer angles, the volume fades to its minimum as the listener approaches the outer angle.\n * - When the listener is outside the cone outer angle, the volume is at its minimum.\n */\n spatialConeOuterAngle: number;\n /**\n * The amount of volume reduction outside the {@link spatialConeOuterAngle}. Defaults to 0.\n */\n spatialConeOuterVolume: number;\n /**\n * The algorithm to use to reduce the volume of the audio source as it moves away from the listener. Defaults to \"inverse\".\n *\n * Possible values are:\n * - `\"linear\"`: The volume is reduced linearly as the source moves away from the listener.\n * - `\"inverse\"`: The volume is reduced inversely as the source moves away from the listener.\n * - `\"exponential\"`: The volume is reduced exponentially as the source moves away from the listener.\n *\n * @see {@link spatialMaxDistance}\n * @see {@link spatialReferenceDistance}\n * @see {@link spatialRolloffFactor}\n */\n spatialDistanceModel: \"linear\" | \"inverse\" | \"exponential\";\n /**\n * Enable spatial audio. Defaults to false.\n *\n * When set to `true`, the audio node's spatial properties will be initialized on creation and there will be no\n * delay when setting the first spatial value.\n *\n * When not specified, or set to `false`, the audio node's spatial properties will not be initialized on creation\n * and there will be a small delay when setting the first spatial value.\n *\n * - This option is ignored if any other spatial options are set.\n */\n spatialEnabled: boolean;\n /**\n * The maximum distance between the audio source and the listener, after which the volume is not reduced any further. Defaults to 10000.\n * - This value is used only when the {@link spatialDistanceModel} is set to `\"linear\"`.\n * @see {@link spatialDistanceModel}\n */\n spatialMaxDistance: number;\n /**\n * The minimum update time in seconds of the spatialization if it is attached to a mesh or transform node. Defaults to `0`.\n * - The spatialization's position and rotation will not update faster than this time, but they may update slower depending on the frame rate.\n */\n spatialMinUpdateTime: number;\n /**\n * Possible values are:\n * - `\"equalpower\"`: Represents the equal-power panning algorithm, generally regarded as simple and efficient.\n * - `\"HRTF\"`: Renders a stereo output of higher quality than `\"equalpower\"` — it uses a convolution with measured impulse responses from human subjects.\n */\n spatialPanningModel: \"equalpower\" | \"HRTF\";\n /**\n * The spatial position. Defaults to (0, 0, 0).\n */\n spatialPosition: Vector3;\n /**\n * The distance for reducing volume as the audio source moves away from the listener – i.e. the distance the volume reduction starts at. Defaults to 1.\n * - This value is used by all distance models.\n * @see {@link spatialDistanceModel}\n */\n spatialReferenceDistance: number;\n /**\n * How quickly the volume is reduced as the source moves away from the listener. Defaults to 1.\n * - This value is used by all distance models.\n * @see {@link spatialDistanceModel}\n */\n spatialRolloffFactor: number;\n /**\n * The spatial rotation, as Euler angles. Defaults to (0, 0, 0).\n */\n spatialRotation: Vector3;\n /**\n * The spatial rotation, as a quaternion. Defaults to (0, 0, 0, 1).\n */\n spatialRotationQuaternion: Quaternion;\n}\n\n/**\n * @param options The spatial audio options to check.\n * @returns `true` if spatial audio options are defined, otherwise `false`.\n */\nexport function _HasSpatialAudioOptions(options: Partial<ISpatialAudioOptions>): boolean {\n return (\n options.spatialEnabled ||\n options.spatialAutoUpdate !== undefined ||\n options.spatialConeInnerAngle !== undefined ||\n options.spatialConeOuterAngle !== undefined ||\n options.spatialConeOuterVolume !== undefined ||\n options.spatialDistanceModel !== undefined ||\n options.spatialMaxDistance !== undefined ||\n options.spatialMinUpdateTime !== undefined ||\n options.spatialPanningModel !== undefined ||\n options.spatialPosition !== undefined ||\n options.spatialReferenceDistance !== undefined ||\n options.spatialRolloffFactor !== undefined ||\n options.spatialRotation !== undefined ||\n options.spatialRotationQuaternion !== undefined\n );\n}\n\n/**\n * Abstract class representing the `spatial` audio property on a sound or audio bus.\n *\n * @see {@link AudioEngineV2.listener}\n */\nexport abstract class AbstractSpatialAudio {\n /**\n * The spatial cone inner angle, in radians. Defaults to 2π.\n * - When the listener is inside the cone inner angle, the volume is at its maximum.\n */\n public abstract coneInnerAngle: number;\n\n /**\n * The spatial cone outer angle, in radians. Defaults to 2π.\n * - When the listener is between the the cone inner and outer angles, the volume fades to its minimum as the listener approaches the outer angle.\n * - When the listener is outside the cone outer angle, the volume is at its minimum.\n */\n public abstract coneOuterAngle: number;\n\n /**\n * The amount of volume reduction outside the {@link coneOuterAngle}. Defaults to 0.\n */\n public abstract coneOuterVolume: number;\n\n /**\n * The algorithm to use to reduce the volume of the audio source as it moves away from the listener. Defaults to \"inverse\".\n *\n * Possible values are:\n * - `\"linear\"`: The volume is reduced linearly as the source moves away from the listener.\n * - `\"inverse\"`: The volume is reduced inversely as the source moves away from the listener.\n * - `\"exponential\"`: The volume is reduced exponentially as the source moves away from the listener.\n *\n * @see {@link spatialMaxDistance}\n * @see {@link spatialReferenceDistance}\n * @see {@link spatialRolloffFactor}\n */\n public abstract distanceModel: \"linear\" | \"inverse\" | \"exponential\";\n\n /**\n * Whether the audio source is attached to a mesh or transform node.\n */\n public abstract isAttached: boolean;\n\n /**\n * The maximum distance between the audio source and the listener, after which the volume is not reduced any further. Defaults to 10000.\n * - This value is used only when the {@link distanceModel} is set to `\"linear\"`.\n * @see {@link distanceModel}\n */\n public abstract maxDistance: number;\n\n /**\n * The minimum update time in seconds of the spatialization if it is attached to a mesh or transform node. Defaults to `0`.\n * - The spatialization's position and rotation will not update faster than this time, but they may update slower depending on the frame rate.\n */\n public abstract minUpdateTime: number;\n\n /**\n * The spatial panning model. Defaults to \"equalpower\".\n *\n * Possible values are:\n * - `\"equalpower\"`: Represents the equal-power panning algorithm, generally regarded as simple and efficient.\n * - `\"HRTF\"`:Renders a stereo output of higher quality than `\"equalpower\"` — it uses a convolution with measured impulse responses from human subjects.\n */\n public abstract panningModel: \"equalpower\" | \"HRTF\";\n\n /**\n * The spatial position. Defaults to (0, 0, 0).\n */\n public abstract position: Vector3;\n\n /**\n * The distance for reducing volume as the audio source moves away from the listener – i.e. the distance the volume reduction starts at. Defaults to 1.\n * - This value is used by all distance models.\n * @see {@link distanceModel}\n */\n public abstract referenceDistance: number;\n\n /**\n * How quickly the volume is reduced as the source moves away from the listener. Defaults to 1.\n * - This value is used by all distance models.\n * @see {@link distanceModel}\n */\n public abstract rolloffFactor: number;\n\n /**\n * The spatial rotation. Defaults to (0, 0, 0).\n */\n public abstract rotation: Vector3;\n\n /**\n * The spatial rotation quaternion. Defaults to (0, 0, 0, 1).\n */\n public abstract rotationQuaternion: Quaternion;\n\n /**\n * Attaches the audio source to a scene object.\n * @param sceneNode The scene node to attach the audio source to.\n * @param useBoundingBox Whether to use the bounding box of the node for positioning. Defaults to `false`.\n * @param attachmentType Whather to attach to the node's position and/or rotation. Defaults to `PositionAndRotation`.\n */\n public abstract attach(sceneNode: Node, useBoundingBox?: boolean, attachmentType?: SpatialAudioAttachmentType): void;\n\n /**\n * Detaches the audio source from the currently attached graphics node.\n */\n public abstract detach(): void;\n /**\n * Updates the position and rotation in the audio engine to the current values.\n */\n public abstract update(): void;\n}\n"]}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { Quaternion, Vector3 } from "../../../Maths/math.vector";
|
|
2
|
+
import type { Node } from "../../../node";
|
|
3
|
+
import type { SpatialAudioAttachmentType } from "../../spatialAudioAttachmentType";
|
|
2
4
|
export declare const _SpatialAudioListenerDefaults: {
|
|
3
5
|
readonly position: Vector3;
|
|
4
6
|
readonly rotation: Vector3;
|
|
@@ -16,6 +18,11 @@ export interface ISpatialAudioListenerOptions {
|
|
|
16
18
|
* Set to `true` to enable the listener. Defaults to `false`.
|
|
17
19
|
*/
|
|
18
20
|
listenerEnabled: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* The minimum update time in seconds of the listener if it is attached to a mesh, scene or transform node. Defaults to `0`.
|
|
23
|
+
* - The listener's position and rotation will not update faster than this time, but they may update slower depending on the frame rate.
|
|
24
|
+
*/
|
|
25
|
+
listenerMinUpdateTime: number;
|
|
19
26
|
/**
|
|
20
27
|
* The listener position. Defaults to (0, 0, 0).
|
|
21
28
|
*/
|
|
@@ -40,6 +47,15 @@ export declare function _HasSpatialAudioListenerOptions(options: Partial<ISpatia
|
|
|
40
47
|
* @see {@link AudioEngineV2.listener}
|
|
41
48
|
*/
|
|
42
49
|
export declare abstract class AbstractSpatialAudioListener {
|
|
50
|
+
/**
|
|
51
|
+
* Whether the listener is attached to a camera, mesh or transform node.
|
|
52
|
+
*/
|
|
53
|
+
abstract isAttached: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* The minimum update time in seconds of the listener if it is attached to a mesh, scene or transform node. Defaults to `0`.
|
|
56
|
+
* - The listener's position and rotation will not update faster than this time, but they may update slower depending on the frame rate.
|
|
57
|
+
*/
|
|
58
|
+
abstract minUpdateTime: number;
|
|
43
59
|
/**
|
|
44
60
|
* The listener position. Defaults to (0, 0, 0).
|
|
45
61
|
*/
|
|
@@ -53,7 +69,18 @@ export declare abstract class AbstractSpatialAudioListener {
|
|
|
53
69
|
*/
|
|
54
70
|
abstract rotationQuaternion: Quaternion;
|
|
55
71
|
/**
|
|
56
|
-
*
|
|
72
|
+
* Attaches the audio source to a scene object.
|
|
73
|
+
* @param sceneNode The scene node to attach the audio source to.
|
|
74
|
+
* @param useBoundingBox Whether to use the bounding box of the node for positioning. Defaults to `false`.
|
|
75
|
+
* @param attachmentType Whather to attach to the node's position and/or rotation. Defaults to `PositionAndRotation`.
|
|
76
|
+
*/
|
|
77
|
+
abstract attach(sceneNode: Node, useBoundingBox?: boolean, attachmentType?: SpatialAudioAttachmentType): void;
|
|
78
|
+
/**
|
|
79
|
+
* Detaches the audio source from the currently attached graphics node.
|
|
80
|
+
*/
|
|
81
|
+
abstract detach(): void;
|
|
82
|
+
/**
|
|
83
|
+
* Updates the position and rotation in the audio engine to the current values.
|
|
57
84
|
*/
|
|
58
85
|
abstract update(): void;
|
|
59
86
|
}
|
|
@@ -9,7 +9,11 @@ export const _SpatialAudioListenerDefaults = {
|
|
|
9
9
|
* @returns `true` if spatial audio listener options are defined, otherwise `false`.
|
|
10
10
|
*/
|
|
11
11
|
export function _HasSpatialAudioListenerOptions(options) {
|
|
12
|
-
return options.
|
|
12
|
+
return (options.listenerEnabled ||
|
|
13
|
+
options.listenerMinUpdateTime !== undefined ||
|
|
14
|
+
options.listenerPosition !== undefined ||
|
|
15
|
+
options.listenerRotation !== undefined ||
|
|
16
|
+
options.listenerRotationQuaternion !== undefined);
|
|
13
17
|
}
|
|
14
18
|
/**
|
|
15
19
|
* Abstract class representing the spatial audio `listener` property on an audio engine.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abstractSpatialAudioListener.js","sourceRoot":"","sources":["../../../../../../dev/core/src/AudioV2/abstractAudio/subProperties/abstractSpatialAudioListener.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"abstractSpatialAudioListener.js","sourceRoot":"","sources":["../../../../../../dev/core/src/AudioV2/abstractAudio/subProperties/abstractSpatialAudioListener.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAIjE,MAAM,CAAC,MAAM,6BAA6B,GAAG;IACzC,QAAQ,EAAE,OAAO,CAAC,IAAI,EAAE;IACxB,QAAQ,EAAE,OAAO,CAAC,IAAI,EAAE;IACxB,kBAAkB,EAAE,IAAI,UAAU,EAAE;CAC9B,CAAC;AAiCX;;;GAGG;AACH,MAAM,UAAU,+BAA+B,CAAC,OAA8C;IAC1F,OAAO,CACH,OAAO,CAAC,eAAe;QACvB,OAAO,CAAC,qBAAqB,KAAK,SAAS;QAC3C,OAAO,CAAC,gBAAgB,KAAK,SAAS;QACtC,OAAO,CAAC,gBAAgB,KAAK,SAAS;QACtC,OAAO,CAAC,0BAA0B,KAAK,SAAS,CACnD,CAAC;AACN,CAAC;AAED;;;;GAIG;AACH,MAAM,OAAgB,4BAA4B;CA4CjD","sourcesContent":["import { Quaternion, Vector3 } from \"../../../Maths/math.vector\";\nimport type { Node } from \"../../../node\";\nimport type { SpatialAudioAttachmentType } from \"../../spatialAudioAttachmentType\";\n\nexport const _SpatialAudioListenerDefaults = {\n position: Vector3.Zero(),\n rotation: Vector3.Zero(),\n rotationQuaternion: new Quaternion(),\n} as const;\n\n/**\n * Options for spatial audio.\n */\nexport interface ISpatialAudioListenerOptions {\n /**\n * Whether to automatically update the position and rotation of the listener. Defaults to `true`.\n */\n listenerAutoUpdate: boolean;\n /**\n * Set to `true` to enable the listener. Defaults to `false`.\n */\n listenerEnabled: boolean;\n /**\n * The minimum update time in seconds of the listener if it is attached to a mesh, scene or transform node. Defaults to `0`.\n * - The listener's position and rotation will not update faster than this time, but they may update slower depending on the frame rate.\n */\n listenerMinUpdateTime: number;\n /**\n * The listener position. Defaults to (0, 0, 0).\n */\n listenerPosition: Vector3;\n /**\n * The listener rotation, as Euler angles. Defaults to (0, 0, 0).\n */\n listenerRotation: Vector3;\n /**\n * The listener rotation, as a quaternion. Defaults to (0, 0, 0, 1).\n */\n listenerRotationQuaternion: Quaternion;\n}\n\n/**\n * @param options The spatial audio listener options to check.\n * @returns `true` if spatial audio listener options are defined, otherwise `false`.\n */\nexport function _HasSpatialAudioListenerOptions(options: Partial<ISpatialAudioListenerOptions>): boolean {\n return (\n options.listenerEnabled ||\n options.listenerMinUpdateTime !== undefined ||\n options.listenerPosition !== undefined ||\n options.listenerRotation !== undefined ||\n options.listenerRotationQuaternion !== undefined\n );\n}\n\n/**\n * Abstract class representing the spatial audio `listener` property on an audio engine.\n *\n * @see {@link AudioEngineV2.listener}\n */\nexport abstract class AbstractSpatialAudioListener {\n /**\n * Whether the listener is attached to a camera, mesh or transform node.\n */\n public abstract isAttached: boolean;\n\n /**\n * The minimum update time in seconds of the listener if it is attached to a mesh, scene or transform node. Defaults to `0`.\n * - The listener's position and rotation will not update faster than this time, but they may update slower depending on the frame rate.\n */\n public abstract minUpdateTime: number;\n\n /**\n * The listener position. Defaults to (0, 0, 0).\n */\n public abstract position: Vector3;\n\n /**\n * The listener rotation, as Euler angles. Defaults to (0, 0, 0).\n */\n public abstract rotation: Vector3;\n\n /**\n * The listener rotation, as a quaternion. Defaults to (0, 0, 0, 1).\n */\n public abstract rotationQuaternion: Quaternion;\n\n /**\n * Attaches the audio source to a scene object.\n * @param sceneNode The scene node to attach the audio source to.\n * @param useBoundingBox Whether to use the bounding box of the node for positioning. Defaults to `false`.\n * @param attachmentType Whather to attach to the node's position and/or rotation. Defaults to `PositionAndRotation`.\n */\n public abstract attach(sceneNode: Node, useBoundingBox?: boolean, attachmentType?: SpatialAudioAttachmentType): void;\n\n /**\n * Detaches the audio source from the currently attached graphics node.\n */\n public abstract detach(): void;\n\n /**\n * Updates the position and rotation in the audio engine to the current values.\n */\n public abstract update(): void;\n}\n"]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { AudioAnalyzerFFTSizeType } from "../../abstractAudio/subProperties/abstractAudioAnalyzer";
|
|
2
|
+
import { AbstractAudioAnalyzer } from "../../abstractAudio/subProperties/abstractAudioAnalyzer";
|
|
3
|
+
import type { _AbstractAudioSubGraph } from "../subNodes/abstractAudioSubGraph";
|
|
4
|
+
/** @internal */
|
|
5
|
+
export declare function _GetEmptyByteFrequencyData(): Uint8Array;
|
|
6
|
+
/** @internal */
|
|
7
|
+
export declare function _GetEmptyFloatFrequencyData(): Float32Array;
|
|
8
|
+
/** @internal */
|
|
9
|
+
export declare class _AudioAnalyzer extends AbstractAudioAnalyzer {
|
|
10
|
+
private _subGraph;
|
|
11
|
+
/** @internal */
|
|
12
|
+
constructor(subGraph: _AbstractAudioSubGraph);
|
|
13
|
+
/** @internal */
|
|
14
|
+
get fftSize(): AudioAnalyzerFFTSizeType;
|
|
15
|
+
set fftSize(value: AudioAnalyzerFFTSizeType);
|
|
16
|
+
/** @internal */
|
|
17
|
+
get isEnabled(): boolean;
|
|
18
|
+
/** @internal */
|
|
19
|
+
get minDecibels(): number;
|
|
20
|
+
set minDecibels(value: number);
|
|
21
|
+
/** @internal */
|
|
22
|
+
get maxDecibels(): number;
|
|
23
|
+
set maxDecibels(value: number);
|
|
24
|
+
/** @internal */
|
|
25
|
+
get smoothing(): number;
|
|
26
|
+
set smoothing(value: number);
|
|
27
|
+
/** @internal */
|
|
28
|
+
dispose(): void;
|
|
29
|
+
/** @internal */
|
|
30
|
+
enable(): Promise<void>;
|
|
31
|
+
/** @internal */
|
|
32
|
+
getByteFrequencyData(): Uint8Array;
|
|
33
|
+
/** @internal */
|
|
34
|
+
getFloatFrequencyData(): Float32Array;
|
|
35
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { Logger } from "../../../Misc/logger.js";
|
|
2
|
+
import { AbstractAudioAnalyzer } from "../../abstractAudio/subProperties/abstractAudioAnalyzer.js";
|
|
3
|
+
import { _GetAudioAnalyzerProperty, _GetAudioAnalyzerSubNode, _SetAudioAnalyzerProperty } from "../subNodes/audioAnalyzerSubNode.js";
|
|
4
|
+
let _emptyByteFrequencyData = null;
|
|
5
|
+
let _emptyFloatFrequencyData = null;
|
|
6
|
+
/** @internal */
|
|
7
|
+
export function _GetEmptyByteFrequencyData() {
|
|
8
|
+
if (!_emptyByteFrequencyData) {
|
|
9
|
+
_emptyByteFrequencyData = new Uint8Array();
|
|
10
|
+
}
|
|
11
|
+
return _emptyByteFrequencyData;
|
|
12
|
+
}
|
|
13
|
+
/** @internal */
|
|
14
|
+
export function _GetEmptyFloatFrequencyData() {
|
|
15
|
+
if (!_emptyFloatFrequencyData) {
|
|
16
|
+
_emptyFloatFrequencyData = new Float32Array();
|
|
17
|
+
}
|
|
18
|
+
return _emptyFloatFrequencyData;
|
|
19
|
+
}
|
|
20
|
+
/** @internal */
|
|
21
|
+
export class _AudioAnalyzer extends AbstractAudioAnalyzer {
|
|
22
|
+
/** @internal */
|
|
23
|
+
constructor(subGraph) {
|
|
24
|
+
super();
|
|
25
|
+
this._subGraph = subGraph;
|
|
26
|
+
}
|
|
27
|
+
/** @internal */
|
|
28
|
+
get fftSize() {
|
|
29
|
+
return _GetAudioAnalyzerProperty(this._subGraph, "fftSize");
|
|
30
|
+
}
|
|
31
|
+
set fftSize(value) {
|
|
32
|
+
_SetAudioAnalyzerProperty(this._subGraph, "fftSize", value);
|
|
33
|
+
}
|
|
34
|
+
/** @internal */
|
|
35
|
+
get isEnabled() {
|
|
36
|
+
return _GetAudioAnalyzerSubNode(this._subGraph) !== null;
|
|
37
|
+
}
|
|
38
|
+
/** @internal */
|
|
39
|
+
get minDecibels() {
|
|
40
|
+
return _GetAudioAnalyzerProperty(this._subGraph, "minDecibels");
|
|
41
|
+
}
|
|
42
|
+
set minDecibels(value) {
|
|
43
|
+
_SetAudioAnalyzerProperty(this._subGraph, "minDecibels", value);
|
|
44
|
+
}
|
|
45
|
+
/** @internal */
|
|
46
|
+
get maxDecibels() {
|
|
47
|
+
return _GetAudioAnalyzerProperty(this._subGraph, "maxDecibels");
|
|
48
|
+
}
|
|
49
|
+
set maxDecibels(value) {
|
|
50
|
+
_SetAudioAnalyzerProperty(this._subGraph, "maxDecibels", value);
|
|
51
|
+
}
|
|
52
|
+
/** @internal */
|
|
53
|
+
get smoothing() {
|
|
54
|
+
return _GetAudioAnalyzerProperty(this._subGraph, "smoothing");
|
|
55
|
+
}
|
|
56
|
+
set smoothing(value) {
|
|
57
|
+
_SetAudioAnalyzerProperty(this._subGraph, "smoothing", value);
|
|
58
|
+
}
|
|
59
|
+
/** @internal */
|
|
60
|
+
dispose() {
|
|
61
|
+
const subNode = _GetAudioAnalyzerSubNode(this._subGraph);
|
|
62
|
+
if (subNode) {
|
|
63
|
+
this._subGraph.removeSubNode(subNode);
|
|
64
|
+
subNode.dispose();
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
/** @internal */
|
|
68
|
+
async enable() {
|
|
69
|
+
const subNode = _GetAudioAnalyzerSubNode(this._subGraph);
|
|
70
|
+
if (!subNode) {
|
|
71
|
+
await this._subGraph.createAndAddSubNode("Analyzer" /* AudioSubNode.ANALYZER */);
|
|
72
|
+
}
|
|
73
|
+
return Promise.resolve();
|
|
74
|
+
}
|
|
75
|
+
/** @internal */
|
|
76
|
+
getByteFrequencyData() {
|
|
77
|
+
const subNode = _GetAudioAnalyzerSubNode(this._subGraph);
|
|
78
|
+
if (!subNode) {
|
|
79
|
+
Logger.Warn("AudioAnalyzer not enabled");
|
|
80
|
+
this.enable();
|
|
81
|
+
return _GetEmptyByteFrequencyData();
|
|
82
|
+
}
|
|
83
|
+
return subNode.getByteFrequencyData();
|
|
84
|
+
}
|
|
85
|
+
/** @internal */
|
|
86
|
+
getFloatFrequencyData() {
|
|
87
|
+
const subNode = _GetAudioAnalyzerSubNode(this._subGraph);
|
|
88
|
+
if (!subNode) {
|
|
89
|
+
Logger.Warn("AudioAnalyzer not enabled");
|
|
90
|
+
this.enable();
|
|
91
|
+
return _GetEmptyFloatFrequencyData();
|
|
92
|
+
}
|
|
93
|
+
return subNode.getFloatFrequencyData();
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=audioAnalyzer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audioAnalyzer.js","sourceRoot":"","sources":["../../../../../../dev/core/src/AudioV2/abstractAudio/subProperties/audioAnalyzer.ts"],"names":[],"mappings":"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","sourcesContent":["import { Logger } from \"../../../Misc/logger\";\nimport type { Nullable } from \"../../../types\";\nimport type { AudioAnalyzerFFTSizeType } from \"../../abstractAudio/subProperties/abstractAudioAnalyzer\";\nimport { AbstractAudioAnalyzer } from \"../../abstractAudio/subProperties/abstractAudioAnalyzer\";\nimport type { _AbstractAudioSubGraph } from \"../subNodes/abstractAudioSubGraph\";\nimport { _GetAudioAnalyzerProperty, _GetAudioAnalyzerSubNode, _SetAudioAnalyzerProperty } from \"../subNodes/audioAnalyzerSubNode\";\nimport { AudioSubNode } from \"../subNodes/audioSubNode\";\n\nlet _emptyByteFrequencyData: Nullable<Uint8Array> = null;\nlet _emptyFloatFrequencyData: Nullable<Float32Array> = null;\n\n/** @internal */\nexport function _GetEmptyByteFrequencyData(): Uint8Array {\n if (!_emptyByteFrequencyData) {\n _emptyByteFrequencyData = new Uint8Array();\n }\n return _emptyByteFrequencyData;\n}\n\n/** @internal */\nexport function _GetEmptyFloatFrequencyData(): Float32Array {\n if (!_emptyFloatFrequencyData) {\n _emptyFloatFrequencyData = new Float32Array();\n }\n return _emptyFloatFrequencyData;\n}\n\n/** @internal */\nexport class _AudioAnalyzer extends AbstractAudioAnalyzer {\n private _subGraph: _AbstractAudioSubGraph;\n\n /** @internal */\n public constructor(subGraph: _AbstractAudioSubGraph) {\n super();\n this._subGraph = subGraph;\n }\n\n /** @internal */\n public get fftSize(): AudioAnalyzerFFTSizeType {\n return _GetAudioAnalyzerProperty(this._subGraph, \"fftSize\");\n }\n\n public set fftSize(value: AudioAnalyzerFFTSizeType) {\n _SetAudioAnalyzerProperty(this._subGraph, \"fftSize\", value);\n }\n\n /** @internal */\n public get isEnabled(): boolean {\n return _GetAudioAnalyzerSubNode(this._subGraph) !== null;\n }\n\n /** @internal */\n public get minDecibels(): number {\n return _GetAudioAnalyzerProperty(this._subGraph, \"minDecibels\");\n }\n\n public set minDecibels(value: number) {\n _SetAudioAnalyzerProperty(this._subGraph, \"minDecibels\", value);\n }\n\n /** @internal */\n public get maxDecibels(): number {\n return _GetAudioAnalyzerProperty(this._subGraph, \"maxDecibels\");\n }\n\n public set maxDecibels(value: number) {\n _SetAudioAnalyzerProperty(this._subGraph, \"maxDecibels\", value);\n }\n\n /** @internal */\n public get smoothing(): number {\n return _GetAudioAnalyzerProperty(this._subGraph, \"smoothing\");\n }\n\n public set smoothing(value: number) {\n _SetAudioAnalyzerProperty(this._subGraph, \"smoothing\", value);\n }\n\n /** @internal */\n public dispose(): void {\n const subNode = _GetAudioAnalyzerSubNode(this._subGraph);\n if (subNode) {\n this._subGraph.removeSubNode(subNode);\n subNode.dispose();\n }\n }\n\n /** @internal */\n public async enable(): Promise<void> {\n const subNode = _GetAudioAnalyzerSubNode(this._subGraph);\n if (!subNode) {\n await this._subGraph.createAndAddSubNode(AudioSubNode.ANALYZER);\n }\n return Promise.resolve();\n }\n\n /** @internal */\n public getByteFrequencyData(): Uint8Array {\n const subNode = _GetAudioAnalyzerSubNode(this._subGraph);\n if (!subNode) {\n Logger.Warn(\"AudioAnalyzer not enabled\");\n this.enable();\n return _GetEmptyByteFrequencyData();\n }\n return subNode.getByteFrequencyData();\n }\n\n /** @internal */\n public getFloatFrequencyData(): Float32Array {\n const subNode = _GetAudioAnalyzerSubNode(this._subGraph);\n if (!subNode) {\n Logger.Warn(\"AudioAnalyzer not enabled\");\n this.enable();\n return _GetEmptyFloatFrequencyData();\n }\n return subNode.getFloatFrequencyData();\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../dev/core/src/AudioV2/abstractAudio/subProperties/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,uBAAuB,CAAC","sourcesContent":["export * from \"./abstractSpatialAudio\";\nexport * from \"./abstractSpatialAudioListener\";\nexport * from \"./abstractStereoAudio\";\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../dev/core/src/AudioV2/abstractAudio/subProperties/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,uBAAuB,CAAC","sourcesContent":["export * from \"./abstractAudioAnalyzer\";\nexport * from \"./abstractSpatialAudio\";\nexport * from \"./abstractSpatialAudioListener\";\nexport * from \"./abstractStereoAudio\";\n"]}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { Quaternion, Vector3 } from "../../../Maths/math.vector";
|
|
2
|
+
import type { Node } from "../../../node";
|
|
3
|
+
import { SpatialAudioAttachmentType } from "../../spatialAudioAttachmentType";
|
|
2
4
|
import type { _AbstractAudioSubGraph } from "../subNodes/abstractAudioSubGraph";
|
|
3
5
|
import { AbstractSpatialAudio } from "./abstractSpatialAudio";
|
|
4
6
|
/** @internal */
|
|
5
|
-
export declare class _SpatialAudio extends AbstractSpatialAudio {
|
|
7
|
+
export declare abstract class _SpatialAudio extends AbstractSpatialAudio {
|
|
6
8
|
private _position;
|
|
7
9
|
private _rotation;
|
|
8
10
|
private _rotationQuaternion;
|
|
@@ -22,6 +24,8 @@ export declare class _SpatialAudio extends AbstractSpatialAudio {
|
|
|
22
24
|
get distanceModel(): DistanceModelType;
|
|
23
25
|
set distanceModel(value: DistanceModelType);
|
|
24
26
|
/** @internal */
|
|
27
|
+
get isAttached(): boolean;
|
|
28
|
+
/** @internal */
|
|
25
29
|
get maxDistance(): number;
|
|
26
30
|
set maxDistance(value: number);
|
|
27
31
|
/** @internal */
|
|
@@ -42,6 +46,17 @@ export declare class _SpatialAudio extends AbstractSpatialAudio {
|
|
|
42
46
|
/** @internal */
|
|
43
47
|
get rotationQuaternion(): Quaternion;
|
|
44
48
|
set rotationQuaternion(value: Quaternion);
|
|
49
|
+
/**
|
|
50
|
+
* Attaches the audio source to a scene object.
|
|
51
|
+
* @param sceneNode The scene node to attach the audio source to.
|
|
52
|
+
* @param useBoundingBox Whether to use the bounding box of the node for positioning. Defaults to `false`.
|
|
53
|
+
* @param attachmentType Whather to attach to the node's position and/or rotation. Defaults to `PositionAndRotation`.
|
|
54
|
+
*/
|
|
55
|
+
attach(sceneNode: Node, useBoundingBox?: boolean, attachmentType?: SpatialAudioAttachmentType): void;
|
|
56
|
+
/**
|
|
57
|
+
* Detaches the audio source from the currently attached graphics node.
|
|
58
|
+
*/
|
|
59
|
+
detach(): void;
|
|
45
60
|
/** @internal */
|
|
46
61
|
update(): void;
|
|
47
62
|
private _updatePosition;
|