@motionscript/browser 0.0.0-stage → 0.1.0-alpha.0
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/CHANGELOG.md +5 -0
- package/LICENSE +201 -0
- package/README.md +68 -3
- package/dist/asset-bytes.d.ts +50 -0
- package/dist/asset-bytes.d.ts.map +1 -0
- package/dist/asset-bytes.js +60 -0
- package/dist/asset-bytes.js.map +1 -0
- package/dist/audio/bus-graph.d.ts +43 -0
- package/dist/audio/bus-graph.d.ts.map +1 -0
- package/dist/audio/bus-graph.js +104 -0
- package/dist/audio/bus-graph.js.map +1 -0
- package/dist/audio/filter-graph.d.ts +58 -0
- package/dist/audio/filter-graph.d.ts.map +1 -0
- package/dist/audio/filter-graph.js +235 -0
- package/dist/audio/filter-graph.js.map +1 -0
- package/dist/audio/index.d.ts +5 -0
- package/dist/audio/index.d.ts.map +1 -0
- package/dist/audio/index.js +12 -0
- package/dist/audio/index.js.map +1 -0
- package/dist/audio/mixer.d.ts +59 -0
- package/dist/audio/mixer.d.ts.map +1 -0
- package/dist/audio/mixer.js +193 -0
- package/dist/audio/mixer.js.map +1 -0
- package/dist/audio/player.d.ts +49 -0
- package/dist/audio/player.d.ts.map +1 -0
- package/dist/audio/player.js +226 -0
- package/dist/audio/player.js.map +1 -0
- package/dist/browser/audio.js +2 -0
- package/dist/browser/audio.js.map +7 -0
- package/dist/browser/chunks/GLTFLoader-PGXD4V5B.js +2 -0
- package/dist/browser/chunks/GLTFLoader-PGXD4V5B.js.map +7 -0
- package/dist/browser/chunks/SkeletonUtils-XYDMTGTM.js +2 -0
- package/dist/browser/chunks/SkeletonUtils-XYDMTGTM.js.map +7 -0
- package/dist/browser/chunks/chunk-CTLBXZSU.js +4119 -0
- package/dist/browser/chunks/chunk-CTLBXZSU.js.map +7 -0
- package/dist/browser/chunks/chunk-FQ32PDIU.js +2 -0
- package/dist/browser/chunks/chunk-FQ32PDIU.js.map +7 -0
- package/dist/browser/chunks/chunk-FY3BTKY4.js +2 -0
- package/dist/browser/chunks/chunk-FY3BTKY4.js.map +7 -0
- package/dist/browser/chunks/chunk-NSFLRI4P.js +2 -0
- package/dist/browser/chunks/chunk-NSFLRI4P.js.map +7 -0
- package/dist/browser/chunks/three.module-Z4EOVUWF.js +2 -0
- package/dist/browser/chunks/three.module-Z4EOVUWF.js.map +7 -0
- package/dist/browser/esbuild.wasm +0 -0
- package/dist/browser/index.js +2172 -0
- package/dist/browser/index.js.map +7 -0
- package/dist/browser/manifest.json +15 -0
- package/dist/concat.d.ts +95 -0
- package/dist/concat.d.ts.map +1 -0
- package/dist/concat.js +174 -0
- package/dist/concat.js.map +1 -0
- package/dist/decode/image-levels.d.ts +137 -0
- package/dist/decode/image-levels.d.ts.map +1 -0
- package/dist/decode/image-levels.js +477 -0
- package/dist/decode/image-levels.js.map +1 -0
- package/dist/decode/levels.d.ts +37 -0
- package/dist/decode/levels.d.ts.map +1 -0
- package/dist/decode/levels.js +68 -0
- package/dist/decode/levels.js.map +1 -0
- package/dist/decode/video-levels.d.ts +37 -0
- package/dist/decode/video-levels.d.ts.map +1 -0
- package/dist/decode/video-levels.js +95 -0
- package/dist/decode/video-levels.js.map +1 -0
- package/dist/dynamic-nodes.d.ts +9 -0
- package/dist/dynamic-nodes.d.ts.map +1 -0
- package/dist/dynamic-nodes.js +56 -0
- package/dist/dynamic-nodes.js.map +1 -0
- package/dist/engine.d.ts +59 -0
- package/dist/engine.d.ts.map +1 -0
- package/dist/engine.js +171 -0
- package/dist/engine.js.map +1 -0
- package/dist/exporter.d.ts +163 -0
- package/dist/exporter.d.ts.map +1 -0
- package/dist/exporter.js +263 -0
- package/dist/exporter.js.map +1 -0
- package/dist/getter.d.ts +10 -0
- package/dist/getter.d.ts.map +1 -0
- package/dist/getter.js +38 -0
- package/dist/getter.js.map +1 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +72 -0
- package/dist/index.js.map +1 -0
- package/dist/measure-context.d.ts +12 -0
- package/dist/measure-context.d.ts.map +1 -0
- package/dist/measure-context.js +12 -0
- package/dist/measure-context.js.map +1 -0
- package/dist/mix-timeline-audio.d.ts +42 -0
- package/dist/mix-timeline-audio.d.ts.map +1 -0
- package/dist/mix-timeline-audio.js +63 -0
- package/dist/mix-timeline-audio.js.map +1 -0
- package/dist/output.d.ts +7 -0
- package/dist/output.d.ts.map +1 -0
- package/dist/output.js +6 -0
- package/dist/output.js.map +1 -0
- package/dist/render-context.d.ts +30 -0
- package/dist/render-context.d.ts.map +1 -0
- package/dist/render-context.js +55 -0
- package/dist/render-context.js.map +1 -0
- package/dist/screenshot.d.ts +45 -0
- package/dist/screenshot.d.ts.map +1 -0
- package/dist/screenshot.js +32 -0
- package/dist/screenshot.js.map +1 -0
- package/dist/still.d.ts +151 -0
- package/dist/still.d.ts.map +1 -0
- package/dist/still.js +222 -0
- package/dist/still.js.map +1 -0
- package/dist/storage-adapter.d.ts +367 -0
- package/dist/storage-adapter.d.ts.map +1 -0
- package/dist/storage-adapter.js +1278 -0
- package/dist/storage-adapter.js.map +1 -0
- package/dist/three/renderer.d.ts +48 -0
- package/dist/three/renderer.d.ts.map +1 -0
- package/dist/three/renderer.js +177 -0
- package/dist/three/renderer.js.map +1 -0
- package/dist/ticker.d.ts +42 -0
- package/dist/ticker.d.ts.map +1 -0
- package/dist/ticker.js +143 -0
- package/dist/ticker.js.map +1 -0
- package/package.json +74 -3
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Bg as A,If as P,Kf as g,Lf as W,Pg as T,fd as w,gd as v,td as p}from"./chunk-CTLBXZSU.js";function B(r,a){return a.getBoneName!==void 0?a.getBoneName(r):a.names[r.name]}function D(r,a,e={}){let t=new w,u=new v,l=new p,s=new p;e.preserveBoneMatrix=e.preserveBoneMatrix!==void 0?e.preserveBoneMatrix:!0,e.preserveBonePositions=e.preserveBonePositions!==void 0?e.preserveBonePositions:!0,e.useTargetMatrix=e.useTargetMatrix!==void 0?e.useTargetMatrix:!1,e.hip=e.hip!==void 0?e.hip:"hip",e.hipInfluence=e.hipInfluence!==void 0?e.hipInfluence:new v(1,1,1),e.scale=e.scale!==void 0?e.scale:1,e.names=e.names||{};let o=a.isObject3D?a.skeleton.bones:b(a),c=r.isObject3D?r.skeleton.bones:b(r),i,d,m,x;if(r.isObject3D?r.skeleton.pose():(e.useTargetMatrix=!0,e.preserveBoneMatrix=!1),e.preserveBonePositions){x=[];for(let n=0;n<c.length;n++)x.push(c[n].position.clone())}if(e.preserveBoneMatrix){r.updateMatrixWorld(),r.matrixWorld.identity();for(let n=0;n<r.children.length;++n)r.children[n].updateMatrixWorld(!0)}for(let n=0;n<c.length;++n)i=c[n],d=B(i,e),m=q(d,o),s.copy(i.matrixWorld),m&&(m.updateMatrixWorld(),e.useTargetMatrix?l.copy(m.matrixWorld):(l.copy(r.matrixWorld).invert(),l.multiply(m.matrixWorld)),u.setFromMatrixScale(l),l.scale(u.set(1/u.x,1/u.y,1/u.z)),s.makeRotationFromQuaternion(t.setFromRotationMatrix(l)),r.isObject3D&&e.localOffsets&&e.localOffsets[i.name]&&s.multiply(e.localOffsets[i.name]),s.copyPosition(l)),d===e.hip&&(s.elements[12]*=e.scale*e.hipInfluence.x,s.elements[13]*=e.scale*e.hipInfluence.y,s.elements[14]*=e.scale*e.hipInfluence.z,e.hipPosition!==void 0&&(s.elements[12]+=e.hipPosition.x*e.scale,s.elements[13]+=e.hipPosition.y*e.scale,s.elements[14]+=e.hipPosition.z*e.scale)),i.parent?(i.matrix.copy(i.parent.matrixWorld).invert(),i.matrix.multiply(s)):i.matrix.copy(s),i.matrix.decompose(i.position,i.quaternion,i.scale),i.updateMatrixWorld();if(e.preserveBonePositions)for(let n=0;n<c.length;++n)i=c[n],d=B(i,e)||i.name,d!==e.hip&&i.position.copy(x[n]);e.preserveBoneMatrix&&r.updateMatrixWorld(!0)}function S(r,a,e,t={}){t.useFirstFramePosition=t.useFirstFramePosition!==void 0?t.useFirstFramePosition:!1,t.fps=t.fps!==void 0?t.fps:Math.max(...e.tracks.map(f=>f.times.length))/e.duration,t.names=t.names||[],a.isObject3D||(a=j(a));let u=Math.round(e.duration*(t.fps/1e3)*1e3),l=e.duration/(u-1),s=[],o=new A(a),c=b(r.skeleton),i=[],d,m,x,n,y;o.clipAction(e).play();let k=0,h=u;t.trim!==void 0?(k=Math.round(t.trim[0]*t.fps),h=Math.min(Math.round(t.trim[1]*t.fps),u)-k,o.update(t.trim[0])):o.update(0),a.updateMatrixWorld();for(let f=0;f<h;++f){let F=f*l;D(r,a,t);for(let M=0;M<c.length;++M)m=c[M],y=B(m,t)||m.name,x=q(y,a.skeleton),x&&(n=i[M]=i[M]||{bone:m},t.hip===y&&(n.pos||(n.pos={times:new Float32Array(h),values:new Float32Array(h*3)}),t.useFirstFramePosition&&(f===0&&(d=m.position.clone()),m.position.sub(d)),n.pos.times[f]=F,m.position.toArray(n.pos.values,f*3)),n.quat||(n.quat={times:new Float32Array(h),values:new Float32Array(h*4)}),n.quat.times[f]=F,m.quaternion.toArray(n.quat.values,f*4));f===h-2?o.update(l-1e-7):o.update(l),a.updateMatrixWorld()}for(let f=0;f<i.length;++f)n=i[f],n&&(n.pos&&s.push(new g(".bones["+n.bone.name+"].position",n.pos.times,n.pos.values)),s.push(new P(".bones["+n.bone.name+"].quaternion",n.quat.times,n.quat.values)));return o.uncacheAction(e),new W(e.name,-1,s)}function z(r){let a=new Map,e=new Map,t=r.clone();return O(r,t,function(u,l){a.set(l,u),e.set(u,l)}),t.traverse(function(u){if(!u.isSkinnedMesh)return;let l=u,s=a.get(u),o=s.skeleton.bones;l.skeleton=s.skeleton.clone(),l.bindMatrix.copy(s.bindMatrix),l.skeleton.bones=o.map(function(c){return e.get(c)}),l.bind(l.skeleton,l.bindMatrix)}),t}function q(r,a){for(let e=0,t=b(a);e<t.length;e++)if(r===t[e].name)return t[e]}function b(r){return Array.isArray(r)?r:r.bones}function j(r){let a=new T(r.bones[0]);return a.skeleton=r,a}function O(r,a,e){e(r,a);for(let t=0;t<r.children.length;t++)O(r.children[t],a.children[t],e)}export{D as a,S as b,z as c};
|
|
2
|
+
//# sourceMappingURL=chunk-FQ32PDIU.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../node_modules/.pnpm/three@0.185.1/node_modules/three/examples/jsm/utils/SkeletonUtils.js"],
|
|
4
|
+
"sourcesContent": ["import {\n\tAnimationClip,\n\tAnimationMixer,\n\tMatrix4,\n\tQuaternion,\n\tQuaternionKeyframeTrack,\n\tSkeletonHelper,\n\tVector3,\n\tVectorKeyframeTrack\n} from 'three';\n\n/**\n * @module SkeletonUtils\n * @three_import import * as SkeletonUtils from 'three/addons/utils/SkeletonUtils.js';\n */\n\nfunction getBoneName( bone, options ) {\n\n\tif ( options.getBoneName !== undefined ) {\n\n\t\treturn options.getBoneName( bone );\n\n\t}\n\n\treturn options.names[ bone.name ];\n\n}\n\n/**\n * Retargets the skeleton from the given source to the target.\n *\n * Both `target` and `source` can be a 3D object with a skeleton property (e.g. a skinned mesh)\n * or a {@link Skeleton} directly.\n *\n * @param {Object3D|Skeleton} target - The target object.\n * @param {Object3D|Skeleton} source - The source object.\n * @param {module:SkeletonUtils~RetargetOptions} options - The options.\n */\nfunction retarget( target, source, options = {} ) {\n\n\tconst quat = new Quaternion(),\n\t\tscale = new Vector3(),\n\t\trelativeMatrix = new Matrix4(),\n\t\tglobalMatrix = new Matrix4();\n\n\toptions.preserveBoneMatrix = options.preserveBoneMatrix !== undefined ? options.preserveBoneMatrix : true;\n\toptions.preserveBonePositions = options.preserveBonePositions !== undefined ? options.preserveBonePositions : true;\n\toptions.useTargetMatrix = options.useTargetMatrix !== undefined ? options.useTargetMatrix : false;\n\toptions.hip = options.hip !== undefined ? options.hip : 'hip';\n\toptions.hipInfluence = options.hipInfluence !== undefined ? options.hipInfluence : new Vector3( 1, 1, 1 );\n\toptions.scale = options.scale !== undefined ? options.scale : 1;\n\toptions.names = options.names || {};\n\n\tconst sourceBones = source.isObject3D ? source.skeleton.bones : getBones( source ),\n\t\tbones = target.isObject3D ? target.skeleton.bones : getBones( target );\n\n\tlet bone, name, boneTo,\n\t\tbonesPosition;\n\n\t// reset bones\n\n\tif ( target.isObject3D ) {\n\n\t\ttarget.skeleton.pose();\n\n\t} else {\n\n\t\toptions.useTargetMatrix = true;\n\t\toptions.preserveBoneMatrix = false;\n\n\t}\n\n\tif ( options.preserveBonePositions ) {\n\n\t\tbonesPosition = [];\n\n\t\tfor ( let i = 0; i < bones.length; i ++ ) {\n\n\t\t\tbonesPosition.push( bones[ i ].position.clone() );\n\n\t\t}\n\n\t}\n\n\tif ( options.preserveBoneMatrix ) {\n\n\t\t// reset matrix\n\n\t\ttarget.updateMatrixWorld();\n\n\t\ttarget.matrixWorld.identity();\n\n\t\t// reset children matrix\n\n\t\tfor ( let i = 0; i < target.children.length; ++ i ) {\n\n\t\t\ttarget.children[ i ].updateMatrixWorld( true );\n\n\t\t}\n\n\t}\n\n\tfor ( let i = 0; i < bones.length; ++ i ) {\n\n\t\tbone = bones[ i ];\n\t\tname = getBoneName( bone, options );\n\n\t\tboneTo = getBoneByName( name, sourceBones );\n\n\t\tglobalMatrix.copy( bone.matrixWorld );\n\n\t\tif ( boneTo ) {\n\n\t\t\tboneTo.updateMatrixWorld();\n\n\t\t\tif ( options.useTargetMatrix ) {\n\n\t\t\t\trelativeMatrix.copy( boneTo.matrixWorld );\n\n\t\t\t} else {\n\n\t\t\t\trelativeMatrix.copy( target.matrixWorld ).invert();\n\t\t\t\trelativeMatrix.multiply( boneTo.matrixWorld );\n\n\t\t\t}\n\n\t\t\t// ignore scale to extract rotation\n\n\t\t\tscale.setFromMatrixScale( relativeMatrix );\n\t\t\trelativeMatrix.scale( scale.set( 1 / scale.x, 1 / scale.y, 1 / scale.z ) );\n\n\t\t\t// apply to global matrix\n\n\t\t\tglobalMatrix.makeRotationFromQuaternion( quat.setFromRotationMatrix( relativeMatrix ) );\n\n\t\t\tif ( target.isObject3D ) {\n\n\t\t\t\tif ( options.localOffsets ) {\n\n\t\t\t\t\tif ( options.localOffsets[ bone.name ] ) {\n\n\t\t\t\t\t\tglobalMatrix.multiply( options.localOffsets[ bone.name ] );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tglobalMatrix.copyPosition( relativeMatrix );\n\n\t\t}\n\n\t\tif ( name === options.hip ) {\n\n\t\t\tglobalMatrix.elements[ 12 ] *= options.scale * options.hipInfluence.x;\n\t\t\tglobalMatrix.elements[ 13 ] *= options.scale * options.hipInfluence.y;\n\t\t\tglobalMatrix.elements[ 14 ] *= options.scale * options.hipInfluence.z;\n\n\t\t\tif ( options.hipPosition !== undefined ) {\n\n\t\t\t\tglobalMatrix.elements[ 12 ] += options.hipPosition.x * options.scale;\n\t\t\t\tglobalMatrix.elements[ 13 ] += options.hipPosition.y * options.scale;\n\t\t\t\tglobalMatrix.elements[ 14 ] += options.hipPosition.z * options.scale;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( bone.parent ) {\n\n\t\t\tbone.matrix.copy( bone.parent.matrixWorld ).invert();\n\t\t\tbone.matrix.multiply( globalMatrix );\n\n\t\t} else {\n\n\t\t\tbone.matrix.copy( globalMatrix );\n\n\t\t}\n\n\t\tbone.matrix.decompose( bone.position, bone.quaternion, bone.scale );\n\n\t\tbone.updateMatrixWorld();\n\n\t}\n\n\tif ( options.preserveBonePositions ) {\n\n\t\tfor ( let i = 0; i < bones.length; ++ i ) {\n\n\t\t\tbone = bones[ i ];\n\t\t\tname = getBoneName( bone, options ) || bone.name;\n\n\t\t\tif ( name !== options.hip ) {\n\n\t\t\t\tbone.position.copy( bonesPosition[ i ] );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tif ( options.preserveBoneMatrix ) {\n\n\t\t// restore matrix\n\n\t\ttarget.updateMatrixWorld( true );\n\n\t}\n\n}\n\n/**\n * Retargets the animation clip of the source to the target 3D object.\n *\n * The `source` can be a 3D object with a skeleton property (e.g. a skinned mesh)\n * or a {@link Skeleton} directly.\n *\n * @param {Object3D} target - The target 3D object. Must have a `skeleton` property.\n * @param {Object3D|Skeleton} source - The source object.\n * @param {AnimationClip} clip - The animation clip.\n * @param {module:SkeletonUtils~RetargetOptions} options - The options.\n * @return {AnimationClip} The retargeted animation clip.\n */\nfunction retargetClip( target, source, clip, options = {} ) {\n\n\toptions.useFirstFramePosition = options.useFirstFramePosition !== undefined ? options.useFirstFramePosition : false;\n\n\t// Calculate the fps from the source clip based on the track with the most frames, unless fps is already provided.\n\toptions.fps = options.fps !== undefined ? options.fps : ( Math.max( ...clip.tracks.map( track => track.times.length ) ) / clip.duration );\n\toptions.names = options.names || [];\n\n\tif ( ! source.isObject3D ) {\n\n\t\tsource = getHelperFromSkeleton( source );\n\n\t}\n\n\tconst numFrames = Math.round( clip.duration * ( options.fps / 1000 ) * 1000 ),\n\t\tdelta = clip.duration / ( numFrames - 1 ),\n\t\tconvertedTracks = [],\n\t\tmixer = new AnimationMixer( source ),\n\t\tbones = getBones( target.skeleton ),\n\t\tboneDatas = [];\n\n\tlet positionOffset,\n\t\tbone, boneTo, boneData,\n\t\tname;\n\n\tmixer.clipAction( clip ).play();\n\n\t// trim\n\n\tlet start = 0, end = numFrames;\n\n\tif ( options.trim !== undefined ) {\n\n\t\tstart = Math.round( options.trim[ 0 ] * options.fps );\n\t\tend = Math.min( Math.round( options.trim[ 1 ] * options.fps ), numFrames ) - start;\n\n\t\tmixer.update( options.trim[ 0 ] );\n\n\t} else {\n\n\t\tmixer.update( 0 );\n\n\t}\n\n\tsource.updateMatrixWorld();\n\n\t//\n\n\tfor ( let frame = 0; frame < end; ++ frame ) {\n\n\t\tconst time = frame * delta;\n\n\t\tretarget( target, source, options );\n\n\t\tfor ( let j = 0; j < bones.length; ++ j ) {\n\n\t\t\tbone = bones[ j ];\n\t\t\tname = getBoneName( bone, options ) || bone.name;\n\t\t\tboneTo = getBoneByName( name, source.skeleton );\n\n\t\t\tif ( boneTo ) {\n\n\t\t\t\tboneData = boneDatas[ j ] = boneDatas[ j ] || { bone: bone };\n\n\t\t\t\tif ( options.hip === name ) {\n\n\t\t\t\t\tif ( ! boneData.pos ) {\n\n\t\t\t\t\t\tboneData.pos = {\n\t\t\t\t\t\t\ttimes: new Float32Array( end ),\n\t\t\t\t\t\t\tvalues: new Float32Array( end * 3 )\n\t\t\t\t\t\t};\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( options.useFirstFramePosition ) {\n\n\t\t\t\t\t\tif ( frame === 0 ) {\n\n\t\t\t\t\t\t\tpositionOffset = bone.position.clone();\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbone.position.sub( positionOffset );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tboneData.pos.times[ frame ] = time;\n\n\t\t\t\t\tbone.position.toArray( boneData.pos.values, frame * 3 );\n\n\t\t\t\t}\n\n\t\t\t\tif ( ! boneData.quat ) {\n\n\t\t\t\t\tboneData.quat = {\n\t\t\t\t\t\ttimes: new Float32Array( end ),\n\t\t\t\t\t\tvalues: new Float32Array( end * 4 )\n\t\t\t\t\t};\n\n\t\t\t\t}\n\n\t\t\t\tboneData.quat.times[ frame ] = time;\n\n\t\t\t\tbone.quaternion.toArray( boneData.quat.values, frame * 4 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( frame === end - 2 ) {\n\n\t\t\t// last mixer update before final loop iteration\n\t\t\t// make sure we do not go over or equal to clip duration\n\t\t\tmixer.update( delta - 0.0000001 );\n\n\t\t} else {\n\n\t\t\tmixer.update( delta );\n\n\t\t}\n\n\t\tsource.updateMatrixWorld();\n\n\t}\n\n\tfor ( let i = 0; i < boneDatas.length; ++ i ) {\n\n\t\tboneData = boneDatas[ i ];\n\n\t\tif ( boneData ) {\n\n\t\t\tif ( boneData.pos ) {\n\n\t\t\t\tconvertedTracks.push( new VectorKeyframeTrack(\n\t\t\t\t\t'.bones[' + boneData.bone.name + '].position',\n\t\t\t\t\tboneData.pos.times,\n\t\t\t\t\tboneData.pos.values\n\t\t\t\t) );\n\n\t\t\t}\n\n\t\t\tconvertedTracks.push( new QuaternionKeyframeTrack(\n\t\t\t\t'.bones[' + boneData.bone.name + '].quaternion',\n\t\t\t\tboneData.quat.times,\n\t\t\t\tboneData.quat.values\n\t\t\t) );\n\n\t\t}\n\n\t}\n\n\tmixer.uncacheAction( clip );\n\n\treturn new AnimationClip( clip.name, - 1, convertedTracks );\n\n}\n\n/**\n * Clones the given 3D object and its descendants, ensuring that any `SkinnedMesh` instances are\n * correctly associated with their bones. Bones are also cloned, and must be descendants of the\n * object passed to this method. Other data, like geometries and materials, are reused by reference.\n *\n * @param {Object3D} source - The 3D object to clone.\n * @return {Object3D} The cloned 3D object.\n */\nfunction clone( source ) {\n\n\tconst sourceLookup = new Map();\n\tconst cloneLookup = new Map();\n\n\tconst clone = source.clone();\n\n\tparallelTraverse( source, clone, function ( sourceNode, clonedNode ) {\n\n\t\tsourceLookup.set( clonedNode, sourceNode );\n\t\tcloneLookup.set( sourceNode, clonedNode );\n\n\t} );\n\n\tclone.traverse( function ( node ) {\n\n\t\tif ( ! node.isSkinnedMesh ) return;\n\n\t\tconst clonedMesh = node;\n\t\tconst sourceMesh = sourceLookup.get( node );\n\t\tconst sourceBones = sourceMesh.skeleton.bones;\n\n\t\tclonedMesh.skeleton = sourceMesh.skeleton.clone();\n\t\tclonedMesh.bindMatrix.copy( sourceMesh.bindMatrix );\n\n\t\tclonedMesh.skeleton.bones = sourceBones.map( function ( bone ) {\n\n\t\t\treturn cloneLookup.get( bone );\n\n\t\t} );\n\n\t\tclonedMesh.bind( clonedMesh.skeleton, clonedMesh.bindMatrix );\n\n\t} );\n\n\treturn clone;\n\n}\n\n// internal helper\n\nfunction getBoneByName( name, skeleton ) {\n\n\tfor ( let i = 0, bones = getBones( skeleton ); i < bones.length; i ++ ) {\n\n\t\tif ( name === bones[ i ].name )\n\n\t\t\treturn bones[ i ];\n\n\t}\n\n}\n\nfunction getBones( skeleton ) {\n\n\treturn Array.isArray( skeleton ) ? skeleton : skeleton.bones;\n\n}\n\n\nfunction getHelperFromSkeleton( skeleton ) {\n\n\tconst source = new SkeletonHelper( skeleton.bones[ 0 ] );\n\tsource.skeleton = skeleton;\n\n\treturn source;\n\n}\n\nfunction parallelTraverse( a, b, callback ) {\n\n\tcallback( a, b );\n\n\tfor ( let i = 0; i < a.children.length; i ++ ) {\n\n\t\tparallelTraverse( a.children[ i ], b.children[ i ], callback );\n\n\t}\n\n}\n\n/**\n * Retarget options of `SkeletonUtils`.\n *\n * @typedef {Object} module:SkeletonUtils~RetargetOptions\n * @property {boolean} [useFirstFramePosition=false] - Whether to use the position of the first frame or not.\n * @property {number} [fps] - The FPS of the clip.\n * @property {Object<string,string>} [names] - A dictionary for mapping target to source bone names.\n * @property {function(string):string} [getBoneName] - A function for mapping bone names. Alternative to `names`.\n * @property {Array<number>} [trim] - Whether to trim the clip or not. If set the array should hold two values for the start and end.\n * @property {boolean} [preserveBoneMatrix=true] - Whether to preserve bone matrices or not.\n * @property {boolean} [preserveBonePositions=true] - Whether to preserve bone positions or not.\n * @property {boolean} [useTargetMatrix=false] - Whether to use the target matrix or not.\n * @property {string} [hip='hip'] - The name of the source's hip bone.\n * @property {Vector3} [hipInfluence=(1,1,1)] - The hip influence.\n * @property {number} [scale=1] - The scale.\n * @property {Object<string,Matrix4>} [localOffsets] - Per-bone local offset matrices, keyed by bone name.\n * @property {Vector3} [hipPosition] - An additional position offset applied to the hip bone.\n **/\n\nexport {\n\tretarget,\n\tretargetClip,\n\tclone,\n};\n"],
|
|
5
|
+
"mappings": "iGAgBA,SAASA,EAAaC,EAAMC,EAAU,CAErC,OAAKA,EAAQ,cAAgB,OAErBA,EAAQ,YAAaD,CAAK,EAI3BC,EAAQ,MAAOD,EAAK,IAAK,CAEjC,CAYA,SAASE,EAAUC,EAAQC,EAAQH,EAAU,CAAC,EAAI,CAEjD,IAAMI,EAAO,IA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C,EAAO,SAAW6C,EAEX7C,CAER,CAEA,SAASuC,EAAkBQ,EAAGC,EAAGC,EAAW,CAE3CA,EAAUF,EAAGC,CAAE,EAEf,QAAUlC,EAAI,EAAGA,EAAIiC,EAAE,SAAS,OAAQjC,IAEvCyB,EAAkBQ,EAAE,SAAUjC,CAAE,EAAGkC,EAAE,SAAUlC,CAAE,EAAGmC,CAAS,CAI/D",
|
|
6
|
+
"names": ["getBoneName", "bone", "options", "retarget", "target", "source", "quat", "Quaternion", "scale", "Vector3", "relativeMatrix", "Matrix4", "globalMatrix", "sourceBones", "getBones", "bones", "name", "boneTo", "bonesPosition", "i", "getBoneByName", "retargetClip", "clip", "track", "getHelperFromSkeleton", "numFrames", "delta", "convertedTracks", "mixer", "AnimationMixer", "boneDatas", "positionOffset", "boneData", "start", "end", "frame", "time", "j", "VectorKeyframeTrack", "QuaternionKeyframeTrack", "AnimationClip", "clone", "sourceLookup", "cloneLookup", "parallelTraverse", "sourceNode", "clonedNode", "node", "clonedMesh", "sourceMesh", "skeleton", "SkeletonHelper", "a", "b", "callback"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var g=Object.create;var f=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var j=Object.getPrototypeOf,k=Object.prototype.hasOwnProperty;var m=(b,a)=>()=>{try{return a||b((a={exports:{}}).exports,a),a.exports}catch(c){throw a=0,c}};var l=(b,a,c,e)=>{if(a&&typeof a=="object"||typeof a=="function")for(let d of i(a))!k.call(b,d)&&d!==c&&f(b,d,{get:()=>a[d],enumerable:!(e=h(a,d))||e.enumerable});return b};var n=(b,a,c)=>(c=b!=null?g(j(b)):{},l(a||!b||!b.__esModule?f(c,"default",{value:b,enumerable:!0}):c,b));export{m as a,n as b};
|
|
2
|
+
//# sourceMappingURL=chunk-FY3BTKY4.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{isCurve as w,sourceTimeAtSceneElapsed as N}from"@motionscript/core";var V=200;function _(o,t,e,n,u,f,d=a=>a){let a=s=>{let c=d(s);return Number.isFinite(c)?c:t.value};if(!w(e)){t.value=a(e);return}if(!Number.isFinite(u)||u<=0){t.value=a(e.staticValue(t.value));return}let l=n-f,h=e.resolve(u,t.value);if(h.length===0)return;let i=e.sampleAt(Math.max(0,f),u,t.value);t.setValueAtTime(a(i),n);for(let s of h){let c=l+s.startTime,r=l+s.endTime;if(r<=n||!Number.isFinite(c)||!Number.isFinite(r))continue;let p=s.endTime-s.startTime;if(p<=0){t.setValueAtTime(a(s.to),Math.max(c,n));continue}if(s.isLinear)t.setValueAtTime(a(s.from),Math.max(c,n)),t.linearRampToValueAtTime(a(s.to),r);else{let x=Math.max(2,Math.ceil(p*V)),m=new Float32Array(x);for(let g=0;g<x;g++){let M=g/(x-1);m[g]=a(s.from+(s.to-s.from)*s.ease(M))}let v=Math.max(c,n),y=r-v;y>0&&t.setValueCurveAtTime(m,v,y)}}}function b(o,t,e,n=o.currentTime,u=0,f=0){let d=[],a=[],l=t,h=s=>{l.connect(s),d.push(s),l=s},i=(s,c,r)=>_(o,s,c,n,u,f,r);for(let s of e)switch(s.type){case"gain":{let c=o.createGain();i(c.gain,s.value),h(c);break}case"highpass":case"lowpass":{let c=o.createBiquadFilter();c.type=s.type==="highpass"?"highpass":"lowpass",i(c.frequency,s.frequency),s.q!==void 0&&i(c.Q,s.q),h(c);break}case"tremolo":{let c=o.createGain(),r=o.createOscillator(),p=o.createGain();i(c.gain,s.depth,x=>1-S(x)/2),i(p.gain,s.depth,x=>S(x)/2),i(r.frequency,s.rate),r.connect(p),p.connect(c.gain),d.push(p),a.push(r),h(c);break}case"echo":{let c=l,r=o.createGain(),p=o.createGain();i(p.gain,s.mix??.5,g=>1-S(g)),c.connect(p),p.connect(r);let x=I(s.delay),m=o.createDelay(Math.max(1,x+1));i(m.delayTime,s.delay);let v=o.createGain();i(v.gain,s.feedback,g=>Math.max(0,Math.min(.99,g)));let y=o.createGain();i(y.gain,s.mix??.5,g=>S(g)),c.connect(m),m.connect(v),v.connect(m),m.connect(y),y.connect(r),d.push(p,m,v,y,r),l=r;break}case"speed":break}return{output:l,nodes:d,oscillators:a}}function S(o){return Math.max(0,Math.min(1,o))}function I(o){return w(o)?o.staticValue(0):o}function C(o){if(!o)return 1;let t=1;for(let e of o)e.type==="speed"&&!w(e.value)&&e.value>0&&(t*=e.value);return t}function G(o){if(o){for(let t of o)if(t.type==="speed"&&w(t.value))return t.value}}function F(o,t,e,n,u,f,d){if(!t)return;let a=1/V,l=Math.max(0,d),h=N(t,e,l);o.setValueAtTime(Math.max(1e-4,t.sampleAt(h,e,1)*u),f);for(let i=l+a;i<=n+a;i+=a){let s=Math.min(i,n),c=N(t,e,s),r=Math.max(1e-4,t.sampleAt(c,e,1)*u),p=f+(s-l);if(o.linearRampToValueAtTime(r,p),s>=n)break}}var A=class{ctx;destination;constructor(t,e){this.ctx=t,this.destination=e}inputFor(t,e){return!t||t.length===0?this.destination:this.chainFrom(t,0,e)}dispose(){for(let t of this.nodes)try{t.disconnect()}catch{}for(let t of this.oscillators)try{t.stop()}catch{}this.nodes.length=0,this.oscillators.length=0,this.inputs.clear()}inputs=new Map;nodes=[];oscillators=[];chainFrom(t,e,n){if(e>=t.length)return this.destination;let u=t[e],f=this.inputs.get(u.id);if(f)return f;let d=this.chainFrom(t,e+1,n),a=this.ctx.createGain();a.gain.value=1;let l=this.ctx.createGain();l.gain.value=u.mute?0:L(u);let h=b(this.ctx,a,u.filters??[],n,0,0);h.output.connect(l),l.connect(d),this.nodes.push(a,l,...h.nodes),this.oscillators.push(...h.oscillators);for(let i of h.oscillators)i.start(n);return this.inputs.set(u.id,a),a}};function L(o){let t=typeof o.volume=="number"?o.volume:1;return Number.isFinite(t)?t:1}import{sourceTimeAtSceneElapsed as W}from"@motionscript/core";var U=44100;function j(o,t){if(!t)return o;try{return t.getAudioMeta(o).src||o}catch{try{return t.getVideoMeta(o).src||o}catch{return o}}}async function Q(o,t){let n=await(await fetch(o)).arrayBuffer();return t.decodeAudioData(n)}async function z(o,t,e={}){if(o.length===0)return null;let n=e.sampleRate??U,u=Math.ceil(t*n);if(u<=0)return null;let f=[...new Set(o.map(i=>i.request.src))],d=new OfflineAudioContext(2,u,n),a=new Map;await Promise.all(f.map(async i=>{a.set(i,await Q(j(i,e.catalog),d))}));let l=new OfflineAudioContext(2,u,n),h=new A(l,l.destination);for(let{request:i,globalOffset:s}of o){let c=a.get(i.src);if(!c)continue;let r=s+i.startAt,x=Math.min(s+i.endAt,t)-r;if(x<=0)continue;let m=l.createBufferSource();m.buffer=c,m.loop=i.loop;let v=C(i.filters),y=Number.isFinite(v)&&v>0?v:1,g=G(i.filters);y!==1&&!g&&(m.playbackRate.value=y);let M=l.createGain();M.gain.value=Number.isFinite(i.volume)?i.volume:1;let R=Math.max(0,c.duration-i.trimStart),T=Number.isFinite(i.endAt)?Math.max(0,i.endAt-i.startAt):R/y,k=b(l,m,i.filters??[],r,T,0);k.output.connect(M),M.connect(h.inputFor(i.bus,r)),g&&F(m.playbackRate,g,R,T,y,r,0);let O=g?W(g,R,x):x*y;m.start(r,i.trimStart,O);for(let D of k.oscillators)D.start(r)}return l.startRendering()}var E=class{sampleRate;catalog;constructor(t=U,e){this.sampleRate=t,this.catalog=e}mix(t,e){return z(t,e,{sampleRate:this.sampleRate,catalog:this.catalog})}};function tt(o){let t=o.numberOfChannels,e=o.length,n=2,u=t*n,f=e*u,d=new ArrayBuffer(44+f),a=new DataView(d),l=(s,c)=>{for(let r=0;r<c.length;r++)a.setUint8(s+r,c.charCodeAt(r))};l(0,"RIFF"),a.setUint32(4,36+f,!0),l(8,"WAVE"),l(12,"fmt "),a.setUint32(16,16,!0),a.setUint16(20,1,!0),a.setUint16(22,t,!0),a.setUint32(24,o.sampleRate,!0),a.setUint32(28,o.sampleRate*u,!0),a.setUint16(32,u,!0),a.setUint16(34,8*n,!0),l(36,"data"),a.setUint32(40,f,!0);let h=[];for(let s=0;s<t;s++)h.push(o.getChannelData(s));let i=44;for(let s=0;s<e;s++)for(let c=0;c<t;c++){let r=Math.max(-1,Math.min(1,h[c][s]));a.setInt16(i,r<0?r*32768:r*32767,!0),i+=n}return new Uint8Array(d)}import{AudioSink as H,sourceTimeAtSceneElapsed as J}from"@motionscript/core";var B=class extends H{context;ownsContext;bufferCache=new Map;decoding=new Map;active=new Map;scheduled=[];disposed=!1;masterGain;buses;muted=!1;volume=1;constructor(t){super(),this.context=t??new AudioContext,this.ownsContext=!t,this.masterGain=this.context.createGain(),this.masterGain.connect(this.context.destination),this.buses=new A(this.context,this.masterGain)}getContext(){return this.context}unlock(){this.context.state==="suspended"&&this.context.resume()}has(t){return this.bufferCache.has(t)}async append(t,e){if(this.bufferCache.has(t))return;let n=this.decoding.get(t);if(n)return n;let u=this.context.decodeAudioData(e).then(f=>{this.bufferCache.set(t,f)}).finally(()=>{this.decoding.delete(t)});this.decoding.set(t,u),await u}retain(t){for(let e of[...this.bufferCache.keys()])t.has(e)||this.bufferCache.delete(e);for(let[e,n]of this.active)t.has(n.request.src)||this.stopSource(e,n)}schedule(t){let e=new Set(t.map(n=>n.id));for(let[n,u]of this.active)e.has(n)||this.stopSource(n,u);this.scheduled=t.slice()}syncTo(t){let e=new Set;for(let n of this.scheduled)if(t>=n.startAt&&t<n.endAt&&(e.add(n.id),!this.active.has(n.id))){let f=this.bufferCache.get(n.src);f&&this.playBuffer(f,n,t)}for(let[n,u]of this.active)e.has(n)||this.stopSource(n,u)}async play(t,e,n){this.context.state==="suspended"&&await this.context.resume(),this.syncTo(t)}stop(){for(let[t,e]of this.active)this.stopSource(t,e)}setMuted(t){this.muted=t,this.applyMasterGain()}setVolume(t){this.volume=Math.max(0,t),this.applyMasterGain()}applyMasterGain(){this.masterGain.gain.value=this.muted?0:this.volume}playBuffer(t,e,n){let u=this.context.createGain();u.gain.value=Number.isFinite(e.volume)?e.volume:1,u.connect(this.buses.inputFor(e.bus,this.context.currentTime));let f=this.context.createBufferSource();f.buffer=t,f.loop=e.loop;let d=C(e.filters),a=Number.isFinite(d)&&d>0?d:1,l=G(e.filters);a!==1&&!l&&(f.playbackRate.value=a);let h=Math.max(0,n-e.startAt),i=Math.max(0,t.duration-e.trimStart),s=isFinite(e.endAt)?Math.max(0,e.endAt-e.startAt):i/(a||1),c=this.context.currentTime,r=b(this.context,f,e.filters??[],c,s,h);r.output.connect(u);let p;l?(p=e.trimStart+J(l,i,h),F(f.playbackRate,l,i,s,a,c,h)):p=e.trimStart+h*a,f.start(c,p);for(let x of r.oscillators)x.start(c);f.onended=()=>{this.active.get(e.id)?.source===f&&this.active.delete(e.id)},this.active.set(e.id,{source:f,gainNode:u,request:e,filterNodes:r.nodes,oscillators:r.oscillators})}stopSource(t,e){try{e.source.onended=null,e.source.stop();for(let n of e.oscillators)n.stop();e.source.disconnect();for(let n of e.filterNodes)n.disconnect();e.gainNode.disconnect()}catch{}this.active.delete(t)}dispose(){if(!this.disposed){this.disposed=!0,super.dispose(),this.bufferCache.clear(),this.decoding.clear(),this.scheduled.length=0,this.buses.dispose();try{this.masterGain.disconnect()}catch{}this.ownsContext&&this.context.state!=="closed"&&this.context.close()}}};export{A as a,U as b,z as c,E as d,tt as e,B as f};
|
|
2
|
+
//# sourceMappingURL=chunk-NSFLRI4P.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/audio/filter-graph.ts", "../../../src/audio/bus-graph.ts", "../../../src/audio/mixer.ts", "../../../src/audio/player.ts"],
|
|
4
|
+
"sourcesContent": ["import { AudioFilterItem, Param, isCurve, sourceTimeAtSceneElapsed } from \"@motionscript/core\";\n\n/**\n * Result of building an audio-filter graph for one source.\n *\n * - `output` is the last node in the chain; connect it downstream (e.g. to the\n * per-request gain node).\n * - `nodes` are every intermediate node, so callers can `disconnect()` them on\n * teardown.\n * - `oscillators` are LFOs (from `tremolo`) the caller must `start()` — and may\n * `stop()` — alongside the source, since oscillators need an explicit start.\n */\nexport interface AudioFilterGraph {\n output: AudioNode;\n nodes: AudioNode[];\n oscillators: OscillatorNode[];\n}\n\n/**\n * How many sample points per second to bake an eased curve segment into for\n * `setValueCurveAtTime`. 200/s (≈ every 5ms) is smooth to the ear and cheap.\n */\nconst CURVE_SAMPLES_PER_SECOND = 200;\n\n/**\n * Apply a (possibly time-varying) {@link Param} to a Web Audio {@link AudioParam}.\n *\n * - **number** → set once (today's behavior; zero scheduling overhead).\n * - **Curve** → resolve against `clipDuration` and schedule each segment:\n * - linear segments via `setValueAtTime` + `linearRampToValueAtTime`,\n * - eased segments baked into a `Float32Array` via `setValueCurveAtTime`.\n *\n * `elapsed` (scene-seconds already played when a mid-clip seek starts the source)\n * shifts the schedule back by `elapsed` so \"now\" reads the curve's value at the\n * clip's *current* position, not its start. A `clamp(v)` hook lets a param keep a\n * valid range (e.g. echo mix 0–1) at every sampled point.\n */\nfunction applyParam(\n ctx: BaseAudioContext,\n audioParam: AudioParam,\n param: Param,\n startTime: number,\n clipDuration: number,\n elapsed: number,\n clamp: (v: number) => number = (v) => v,\n): void {\n // Coerce to a finite value before touching an AudioParam — the platform throws\n // on NaN/Infinity. Falls back to the current param value (never undefined here).\n const finite = (v: number): number => {\n const c = clamp(v);\n return Number.isFinite(c) ? c : audioParam.value;\n };\n\n if (!isCurve(param)) {\n audioParam.value = finite(param);\n return;\n }\n\n // A non-finite clip length yields no usable schedule; hold the curve's start value.\n if (!Number.isFinite(clipDuration) || clipDuration <= 0) {\n audioParam.value = finite(param.staticValue(audioParam.value));\n return;\n }\n\n const base = startTime - elapsed; // map curve t=0 to here so seeks line up\n const resolved = param.resolve(clipDuration, audioParam.value);\n if (resolved.length === 0) return;\n\n // Anchor the starting value at `startTime` (the seek point) so there is no\n // jump from the param's default before the first scheduled segment runs.\n const startValue = param.sampleAt(Math.max(0, elapsed), clipDuration, audioParam.value);\n audioParam.setValueAtTime(finite(startValue), startTime);\n\n for (const seg of resolved) {\n const segStart = base + seg.startTime;\n const segEnd = base + seg.endTime;\n // Skip segments wholly in the past relative to the seek point, or any with a\n // non-finite boundary (degenerate resolve) that would throw on schedule.\n if (segEnd <= startTime || !Number.isFinite(segStart) || !Number.isFinite(segEnd)) continue;\n\n const span = seg.endTime - seg.startTime;\n\n if (span <= 0) {\n audioParam.setValueAtTime(finite(seg.to), Math.max(segStart, startTime));\n continue;\n }\n\n if (seg.isLinear) {\n audioParam.setValueAtTime(finite(seg.from), Math.max(segStart, startTime));\n audioParam.linearRampToValueAtTime(finite(seg.to), segEnd);\n } else {\n const count = Math.max(2, Math.ceil(span * CURVE_SAMPLES_PER_SECOND));\n const samples = new Float32Array(count);\n for (let i = 0; i < count; i++) {\n const local = i / (count - 1);\n samples[i] = finite(seg.from + (seg.to - seg.from) * seg.ease(local));\n }\n // setValueCurveAtTime can't start in the past; clamp the start forward.\n const curveStart = Math.max(segStart, startTime);\n const curveDur = segEnd - curveStart;\n if (curveDur > 0) audioParam.setValueCurveAtTime(samples, curveStart, curveDur);\n }\n }\n}\n\n/**\n * Builds the Web Audio graph for a clip's filter chain, returning the node to\n * connect downstream. Shared by live playback ({@link WebAudioSink}) and\n * offline export (`mixAudio`) so both paths sound identical.\n *\n * Filters apply in array order (index 0 closest to the source). `speed` filters\n * are intentionally ignored here — they're realized via `source.playbackRate`\n * by the caller (and affect timeline scheduling), not as a graph node.\n *\n * `startTime` is the AudioContext time the source starts; `clipDuration` is the\n * clip's scene-time length; `elapsed` is scene-seconds already played at a mid-clip\n * seek (0 for a clean start). These let curve-valued params schedule and align.\n *\n * Pass the already-created `source` so its `playbackRate` can be set by the\n * caller; this function only wires nodes *after* the source.\n */\nexport function buildAudioFilterGraph(\n ctx: BaseAudioContext,\n source: AudioNode,\n filters: readonly AudioFilterItem[],\n startTime: number = ctx.currentTime,\n clipDuration: number = 0,\n elapsed: number = 0,\n): AudioFilterGraph {\n const nodes: AudioNode[] = [];\n const oscillators: OscillatorNode[] = [];\n let cursor: AudioNode = source;\n\n const series = (node: AudioNode): void => {\n cursor.connect(node);\n nodes.push(node);\n cursor = node;\n };\n\n const apply = (p: AudioParam, v: Param, clamp?: (n: number) => number): void =>\n applyParam(ctx, p, v, startTime, clipDuration, elapsed, clamp);\n\n for (const filter of filters) {\n switch (filter.type) {\n case \"gain\": {\n const gain = ctx.createGain();\n apply(gain.gain, filter.value);\n series(gain);\n break;\n }\n case \"highpass\":\n case \"lowpass\": {\n const biquad = ctx.createBiquadFilter();\n biquad.type = filter.type === \"highpass\" ? \"highpass\" : \"lowpass\";\n apply(biquad.frequency, filter.frequency);\n if (filter.q !== undefined) apply(biquad.Q, filter.q);\n series(biquad);\n break;\n }\n case \"tremolo\": {\n // Carrier gain whose value is modulated by an LFO. With depth d the\n // carrier base = (1 - d/2) and the LFO swing gain = d/2. The clamp\n // hook applies these transforms whether depth is scalar or a curve.\n const carrier = ctx.createGain();\n const lfo = ctx.createOscillator();\n const lfoDepth = ctx.createGain();\n\n apply(carrier.gain, filter.depth, (d) => 1 - clamp01(d) / 2);\n apply(lfoDepth.gain, filter.depth, (d) => clamp01(d) / 2);\n apply(lfo.frequency, filter.rate);\n\n lfo.connect(lfoDepth);\n lfoDepth.connect(carrier.gain);\n\n nodes.push(lfoDepth);\n oscillators.push(lfo);\n series(carrier);\n break;\n }\n case \"echo\": {\n // Dry + wet split. The wet path is a delay with feedback; both sum\n // into a merge node that becomes the new cursor.\n const split = cursor;\n const merge = ctx.createGain();\n\n const dry = ctx.createGain();\n apply(dry.gain, filter.mix ?? 0.5, (m) => 1 - clamp01(m));\n split.connect(dry);\n dry.connect(merge);\n\n // Delay buffer must accommodate the max delay; size from the static value.\n const maxDelay = staticOf(filter.delay);\n const delay = ctx.createDelay(Math.max(1, maxDelay + 1));\n apply(delay.delayTime, filter.delay);\n const feedbackGain = ctx.createGain();\n apply(feedbackGain.gain, filter.feedback, (f) => Math.max(0, Math.min(0.99, f)));\n const wet = ctx.createGain();\n apply(wet.gain, filter.mix ?? 0.5, (m) => clamp01(m));\n\n split.connect(delay);\n delay.connect(feedbackGain);\n feedbackGain.connect(delay); // feedback loop\n delay.connect(wet);\n wet.connect(merge);\n\n nodes.push(dry, delay, feedbackGain, wet, merge);\n cursor = merge;\n break;\n }\n case \"speed\":\n // Realized via source.playbackRate by the caller; no graph node.\n break;\n }\n }\n\n return { output: cursor, nodes, oscillators };\n}\n\n/** Clamp to [0, 1]. */\nfunction clamp01(v: number): number {\n return Math.max(0, Math.min(1, v));\n}\n\n/** The static/representative number of a param (number itself, or curve's t=0 value). */\nfunction staticOf(p: Param): number {\n return isCurve(p) ? p.staticValue(0) : p;\n}\n\n/**\n * Net *constant* playback-rate multiplier from any scalar `speed` filters in the\n * chain (product of all), defaulting to 1. Curve-valued speeds contribute 1 here\n * and are scheduled separately by {@link applySpeedToPlaybackRate}. Mirrors\n * `Sound.effectiveSpeed()` so the renderer applies the same rate the core timeline\n * reserved time for.\n */\nexport function effectiveSpeed(filters: readonly AudioFilterItem[] | undefined): number {\n if (!filters) return 1;\n let speed = 1;\n for (const f of filters) {\n if (f.type === \"speed\" && !isCurve(f.value) && f.value > 0) speed *= f.value;\n }\n return speed;\n}\n\n/** The first curve-valued `speed` filter in the chain, if any. */\nexport function speedCurveOf(filters: readonly AudioFilterItem[] | undefined) {\n if (!filters) return undefined;\n for (const f of filters) {\n if (f.type === \"speed\" && isCurve(f.value)) return f.value;\n }\n return undefined;\n}\n\n/**\n * Schedule a time-varying speed curve onto an `AudioBufferSourceNode.playbackRate`.\n *\n * The curve is authored over **source time** (rate as a function of how far through\n * the source we've played). `setValueAtTime`/`linearRampToValueAtTime` schedule in\n * **context time**, so we walk scene-time forward in small steps, convert each to a\n * source-time offset via the integral inverse, read the curve there, and lay down a\n * value point at the matching context time. `scalar` folds in any constant speed\n * filters (they scale the whole rate uniformly).\n *\n * `elapsed` is scene-seconds already played at a mid-clip seek, so the schedule\n * starts at the seek point and aligns the playbackRate to the clip's true position.\n */\nexport function applySpeedToPlaybackRate(\n rate: AudioParam,\n curve: ReturnType<typeof speedCurveOf>,\n sourceLength: number,\n sceneDuration: number,\n scalar: number,\n startTime: number,\n elapsed: number,\n): void {\n if (!curve) return;\n const step = 1 / CURVE_SAMPLES_PER_SECOND; // scene-time sampling step\n let scene = Math.max(0, elapsed);\n // Seed the value exactly at the seek point.\n const seedSrc = sourceTimeAtSceneElapsed(curve, sourceLength, scene);\n rate.setValueAtTime(Math.max(1e-4, curve.sampleAt(seedSrc, sourceLength, 1) * scalar), startTime);\n\n for (let s = scene + step; s <= sceneDuration + step; s += step) {\n const clampedScene = Math.min(s, sceneDuration);\n const srcT = sourceTimeAtSceneElapsed(curve, sourceLength, clampedScene);\n const value = Math.max(1e-4, curve.sampleAt(srcT, sourceLength, 1) * scalar);\n const ctxTime = startTime + (clampedScene - scene);\n rate.linearRampToValueAtTime(value, ctxTime);\n if (clampedScene >= sceneDuration) break;\n }\n}\n", "import type { AudioBusStop } from \"@motionscript/core\";\nimport { buildAudioFilterGraph } from \"./filter-graph\";\n\n/**\n * The live chains for one audio context's buses.\n *\n * Held per context rather than per clip, because that is the whole difference\n * between a bus and per-clip processing: every clip naming a bus connects into\n * the *same* nodes, so a reverb on a bus is one tail the group shares rather\n * than one tail each. Flattening the levels into per-clip gain would sound\n * right; flattening the effects would not.\n */\nexport class AudioBusGraph {\n constructor(\n private readonly ctx: BaseAudioContext,\n /** Where the last bus in a chain connects — the master, or the destination. */\n private readonly destination: AudioNode,\n ) { }\n\n /**\n * The input node a clip on `bus` should connect to, building the chain the\n * first time it is asked for.\n *\n * `bus` is source-adjacent first, so `bus[0]` is the one the clip feeds and\n * each stop after it is that bus's own parent. An empty or absent chain\n * returns the destination, which is what every clip did before buses\n * existed.\n */\n inputFor(bus: readonly AudioBusStop[] | undefined, startTime: number): AudioNode {\n if (!bus || bus.length === 0) return this.destination;\n return this.chainFrom(bus, 0, startTime);\n }\n\n /** Disconnect every live bus node. Safe to call more than once. */\n dispose(): void {\n for (const node of this.nodes) {\n try { node.disconnect(); } catch { /* already torn down */ }\n }\n for (const osc of this.oscillators) {\n try { osc.stop(); } catch { /* never started, or already stopped */ }\n }\n this.nodes.length = 0;\n this.oscillators.length = 0;\n this.inputs.clear();\n }\n\n private readonly inputs = new Map<string, AudioNode>();\n private readonly nodes: AudioNode[] = [];\n private readonly oscillators: OscillatorNode[] = [];\n\n /**\n * Build (or reuse) the chain for `bus[index]`, connected to whatever\n * `bus[index + 1]` resolves to.\n *\n * Recursive rather than iterative because a bus's *output* has to exist\n * before its own nodes can connect to it, and the outermost bus is the last\n * entry.\n */\n private chainFrom(bus: readonly AudioBusStop[], index: number, startTime: number): AudioNode {\n if (index >= bus.length) return this.destination;\n\n const stop = bus[index];\n const existing = this.inputs.get(stop.id);\n if (existing) return existing;\n\n const output = this.chainFrom(bus, index + 1, startTime);\n\n // A pass-through head every clip connects to, so the bus has one input\n // whatever its filters turn out to be.\n const input = this.ctx.createGain();\n input.gain.value = 1;\n\n const level = this.ctx.createGain();\n level.gain.value = stop.mute ? 0 : levelOf(stop);\n\n // `clipDuration` is 0 and `elapsed` 0: a bus is not a clip, so a curve on\n // one is authored against the timeline rather than against a source's\n // length. `applyParam` resolves a curve of its own duration from that.\n const graph = buildAudioFilterGraph(this.ctx, input, stop.filters ?? [], startTime, 0, 0);\n graph.output.connect(level);\n level.connect(output);\n\n this.nodes.push(input, level, ...graph.nodes);\n this.oscillators.push(...graph.oscillators);\n for (const osc of graph.oscillators) osc.start(startTime);\n\n this.inputs.set(stop.id, input);\n return input;\n }\n}\n\n/**\n * A bus's gain as a plain number.\n *\n * A curve-valued bus level is scheduled by the filter chain a bus carries, not\n * here: this node is created once for the whole bus and shared by every clip on\n * it, so there is no single clip start to resolve a curve against. Authoring a\n * bus fade as `filters: AudioFilters.gain(fadeOut(1))` puts it on the chain,\n * where it is scheduled against the context clock like any other.\n */\nfunction levelOf(stop: AudioBusStop): number {\n const value = typeof stop.volume === \"number\" ? stop.volume : 1;\n return Number.isFinite(value) ? value : 1;\n}\n", "import { sourceTimeAtSceneElapsed, type AssetCatalog } from \"@motionscript/core\";\nimport type { AudioMixer, ScheduledAudioRequest } from \"@motionscript/skia-render/export\";\nimport { AudioBusGraph } from \"./bus-graph\";\nimport {\n applySpeedToPlaybackRate,\n buildAudioFilterGraph,\n effectiveSpeed,\n speedCurveOf,\n} from \"./filter-graph\";\n\n/** Sample rate used when the caller doesn't pick one. */\nexport const DEFAULT_SAMPLE_RATE = 44100;\n\nexport interface MixAudioOptions {\n /** Defaults to {@link DEFAULT_SAMPLE_RATE}. */\n sampleRate?: number;\n /**\n * Resolves a request's `src` to the address its bytes live at, the same job\n * `WebStorageAdapter.assetUrl` does for the live paths. Omitted, a `src` is\n * fetched as written — right only while the host keys its manifest by URL.\n */\n catalog?: AssetCatalog;\n}\n\n/** Audio first, then video: a clip's own soundtrack is requested under the video's key. */\nfunction audioUrl(src: string, catalog: AssetCatalog | undefined): string {\n if (!catalog) return src;\n try {\n return catalog.getAudioMeta(src).src || src;\n } catch {\n try {\n return catalog.getVideoMeta(src).src || src;\n } catch {\n return src;\n }\n }\n}\n\n/** Fetches and decodes an audio source against a scratch `OfflineAudioContext` (decoding requires a context but doesn't render through it). */\nasync function fetchAudioBuffer(src: string, ctx: OfflineAudioContext): Promise<AudioBuffer> {\n const response = await fetch(src);\n const arrayBuffer = await response.arrayBuffer();\n return ctx.decodeAudioData(arrayBuffer);\n}\n\n/**\n * Render every scheduled request into one timeline-length buffer.\n *\n * An `OfflineAudioContext` graph — gain per request, looping/trimming, and the\n * same filter chain the live {@link WebAudioSink} builds — rendered in one\n * pass rather than scheduled per frame.\n *\n * Shared by the video exporter and by `mixTimelineAudio`, deliberately: a split\n * export and a whole one have to be the same mix, and two implementations of\n * \"stack these clips\" would eventually disagree.\n *\n * Curve-valued filter params and `speed` curves schedule here exactly as they do\n * in {@link WebAudioSink.playBuffer}, which is the reference implementation —\n * the two must be read side by side when either changes.\n *\n * One deliberate difference: this schedules at absolute context times, so clip\n * starts are sample-accurate here and quantized to `1/fps` in live playback,\n * which starts sources at `currentTime` on a clock tick.\n */\nexport async function mixAudio(\n requests: readonly ScheduledAudioRequest[],\n totalDuration: number,\n options: MixAudioOptions = {},\n): Promise<AudioBuffer | null> {\n if (requests.length === 0) return null;\n const sampleRate = options.sampleRate ?? DEFAULT_SAMPLE_RATE;\n const frames = Math.ceil(totalDuration * sampleRate);\n if (frames <= 0) return null;\n\n const uniqueSrcs = [...new Set(requests.map(r => r.request.src))];\n const scratchCtx = new OfflineAudioContext(2, frames, sampleRate);\n\n const decoded = new Map<string, AudioBuffer>();\n await Promise.all(uniqueSrcs.map(async (src) => {\n decoded.set(src, await fetchAudioBuffer(audioUrl(src, options.catalog), scratchCtx));\n }));\n\n const mixCtx = new OfflineAudioContext(2, frames, sampleRate);\n // The same shared-chain rule the live device uses, for the same reason: an\n // export that flattened buses into per-clip processing would not match what\n // the preview sounded like.\n const buses = new AudioBusGraph(mixCtx, mixCtx.destination);\n\n for (const { request: req, globalOffset } of requests) {\n const srcBuffer = decoded.get(req.src);\n if (!srcBuffer) continue;\n\n const globalStart = globalOffset + req.startAt;\n // `endAt` is `Infinity` for an open clip; either way the timeline bounds it.\n const globalEnd = Math.min(globalOffset + req.endAt, totalDuration);\n const playDuration = globalEnd - globalStart;\n if (playDuration <= 0) continue;\n\n const source = mixCtx.createBufferSource();\n source.buffer = srcBuffer;\n source.loop = req.loop;\n\n const scalarSpeed = effectiveSpeed(req.filters);\n const rate = Number.isFinite(scalarSpeed) && scalarSpeed > 0 ? scalarSpeed : 1;\n const speedCurve = speedCurveOf(req.filters);\n // With a curve the scalar is folded into the scheduled ramp below, so\n // setting it here as well would apply it twice.\n if (rate !== 1 && !speedCurve) source.playbackRate.value = rate;\n\n const gain = mixCtx.createGain();\n gain.gain.value = Number.isFinite(req.volume) ? req.volume : 1;\n\n // The trimmed source length the filter and speed curves are authored over.\n const sourceLength = Math.max(0, srcBuffer.duration - req.trimStart);\n // The clip's own scene-time length — what a curve resolves against.\n // Deliberately *not* `playDuration`, which is that length truncated by the\n // timeline end: resolving against the truncated value would squeeze the\n // whole curve into the surviving part instead of cutting it off.\n const clipDuration = Number.isFinite(req.endAt)\n ? Math.max(0, req.endAt - req.startAt)\n : sourceLength / rate;\n\n // Filter chain sits between the source and the per-request gain, matching\n // the live WebAudioSink graph so exports sound identical to preview.\n // Passing the start time and clip duration is what lets curve-valued params\n // schedule — with the defaults they collapse to a single static value.\n // `elapsed` is 0: unlike a live seek, the mix always starts a clip at its\n // own beginning.\n const graph = buildAudioFilterGraph(\n mixCtx, source, req.filters ?? [], globalStart, clipDuration, 0,\n );\n graph.output.connect(gain);\n gain.connect(buses.inputFor(req.bus, globalStart));\n\n if (speedCurve) {\n applySpeedToPlaybackRate(\n source.playbackRate, speedCurve, sourceLength, clipDuration, rate, globalStart, 0,\n );\n }\n\n // start()'s 3rd arg is a source-buffer duration. A constant rate scales it\n // linearly, but under a speed curve the buffer consumed over a span of\n // scene time is the integral of the rate, not a multiple of it.\n const consumed = speedCurve\n ? sourceTimeAtSceneElapsed(speedCurve, sourceLength, playDuration)\n : playDuration * rate;\n\n source.start(globalStart, req.trimStart, consumed);\n for (const osc of graph.oscillators) osc.start(globalStart);\n }\n\n return mixCtx.startRendering();\n}\n\n/**\n * Adapter presenting {@link mixAudio} as the exporter's injected mixer seam.\n *\n * The sample rate is a constructor argument rather than a third `mix` parameter\n * because {@link AudioMixer} — the seam `renderTimeline` calls through — takes\n * exactly two, so anything passed as a third would be silently dropped. Fixing\n * it here rather than widening the interface keeps the rate a property of *this*\n * mixer, which is whose business it is.\n */\nexport class WebAudioMixer implements AudioMixer<AudioBuffer> {\n constructor(\n private readonly sampleRate: number = DEFAULT_SAMPLE_RATE,\n private readonly catalog?: AssetCatalog,\n ) { }\n\n mix(\n requests: readonly ScheduledAudioRequest[],\n totalDuration: number,\n ): Promise<AudioBuffer | null> {\n return mixAudio(requests, totalDuration, {\n sampleRate: this.sampleRate,\n catalog: this.catalog,\n });\n }\n}\n\n/**\n * Encode an `AudioBuffer` as a 16-bit PCM WAV.\n *\n * The only other encoder in this package is the AAC track inside the mp4 muxer,\n * which is reachable solely by exporting a video — so without this a mixdown has\n * no file representation at all. WAV because it needs no codec support and is\n * lossless; a host wanting mp3/aac can re-encode from here.\n */\nexport function encodeWav(buffer: AudioBuffer): Uint8Array<ArrayBuffer> {\n const channelCount = buffer.numberOfChannels;\n const frameCount = buffer.length;\n const bytesPerSample = 2;\n const blockAlign = channelCount * bytesPerSample;\n const dataBytes = frameCount * blockAlign;\n\n const out = new ArrayBuffer(44 + dataBytes);\n const view = new DataView(out);\n\n const ascii = (offset: number, text: string) => {\n for (let i = 0; i < text.length; i++) view.setUint8(offset + i, text.charCodeAt(i));\n };\n\n ascii(0, \"RIFF\");\n view.setUint32(4, 36 + dataBytes, true);\n ascii(8, \"WAVE\");\n ascii(12, \"fmt \");\n view.setUint32(16, 16, true); // PCM header length\n view.setUint16(20, 1, true); // format: PCM\n view.setUint16(22, channelCount, true);\n view.setUint32(24, buffer.sampleRate, true);\n view.setUint32(28, buffer.sampleRate * blockAlign, true);\n view.setUint16(32, blockAlign, true);\n view.setUint16(34, 8 * bytesPerSample, true);\n ascii(36, \"data\");\n view.setUint32(40, dataBytes, true);\n\n // Pull each channel out once — getChannelData is a live view, but calling it\n // per sample inside the interleave loop is measurably slower.\n const channels: Float32Array[] = [];\n for (let c = 0; c < channelCount; c++) channels.push(buffer.getChannelData(c));\n\n let offset = 44;\n for (let frame = 0; frame < frameCount; frame++) {\n for (let c = 0; c < channelCount; c++) {\n // Clamp before scaling: the mix bus can exceed [-1,1] where clips\n // overlap, and letting that wrap turns a loud passage into noise.\n const sample = Math.max(-1, Math.min(1, channels[c][frame]));\n view.setInt16(offset, sample < 0 ? sample * 0x8000 : sample * 0x7fff, true);\n offset += bytesPerSample;\n }\n }\n\n return new Uint8Array(out);\n}\n", "import { AudioSink, AudioRequest, sourceTimeAtSceneElapsed } from \"@motionscript/core\";\nimport { AudioBusGraph } from \"./bus-graph\";\nimport { buildAudioFilterGraph, effectiveSpeed, speedCurveOf, applySpeedToPlaybackRate } from \"./filter-graph\";\n\ntype ActiveSource = {\n source: AudioBufferSourceNode;\n gainNode: GainNode;\n request: AudioRequest;\n /** Filter-graph nodes to disconnect on teardown. */\n filterNodes: AudioNode[];\n /** Tremolo LFOs to stop on teardown. */\n oscillators: OscillatorNode[];\n};\n\n/**\n * Web Audio implementation of {@link AudioSink} — decodes and caches source\n * buffers, then schedules/plays {@link AudioRequest}s as `AudioBufferSourceNode`s\n * through a shared master gain (global mute and volume). `schedule` registers the\n * active set of requests for the current frame; `syncTo` then starts/stops\n * sources to match `sceneTime`, so playback follows scrubbing and seeks.\n */\nexport class WebAudioSink extends AudioSink {\n private context: AudioContext;\n private ownsContext: boolean;\n private bufferCache = new Map<string, AudioBuffer>();\n private decoding = new Map<string, Promise<void>>();\n private active = new Map<string, ActiveSource>();\n private scheduled: AudioRequest[] = [];\n private disposed: boolean = false;\n private masterGain: GainNode;\n /** The live bus chains, shared across every clip that names one. */\n private buses: AudioBusGraph;\n private muted = false;\n private volume = 1;\n\n constructor(context?: AudioContext) {\n super();\n this.context = context ?? new AudioContext();\n this.ownsContext = !context;\n this.masterGain = this.context.createGain();\n this.masterGain.connect(this.context.destination);\n this.buses = new AudioBusGraph(this.context, this.masterGain);\n }\n\n getContext(): AudioContext {\n return this.context;\n }\n\n /**\n * Resume the AudioContext. Must be called from within a user gesture\n * (e.g. a click handler) the first time, or browsers keep the context\n * suspended and no audio is heard.\n */\n unlock(): void {\n if (this.context.state === \"suspended\") {\n this.context.resume();\n }\n }\n\n has(src: string): boolean {\n return this.bufferCache.has(src);\n }\n\n async append(src: string, data: ArrayBuffer): Promise<void> {\n if (this.bufferCache.has(src)) return;\n const existing = this.decoding.get(src);\n if (existing) return existing;\n\n // decodeAudioData detaches `data` — that's fine, the caller in\n // AssetManager.fetchAudio discards its reference immediately after\n // awaiting append. Skipping the defensive .slice(0) saves a multi-MB\n // allocation per audio source.\n const job = this.context.decodeAudioData(data).then((buffer) => {\n this.bufferCache.set(src, buffer);\n }).finally(() => {\n this.decoding.delete(src);\n });\n this.decoding.set(src, job);\n await job;\n }\n\n /** Drops cached buffers and stops active sources for srcs/requests no longer referenced — called when the asset set changes (e.g. seeking across scene boundaries). */\n retain(keep: ReadonlySet<string>): void {\n for (const src of [...this.bufferCache.keys()]) {\n if (!keep.has(src)) this.bufferCache.delete(src);\n }\n for (const [id, active] of this.active) {\n if (!keep.has(active.request.src)) this.stopSource(id, active);\n }\n }\n\n /** Replaces the active request set; stops any currently-playing source whose request is no longer scheduled. Actual start/stop-to-match-time happens in `syncTo`. */\n schedule(requests: readonly AudioRequest[]): void {\n const next = new Set(requests.map(r => r.id));\n for (const [id, active] of this.active) {\n if (!next.has(id)) this.stopSource(id, active);\n }\n this.scheduled = requests.slice();\n }\n\n /** Starts sources whose `[startAt, endAt)` window now contains `sceneTime` (computing the correct buffer offset for the seek point) and stops any that have fallen outside it. */\n syncTo(sceneTime: number): void {\n const liveIds = new Set<string>();\n\n for (const req of this.scheduled) {\n // `endAt` is `Infinity` for an open clip, so the comparison needs no\n // nullish fallback — see AudioRequest.endAt.\n const isInWindow = sceneTime >= req.startAt && sceneTime < req.endAt;\n if (!isInWindow) continue;\n\n liveIds.add(req.id);\n if (!this.active.has(req.id)) {\n const buffer = this.bufferCache.get(req.src);\n if (buffer) this.playBuffer(buffer, req, sceneTime);\n }\n }\n\n for (const [id, active] of this.active) {\n if (!liveIds.has(id)) this.stopSource(id, active);\n }\n }\n\n async play(time: number, _speed: number, _reverse: boolean): Promise<void> {\n if (this.context.state === \"suspended\") {\n await this.context.resume();\n }\n this.syncTo(time);\n }\n\n stop(): void {\n for (const [id, active] of this.active) {\n this.stopSource(id, active);\n }\n }\n\n setMuted(muted: boolean): void {\n this.muted = muted;\n this.applyMasterGain();\n }\n\n setVolume(volume: number): void {\n this.volume = Math.max(0, volume);\n this.applyMasterGain();\n }\n\n /** Mute and volume are held separately so unmuting restores the set level. */\n private applyMasterGain(): void {\n this.masterGain.gain.value = this.muted ? 0 : this.volume;\n }\n\n /** Starts a buffer source mid-clip if `sceneTime` lands after the request's start — `audioOffset` accounts for the request's trim, the elapsed time since `startAt`, and any speed (playbackRate) change. */\n private playBuffer(buffer: AudioBuffer, req: AudioRequest, sceneTime: number): void {\n const gainNode = this.context.createGain();\n // Guard against a missing/NaN volume — a non-finite AudioParam value throws.\n gainNode.gain.value = Number.isFinite(req.volume) ? req.volume : 1;\n // Into this clip's bus chain, or straight to the master when it has none.\n // The chain is shared: two clips on one bus reach the same nodes, which is\n // what makes a bus effect one tail rather than one per clip.\n gainNode.connect(this.buses.inputFor(req.bus, this.context.currentTime));\n\n const source = this.context.createBufferSource();\n source.buffer = buffer;\n source.loop = req.loop;\n\n const scalarSpeed = effectiveSpeed(req.filters);\n const rate = Number.isFinite(scalarSpeed) && scalarSpeed > 0 ? scalarSpeed : 1;\n const speedCurve = speedCurveOf(req.filters);\n if (rate !== 1 && !speedCurve) source.playbackRate.value = rate;\n\n const elapsed = Math.max(0, sceneTime - req.startAt);\n // Trimmed source length the filter curves / speed curve are authored over.\n const sourceLength = Math.max(0, buffer.duration - req.trimStart);\n // Scene-time length of the clip. Prefer the bounded [startAt, endAt) span; if\n // endAt is unbounded (an open/looping clip reaching the device unresolved),\n // fall back to the source length scaled by speed so curve params still resolve\n // (a clipDuration of 0 would otherwise silently drop every fade/sweep).\n const clipDuration = isFinite(req.endAt)\n ? Math.max(0, req.endAt - req.startAt)\n : sourceLength / (rate || 1);\n\n // Insert the filter chain between the source and the per-request gain. Pass\n // the start time, clip duration, and elapsed so curve-valued params schedule\n // and align to a mid-clip seek.\n const startTime = this.context.currentTime;\n const graph = buildAudioFilterGraph(\n this.context, source, req.filters ?? [], startTime, clipDuration, elapsed,\n );\n graph.output.connect(gainNode);\n\n // Source-time offset for a mid-clip seek. Scalar speed scales linearly; a\n // speed curve uses the integral inverse to find the true source position.\n let audioOffset: number;\n if (speedCurve) {\n audioOffset = req.trimStart + sourceTimeAtSceneElapsed(speedCurve, sourceLength, elapsed);\n // Schedule the time-varying playbackRate (folds in any scalar speed too).\n applySpeedToPlaybackRate(\n source.playbackRate, speedCurve, sourceLength, clipDuration, rate, startTime, elapsed,\n );\n } else {\n audioOffset = req.trimStart + elapsed * rate;\n }\n\n source.start(startTime, audioOffset);\n for (const osc of graph.oscillators) osc.start(startTime);\n\n source.onended = () => {\n if (this.active.get(req.id)?.source === source) {\n this.active.delete(req.id);\n }\n };\n\n this.active.set(req.id, {\n source,\n gainNode,\n request: req,\n filterNodes: graph.nodes,\n oscillators: graph.oscillators,\n });\n }\n\n private stopSource(id: string, active: ActiveSource): void {\n try {\n active.source.onended = null;\n active.source.stop();\n for (const osc of active.oscillators) osc.stop();\n active.source.disconnect();\n for (const node of active.filterNodes) node.disconnect();\n active.gainNode.disconnect();\n } catch {\n // already stopped\n }\n this.active.delete(id);\n }\n\n dispose(): void {\n if (this.disposed) return;\n this.disposed = true;\n super.dispose();\n this.bufferCache.clear();\n this.decoding.clear();\n this.scheduled.length = 0;\n this.buses.dispose();\n try {\n this.masterGain.disconnect();\n } catch {\n // already disconnected\n }\n if (this.ownsContext && this.context.state !== \"closed\") {\n this.context.close();\n }\n }\n}\n"],
|
|
5
|
+
"mappings": "AAAA,OAAiC,WAAAA,EAAS,4BAAAC,MAAgC,qBAsB1E,IAAMC,EAA2B,IAejC,SAASC,EACLC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EAAgCC,GAAMA,EAAC,CAIvC,IAAMC,EAAUD,GAAqB,CACjC,IAAM,EAAID,EAAMC,CAAC,EACjB,OAAO,OAAO,SAAS,CAAC,EAAI,EAAIN,EAAW,KAC/C,EAEA,GAAI,CAACL,EAAQM,CAAK,EAAG,CACjBD,EAAW,MAAQO,EAAON,CAAK,EAC/B,MACJ,CAGA,GAAI,CAAC,OAAO,SAASE,CAAY,GAAKA,GAAgB,EAAG,CACrDH,EAAW,MAAQO,EAAON,EAAM,YAAY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AASN,EACT,YAAaiB,EAAM,MACnB,YAAaA,EAAM,YACtB,CACL,CAEQ,WAAWxB,EAAYC,EAAoB,CAC/C,GAAI,CACAA,EAAO,OAAO,QAAU,KACxBA,EAAO,OAAO,KAAI,EAClB,QAAW4B,KAAO5B,EAAO,YAAa4B,EAAI,KAAI,EAC9C5B,EAAO,OAAO,WAAU,EACxB,QAAW6B,KAAQ7B,EAAO,YAAa6B,EAAK,WAAU,EACtD7B,EAAO,SAAS,WAAU,CAC9B,MAAQ,CAER,CACA,KAAK,OAAO,OAAOD,CAAE,CACzB,CAEA,SAAO,CACH,GAAI,MAAK,SACT,MAAK,SAAW,GAChB,MAAM,QAAO,EACb,KAAK,YAAY,MAAK,EACtB,KAAK,SAAS,MAAK,EACnB,KAAK,UAAU,OAAS,EACxB,KAAK,MAAM,QAAO,EAClB,GAAI,CACA,KAAK,WAAW,WAAU,CAC9B,MAAQ,CAER,CACI,KAAK,aAAe,KAAK,QAAQ,QAAU,UAC3C,KAAK,QAAQ,MAAK,EAE1B",
|
|
6
|
+
"names": ["isCurve", "sourceTimeAtSceneElapsed", "CURVE_SAMPLES_PER_SECOND", "applyParam", "ctx", "audioParam", "param", "startTime", "clipDuration", "elapsed", "clamp", "v", "finite", "base", "resolved", "startValue", "seg", "segStart", "segEnd", "span", "count", "samples", "i", "local", "curveStart", "curveDur", "buildAudioFilterGraph", "source", "filters", "nodes", "oscillators", "cursor", "series", "node", "apply", "p", "filter", "gain", "biquad", "carrier", "lfo", "lfoDepth", "d", "clamp01", "split", "merge", "dry", "m", "maxDelay", "staticOf", "delay", "feedbackGain", "f", "wet", "effectiveSpeed", "speed", "speedCurveOf", "applySpeedToPlaybackRate", "rate", "curve", "sourceLength", "sceneDuration", "scalar", "step", "scene", "seedSrc", "s", "clampedScene", "srcT", "value", "ctxTime", "AudioBusGraph", "ctx", "destination", "bus", "startTime", "node", "osc", "index", "stop", "existing", "output", "input", "level", "levelOf", "graph", "buildAudioFilterGraph", "value", "sourceTimeAtSceneElapsed", "DEFAULT_SAMPLE_RATE", "audioUrl", "src", "catalog", "fetchAudioBuffer", "ctx", "arrayBuffer", "mixAudio", "requests", "totalDuration", "options", "sampleRate", "frames", "uniqueSrcs", "r", "scratchCtx", "decoded", "mixCtx", "buses", "AudioBusGraph", "req", "globalOffset", "srcBuffer", "globalStart", "playDuration", "source", "scalarSpeed", "effectiveSpeed", "rate", "speedCurve", "speedCurveOf", "gain", "sourceLength", "clipDuration", "graph", "buildAudioFilterGraph", "applySpeedToPlaybackRate", "consumed", "sourceTimeAtSceneElapsed", "osc", "WebAudioMixer", "encodeWav", "buffer", "channelCount", "frameCount", "bytesPerSample", "blockAlign", "dataBytes", "out", "view", "ascii", "offset", "text", "i", "channels", "c", "frame", "sample", "AudioSink", "sourceTimeAtSceneElapsed", "WebAudioSink", "AudioSink", "context", "AudioBusGraph", "src", "data", "existing", "job", "buffer", "keep", "id", "active", "requests", "next", "r", "sceneTime", "liveIds", "req", "time", "_speed", "_reverse", "muted", "volume", "gainNode", "source", "scalarSpeed", "effectiveSpeed", "rate", "speedCurve", "speedCurveOf", "elapsed", "sourceLength", "clipDuration", "startTime", "graph", "buildAudioFilterGraph", "audioOffset", "sourceTimeAtSceneElapsed", "applySpeedToPlaybackRate", "osc", "node"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{$,$a,$b,$c,$d,$e,$f as ag,$g as ah,A,Aa,Ab,Ac,Ad,Ae,Af as Bf,Ag as Bg,B,Ba,Bb,Bc,Bd,Be,Bf as Cf,Bg as Cg,C,Ca,Cb,Cc,Cd,Ce,Cf as Df,Cg as Dg,D,Da,Db,Dc,Dd,De,Df as Ef,Dg as Eg,E,Ea,Eb,Ec,Ed,Ee,Ef as Ff,Eg as Fg,F,Fa,Fb,Fc,Fd,Fe,Ff as Gf,Fg as Gg,G,Ga,Gb,Gc,Gd,Ge,Gf as Hf,Gg as Hg,H,Ha,Hb,Hc,Hd,He,Hf as If,Hg as Ig,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kg as lg,l,la,lb,lc,ld,le,lf as mf,lg as mg,m,ma,mb,mc,md,me,mf as nf,mg as ng,n,na,nb,nc,nd,ne,nf as of,ng as og,o,oa,ob,oc,od,oe,of as pf,og as pg,p,pa,pb,pc,pd,pe,pf as qf,pg as qg,q,qa,qb,qc,qd,qe,qf as rf,qg as rg,r,ra,rb,rc,rd,re,rf as sf,rg as sg,s,sa,sb,sc,sd,se,sf as tf,sg as tg,t,ta,tb,tc,td,te,tf as uf,tg as ug,u,ua,ub,uc,ud,ue,uf as vf,ug as vg,v,va,vb,vc,vd,ve,vf as wf,vg as wg,w,wa,wb,wc,wd,we,wf as xf,wg as xg,x,xa,xb,xc,xd,xe,xf as yf,xg as yg,y,ya,yb,yc,yd,ye,yf as zf,yg as zg,z,za,zb,zc,zd,ze,zf as Af,zg as Ag}from"./chunk-CTLBXZSU.js";import"./chunk-FY3BTKY4.js";export{ca as ACESFilmicToneMapping,v as AddEquation,Z as AddOperation,Sb as AdditiveAnimationBlendMode,q as AdditiveBlending,ea as AgXToneMapping,Oa as AlphaFormat,Fc as AlwaysCompare,Q as AlwaysDepth,xc as AlwaysStencilFunc,eg as AmbientLight,Bg as AnimationAction,Mf as AnimationClip,Sf as AnimationLoader,Cg as AnimationMixer,Ag as AnimationObjectGroup,yf as AnimationUtils,Le as ArcCurve,sg as ArrayCamera,_g as ArrowHelper,ga as AttachedBindMode,vg as Audio,xg as AudioAnalyser,og as AudioContext,ug as AudioListener,pg as AudioLoader,$g as AxesHelper,m as BackSide,Wb as BasicDepthPacking,h as BasicShadowMap,ie as BatchedMesh,Df as BezierInterpolant,ae as Bone,Ff as BooleanKeyframeTrack,Ng as Box2,Ed as Box3,Yg as Box3Helper,Be as BoxGeometry,Xg as BoxHelper,Gd as BufferAttribute,Rd as BufferGeometry,lg as BufferGeometryLoader,Ca as ByteType,Nf as Cache,_f as Camera,Wg as CameraHelper,we as CanvasTexture,Ce as CapsuleGeometry,Me as CatmullRomCurve3,ba as CineonToneMapping,De as CircleGeometry,pa as ClampToEdgeWrapping,Jg as Clock,zd as Color,Gf as ColorKeyframeTrack,id as ColorManagement,Wc as Compatibility,te as CompressedArrayTexture,ue as CompressedCubeTexture,se as CompressedTexture,Tf as CompressedTextureLoader,Fe as ConeGeometry,N as ConstantAlphaFactor,L as ConstantColorFactor,bh as Controls,rg as CubeCamera,ze as CubeDepthTexture,ja as CubeReflectionMapping,ka as CubeRefractionMapping,ve as CubeTexture,Vf as CubeTextureLoader,na as CubeUVReflectionMapping,Ne as CubicBezierCurve,Oe as CubicBezierCurve3,Af as CubicInterpolant,e as CullFaceBack,f as CullFaceFront,g as CullFaceFrontBack,d as CullFaceNone,Je as Curve,Ue as CurvePath,t as CustomBlending,da as CustomToneMapping,Ee as CylinderGeometry,Lg as Cylindrical,rd as Data3DTexture,pd as DataArrayTexture,be as DataTexture,Wf as DataTextureLoader,Fd as DataUtils,mc as DecrementStencilOp,oc as DecrementWrapStencilOp,Pf as DefaultLoadingManager,Ra as DepthFormat,Sa as DepthStencilFormat,ye as DepthTexture,ha as DetachedBindMode,dg as DirectionalLight,Vg as DirectionalLightHelper,Cf as DiscreteInterpolant,He as DodecahedronGeometry,n as DoubleSide,G as DstAlphaFactor,I as DstColorFactor,Nc as DynamicCopyUsage,Hc as DynamicDrawUsage,Kc as DynamicReadUsage,Ie as EdgesGeometry,Ke as EllipseCurve,Ac as EqualCompare,T as EqualDepth,sc as EqualStencilFunc,la as EquirectangularReflectionMapping,ma as EquirectangularRefractionMapping,ud as Euler,cd as EventDispatcher,Ae as ExternalTexture,Ye as ExtrudeGeometry,Rf as FileLoader,Od as Float16BufferAttribute,Pd as Float32BufferAttribute,Ha as FloatType,Bd as Fog,Ad as FogExp2,re as FramebufferTexture,l as FrontSide,ge as Frustum,he as FrustumArray,Hg as GLBufferAttribute,Pc as GLSL1,Qc as GLSL3,Cc as GreaterCompare,V as GreaterDepth,Ec as GreaterEqualCompare,U as GreaterEqualDepth,wc as GreaterEqualStencilFunc,uc as GreaterStencilFunc,Tg as GridHelper,xd as Group,xe as HTMLTexture,Ia as HalfFloatType,Zf as HemisphereLight,Sg as HemisphereLightHelper,Ze as IcosahedronGeometry,ng as ImageBitmapLoader,Uf as ImageLoader,jd as ImageUtils,lc as IncrementStencilOp,nc as IncrementWrapStencilOp,de as InstancedBufferAttribute,kg as InstancedBufferGeometry,Gg as InstancedInterleavedBuffer,ee as InstancedMesh,Kd as Int16BufferAttribute,Md as Int32BufferAttribute,Hd as Int8BufferAttribute,Fa as IntType,Sd as InterleavedBuffer,Td as InterleavedBufferAttribute,zf as Interpolant,Nb as InterpolateBezier,Kb as InterpolateDiscrete,Lb as InterpolateLinear,Mb as InterpolateSmooth,Vc as InterpolationSamplingMode,Uc as InterpolationSamplingType,pc as InvertStencilOp,jc as KeepStencilOp,Ef as KeyframeTrack,Xd as LOD,_e as LatheGeometry,vd as Layers,zc as LessCompare,R as LessDepth,Bc as LessEqualCompare,S as LessEqualDepth,tc as LessEqualStencilFunc,rc as LessStencilFunc,Yf as Light,hg as LightProbe,ke as Line,Og as Line3,je as LineBasicMaterial,Pe as LineCurve,Qe as LineCurve3,xf as LineDashedMaterial,me as LineLoop,le as LineSegments,wa as LinearFilter,Bf as LinearInterpolant,Aa as LinearMipMapLinearFilter,ya as LinearMipMapNearestFilter,za as LinearMipmapLinearFilter,xa as LinearMipmapNearestFilter,cc as LinearSRGBColorSpace,$ as LinearToneMapping,dc as LinearTransfer,Qf as Loader,jg as LoaderUtils,Of as LoadingManager,Hb as LoopOnce,Jb as LoopPingPong,Ib as LoopRepeat,b as MOUSE,Ud as Material,u as MaterialBlending,ig as MaterialLoader,dd as MathUtils,Mg as Matrix2,hd as Matrix3,td as Matrix4,z as MaxEquation,_d as Mesh,Zd as MeshBasicMaterial,uf as MeshDepthMaterial,vf as MeshDistanceMaterial,tf as MeshLambertMaterial,wf as MeshMatcapMaterial,sf as MeshNormalMaterial,qf as MeshPhongMaterial,pf as MeshPhysicalMaterial,of as MeshStandardMaterial,rf as MeshToonMaterial,y as MinEquation,qa as MirroredRepeatWrapping,Y as MixOperation,s as MultiplyBlending,X as MultiplyOperation,ra as NearestFilter,va as NearestMipMapLinearFilter,ta as NearestMipMapNearestFilter,ua as NearestMipmapLinearFilter,sa as NearestMipmapNearestFilter,fa as NeutralToneMapping,yc as NeverCompare,P as NeverDepth,qc as NeverStencilFunc,o as NoBlending,ac as NoColorSpace,fc as NoNormalPacking,_ as NoToneMapping,Rb as NormalAnimationBlendMode,p as NormalBlending,hc as NormalGAPacking,gc as NormalRGPacking,Dc as NotEqualCompare,W as NotEqualDepth,vc as NotEqualStencilFunc,Hf as NumberKeyframeTrack,wd as Object3D,mg as ObjectLoader,$b as ObjectSpaceNormalMap,$e as OctahedronGeometry,B as OneFactor,O as OneMinusConstantAlphaFactor,M as OneMinusConstantColorFactor,H as OneMinusDstAlphaFactor,J as OneMinusDstColorFactor,F as OneMinusSrcAlphaFactor,D as OneMinusSrcColorFactor,cg as OrthographicCamera,i as PCFShadowMap,j as PCFSoftShadowMap,gh as PMREMGenerator,Ve as Path,$f as PerspectiveCamera,fe as Plane,af as PlaneGeometry,Zg as PlaneHelper,bg as PointLight,Rg as PointLightHelper,oe as Points,ne as PointsMaterial,Ug as PolarGridHelper,Ge as PolyhedronGeometry,wg as PositionalAudio,zg as PropertyBinding,yg as PropertyMixer,Re as QuadraticBezierCurve,Se as QuadraticBezierCurve3,fd as Quaternion,Jf as QuaternionKeyframeTrack,If as QuaternionLinearInterpolant,ib as R11_EAC_Format,Fb as RED_GREEN_RGTC2_Format,Db as RED_RGTC1_Format,a as REVISION,kb as RG11_EAC_Format,Xb as RGBADepthPacking,Qa as RGBAFormat,Ya as RGBAIntegerFormat,xb as RGBA_ASTC_10x10_Format,ub as RGBA_ASTC_10x5_Format,vb as RGBA_ASTC_10x6_Format,wb as RGBA_ASTC_10x8_Format,yb as RGBA_ASTC_12x10_Format,zb as RGBA_ASTC_12x12_Format,mb as RGBA_ASTC_4x4_Format,nb as RGBA_ASTC_5x4_Format,ob as RGBA_ASTC_5x5_Format,pb as RGBA_ASTC_6x5_Format,qb as RGBA_ASTC_6x6_Format,rb as RGBA_ASTC_8x5_Format,sb as RGBA_ASTC_8x6_Format,tb as RGBA_ASTC_8x8_Format,Ab as RGBA_BPTC_Format,hb as RGBA_ETC2_EAC_Format,eb as RGBA_PVRTC_2BPPV1_Format,db as RGBA_PVRTC_4BPPV1_Format,_a as RGBA_S3TC_DXT1_Format,$a as RGBA_S3TC_DXT3_Format,ab as RGBA_S3TC_DXT5_Format,Yb as RGBDepthPacking,Pa as RGBFormat,Xa as RGBIntegerFormat,Bb as RGB_BPTC_SIGNED_Format,Cb as RGB_BPTC_UNSIGNED_Format,fb as RGB_ETC1_Format,gb as RGB_ETC2_Format,cb as RGB_PVRTC_2BPPV1_Format,bb as RGB_PVRTC_4BPPV1_Format,Za as RGB_S3TC_DXT1_Format,Zb as RGDepthPacking,Va as RGFormat,Wa as RGIntegerFormat,nf as RawShaderMaterial,Yd as Ray,Ig as Raycaster,fg as RectAreaLight,Ta as RedFormat,Ua as RedIntegerFormat,aa as ReinhardToneMapping,nd as RenderTarget,Dg as RenderTarget3D,oa as RepeatWrapping,kc as ReplaceStencilOp,x as ReverseSubtractEquation,bf as RingGeometry,jb as SIGNED_R11_EAC_Format,Gb as SIGNED_RED_GREEN_RGTC2_Format,Eb as SIGNED_RED_RGTC1_Format,lb as SIGNED_RG11_EAC_Format,bc as SRGBColorSpace,ec as SRGBTransfer,Cd as Scene,dh as ShaderChunk,fh as ShaderLib,mf as ShaderMaterial,kf as ShadowMaterial,We as Shape,cf as ShapeGeometry,ah as ShapePath,Xe as ShapeUtils,Da as ShortType,ce as Skeleton,Qg as SkeletonHelper,$d as SkinnedMesh,kd as Source,Qd as Sphere,df as SphereGeometry,Kg as Spherical,gg as SphericalHarmonics3,Te as SplineCurve,ag as SpotLight,Pg as SpotLightHelper,Wd as Sprite,Vd as SpriteMaterial,E as SrcAlphaFactor,K as SrcAlphaSaturateFactor,C as SrcColorFactor,Mc as StaticCopyUsage,Gc as StaticDrawUsage,Jc as StaticReadUsage,qg as StereoCamera,Oc as StreamCopyUsage,Ic as StreamDrawUsage,Lc as StreamReadUsage,Kf as StringKeyframeTrack,w as SubtractEquation,r as SubtractiveBlending,c as TOUCH,_b as TangentSpaceNormalMap,ef as TetrahedronGeometry,ld as Texture,Xf as TextureLoader,ch as TextureUtils,tg as Timer,Tc as TimestampQuery,ff as TorusGeometry,gf as TorusKnotGeometry,Dd as Triangle,Vb as TriangleFanDrawMode,Ub as TriangleStripDrawMode,Tb as TrianglesDrawMode,hf as TubeGeometry,ia as UVMapping,Ld as Uint16BufferAttribute,Nd as Uint32BufferAttribute,Id as Uint8BufferAttribute,Jd as Uint8ClampedBufferAttribute,Eg as Uniform,Fg as UniformsGroup,eh as UniformsLib,lf as UniformsUtils,Ba as UnsignedByteType,Na as UnsignedInt101111Type,La as UnsignedInt248Type,Ma as UnsignedInt5999Type,Ga as UnsignedIntType,Ja as UnsignedShort4444Type,Ka as UnsignedShort5551Type,Ea as UnsignedShortType,k as VSMShadowMap,ed as Vector2,gd as Vector3,md as Vector4,Lf as VectorKeyframeTrack,qe as VideoFrameTexture,pe as VideoTexture,sd as WebGL3DRenderTarget,qd as WebGLArrayRenderTarget,Rc as WebGLCoordinateSystem,hh as WebGLCubeRenderTarget,od as WebGLRenderTarget,jh as WebGLRenderer,ih as WebGLUtils,Sc as WebGPUCoordinateSystem,yd as WebXRController,jf as WireframeGeometry,Qb as WrapAroundEnding,Ob as ZeroCurvatureEnding,A as ZeroFactor,Pb as ZeroSlopeEnding,ic as ZeroStencilOp,Xc as createCanvasElement,ad as error,Zc as getConsoleFunction,_c as log,Yc as setConsoleFunction,$c as warn,bd as warnOnce};
|
|
2
|
+
//# sourceMappingURL=three.module-Z4EOVUWF.js.map
|
|
Binary file
|