@carbonenginejs/runtime-resource 0.12.0 → 0.12.1
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/dist/CjsResMan.js +4 -4
- package/dist/CjsResMan.js.map +1 -1
- package/dist/_virtual/_rollupPluginBabelHelpers.js +1 -4
- package/dist/_virtual/_rollupPluginBabelHelpers.js.map +1 -1
- package/dist/format/CjsByteReader.js +310 -0
- package/dist/format/CjsByteReader.js.map +1 -0
- package/dist/format/CjsByteWriter.js +242 -0
- package/dist/format/CjsByteWriter.js.map +1 -0
- package/dist/format/CjsFormatError.js +41 -0
- package/dist/format/CjsFormatError.js.map +1 -0
- package/dist/format/CjsStringTable.js +268 -0
- package/dist/format/CjsStringTable.js.map +1 -0
- package/dist/format/carbonEffect/CjsCarbonEffectReader.js +361 -0
- package/dist/format/carbonEffect/CjsCarbonEffectReader.js.map +1 -0
- package/dist/format/carbonEffect/CjsCarbonEffectWriter.js +373 -0
- package/dist/format/carbonEffect/CjsCarbonEffectWriter.js.map +1 -0
- package/dist/format/carbonEffect/carbonDescriptionFromPortable.js +372 -0
- package/dist/format/carbonEffect/carbonDescriptionFromPortable.js.map +1 -0
- package/dist/format/carbonEffect/carbonEffectBackendBlock.js +427 -0
- package/dist/format/carbonEffect/carbonEffectBackendBlock.js.map +1 -0
- package/dist/format/carbonEffect/carbonEffectRecords.js +955 -0
- package/dist/format/carbonEffect/carbonEffectRecords.js.map +1 -0
- package/dist/format/compareUtf8.js +36 -0
- package/dist/format/compareUtf8.js.map +1 -0
- package/dist/format/index.js +11 -0
- package/dist/format/index.js.map +1 -0
- package/dist/formats/bnk/CjsBnkFormat.js +10 -4
- package/dist/formats/bnk/CjsBnkFormat.js.map +1 -1
- package/dist/formats/bnk/core/eventAction.js +305 -0
- package/dist/formats/bnk/core/eventAction.js.map +1 -0
- package/dist/formats/bnk/core/helpers.js +11 -2
- package/dist/formats/bnk/core/helpers.js.map +1 -1
- package/dist/formats/bnk/core/nodeBase.js +532 -0
- package/dist/formats/bnk/core/nodeBase.js.map +1 -0
- package/dist/formats/bnk/core/sfxNodes.js +252 -152
- package/dist/formats/bnk/core/sfxNodes.js.map +1 -1
- package/dist/formats/hlsl/core/HlslReader.js +7 -257
- package/dist/formats/hlsl/core/HlslReader.js.map +1 -1
- package/dist/formats/hlsl/core/carbonDescriptionToRuntime.js +781 -0
- package/dist/formats/hlsl/core/carbonDescriptionToRuntime.js.map +1 -0
- package/dist/formats/hlsl/core/tr2/resources/HlslEffectRes.js +21 -1
- package/dist/formats/hlsl/core/tr2/resources/HlslEffectRes.js.map +1 -1
- package/dist/formats/index.js +1 -1
- package/dist/formats/webgl/core/cewg/CewgPackage.js +2 -1
- package/dist/formats/webgl/core/cewg/CewgPackage.js.map +1 -1
- package/dist/formats/webgl/core/cewg/binary.js +11 -93
- package/dist/formats/webgl/core/cewg/binary.js.map +1 -1
- package/dist/formats/webgl/core/effectPackage.js +1 -1
- package/dist/formats/webgpu/CjsWebgpuFormat.js +4 -23
- package/dist/formats/webgpu/CjsWebgpuFormat.js.map +1 -1
- package/dist/formats/webgpu/core/buildCarbonEffectContainer.js +197 -0
- package/dist/formats/webgpu/core/buildCarbonEffectContainer.js.map +1 -0
- package/dist/formats/webgpu/core/cewgpu/CewgpuContainer.js +368 -0
- package/dist/formats/webgpu/core/cewgpu/CewgpuContainer.js.map +1 -0
- package/dist/formats/webgpu/core/cewgpu/containerViews.js +355 -0
- package/dist/formats/webgpu/core/cewgpu/containerViews.js.map +1 -0
- package/dist/formats/webgpu/core/cewgpu/validateContainer.js +90 -0
- package/dist/formats/webgpu/core/cewgpu/validateContainer.js.map +1 -0
- package/dist/formats/webgpu/core/effectBackendBodySet.js +21 -20
- package/dist/formats/webgpu/core/effectBackendBodySet.js.map +1 -1
- package/dist/formats/webgpu/core/helpers.js +87 -92
- package/dist/formats/webgpu/core/helpers.js.map +1 -1
- package/dist/formats/webgpu/core/ir/analyzeRegisterValues.js +14 -13
- package/dist/formats/webgpu/core/ir/analyzeRegisterValues.js.map +1 -1
- package/dist/formats/webgpu/core/ir/inferValueTypes.js +10 -8
- package/dist/formats/webgpu/core/ir/inferValueTypes.js.map +1 -1
- package/dist/formats/webgpu/core/packageEffect.js +94 -9
- package/dist/formats/webgpu/core/packageEffect.js.map +1 -1
- package/dist/formats/webgpu/core/packageMetadata.js +10 -1
- package/dist/formats/webgpu/core/packageMetadata.js.map +1 -1
- package/dist/formats/webgpu/core/wgsl/buildResourceTransformPlan.js +17 -15
- package/dist/formats/webgpu/core/wgsl/buildResourceTransformPlan.js.map +1 -1
- package/dist/formats/webgpu/core/wgsl/buildWgslBindingPlan.js +13 -12
- package/dist/formats/webgpu/core/wgsl/buildWgslBindingPlan.js.map +1 -1
- package/dist/formats/webgpu/core/wgsl/buildWgslSet.js +9 -8
- package/dist/formats/webgpu/core/wgsl/buildWgslSet.js.map +1 -1
- package/dist/formats/webgpu/core/wgsl/lowerComputeProgram.js +23 -22
- package/dist/formats/webgpu/core/wgsl/lowerComputeProgram.js.map +1 -1
- package/dist/formats/webgpu/core/wgsl/selectionPlans.js +46 -44
- package/dist/formats/webgpu/core/wgsl/selectionPlans.js.map +1 -1
- package/dist/resource/CjsResource.js +700 -684
- package/dist/resource/CjsResource.js.map +1 -1
- package/dist/resource/Tr2LightProfileRes.js +18 -27
- package/dist/resource/Tr2LightProfileRes.js.map +1 -1
- package/dist/resource/audio/CjsAudioBufferRes.js +2 -2
- package/dist/resource/audio/CjsAudioBufferRes.js.map +1 -1
- package/dist/resource/audio/CjsAudioRes.js +2 -2
- package/dist/resource/audio/CjsAudioRes.js.map +1 -1
- package/dist/resource/geometry/TriGeometryRes.js +605 -586
- package/dist/resource/geometry/TriGeometryRes.js.map +1 -1
- package/dist/resource/geometry/granny/Tr2GrannyStateRes.js +21 -30
- package/dist/resource/geometry/granny/Tr2GrannyStateRes.js.map +1 -1
- package/dist/resource/geometry/granny/TriGrannyRes.js +21 -30
- package/dist/resource/geometry/granny/TriGrannyRes.js.map +1 -1
- package/dist/resource/shader/Tr2EffectRes.js +9 -7
- package/dist/resource/shader/Tr2EffectRes.js.map +1 -1
- package/dist/resource/shader/Tr2MaterialArea.js +5 -3
- package/dist/resource/shader/Tr2MaterialArea.js.map +1 -1
- package/dist/resource/shader/Tr2MaterialMesh.js +4 -2
- package/dist/resource/shader/Tr2MaterialMesh.js.map +1 -1
- package/dist/resource/shader/Tr2MaterialRes.js +5 -3
- package/dist/resource/shader/Tr2MaterialRes.js.map +1 -1
- package/dist/resource/shader/Tr2Shader.js +26 -21
- package/dist/resource/shader/Tr2Shader.js.map +1 -1
- package/dist/resource/shader/Tr2ShaderPermutation.js +8 -6
- package/dist/resource/shader/Tr2ShaderPermutation.js.map +1 -1
- package/dist/resource/shader/reflection/Tr2EffectDefine.js +5 -3
- package/dist/resource/shader/reflection/Tr2EffectDefine.js.map +1 -1
- package/dist/resource/shader/reflection/Tr2EffectDescription.js +5 -3
- package/dist/resource/shader/reflection/Tr2EffectDescription.js.map +1 -1
- package/dist/resource/shader/reflection/Tr2EffectLibrary.js +17 -15
- package/dist/resource/shader/reflection/Tr2EffectLibrary.js.map +1 -1
- package/dist/resource/shader/reflection/Tr2EffectParameterAnnotation.js +11 -9
- package/dist/resource/shader/reflection/Tr2EffectParameterAnnotation.js.map +1 -1
- package/dist/resource/shader/reflection/Tr2EffectResource.js +8 -6
- package/dist/resource/shader/reflection/Tr2EffectResource.js.map +1 -1
- package/dist/resource/shader/reflection/Tr2EffectStageInput.js +15 -13
- package/dist/resource/shader/reflection/Tr2EffectStageInput.js.map +1 -1
- package/dist/resource/shader/reflection/Tr2EffectTechnique.js +7 -5
- package/dist/resource/shader/reflection/Tr2EffectTechnique.js.map +1 -1
- package/dist/resource/shader/reflection/Tr2Pass.js +11 -9
- package/dist/resource/shader/reflection/Tr2Pass.js.map +1 -1
- package/dist/resource/shader/sampler/Tr2SamplerSetup.js +8 -6
- package/dist/resource/shader/sampler/Tr2SamplerSetup.js.map +1 -1
- package/dist/resource/texture/CjsTextureArrayRes.js +400 -411
- package/dist/resource/texture/CjsTextureArrayRes.js.map +1 -1
- package/dist/resource/texture/Tr2ImageRes.js +99 -95
- package/dist/resource/texture/Tr2ImageRes.js.map +1 -1
- package/dist/resource/texture/TriTextureRes.js +312 -273
- package/dist/resource/texture/TriTextureRes.js.map +1 -1
- package/docs/README.md +13 -1
- package/docs/architecture.md +3 -3
- package/docs/concepts/resource-lifecycle.md +9 -2
- package/docs/concepts/shader-resource-model.md +114 -0
- package/docs/concepts/writing-an-engine-adapter.md +115 -0
- package/docs/formats/README.md +24 -1
- package/docs/formats/carbon-effect-container.md +452 -0
- package/docs/formats/dxbc/reference/classes/README.md +5 -72
- package/docs/formats/hlsl/reference/api.md +5 -4
- package/docs/formats/hlsl/reference/classes/README.md +6 -11
- package/docs/formats/provenance.md +23 -13
- package/docs/formats/webgl/reference/classes/README.md +5 -92
- package/docs/formats/webgpu/README.md +19 -16
- package/docs/formats/webgpu/architecture.md +15 -12
- package/docs/formats/webgpu/formats/cewgpu.md +175 -438
- package/docs/formats/webgpu/guides/effect-packaging.md +132 -140
- package/docs/formats/webgpu/reference/api.md +131 -131
- package/docs/formats/webgpu/reference/classes/README.md +5 -62
- package/docs/formats/webgpu/reference/wgsl-compatibility.md +146 -45
- package/docs/formats/wwise.md +34 -8
- package/docs/reference/classes/core.md +80 -0
- package/docs/reference/classes/formats.md +18 -28
- package/docs/reference/events.md +25 -0
- package/docs/reference/motherlode-cache.md +22 -8
- package/docs/reference/workers.md +5 -5
- package/docs/roadmap.md +61 -41
- package/package.json +2 -1
- package/dist/formats/webgpu/core/cewgpu/CewgpuPackage.js +0 -415
- package/dist/formats/webgpu/core/cewgpu/CewgpuPackage.js.map +0 -1
- package/dist/formats/webgpu/core/cewgpu/CewgpuPackageBuilder.js +0 -100
- package/dist/formats/webgpu/core/cewgpu/CewgpuPackageBuilder.js.map +0 -1
- package/dist/formats/webgpu/core/cewgpu/binary.js +0 -93
- package/dist/formats/webgpu/core/cewgpu/binary.js.map +0 -1
- package/dist/formats/webgpu/core/cewgpu/tags.js +0 -17
- package/dist/formats/webgpu/core/cewgpu/tags.js.map +0 -1
- package/dist/formats/webgpu/core/effectPackageValidation.js +0 -1078
- package/dist/formats/webgpu/core/effectPackageValidation.js.map +0 -1
- package/docs/formats/hlsl/reference/classes/carbon-compatibility.md +0 -66
- package/docs/formats/hlsl/reference/classes/public-api.md +0 -26
- package/docs/formats/hlsl/reference/classes/tr2-effect-model.md +0 -150
|
@@ -0,0 +1,532 @@
|
|
|
1
|
+
import { readWwiseVar } from './helpers.js';
|
|
2
|
+
|
|
3
|
+
// Exact Wwise v150 common audio-node decoding. This module is internal to the
|
|
4
|
+
// BNK toolkit: it preserves authored facts and byte unions without assigning
|
|
5
|
+
// runtime playback or attenuation-curve semantics.
|
|
6
|
+
|
|
7
|
+
const WWISE_NODE_BASE_VERSION = 150;
|
|
8
|
+
const ATTENUATION_PROPERTY_ID = 0x55;
|
|
9
|
+
const LOOP_COUNT_PROPERTY_ID = 0x54;
|
|
10
|
+
const VALID_CURVE_SCALING = new Set([0, 2, 3, 4]);
|
|
11
|
+
|
|
12
|
+
/** Bounds-aware little-endian cursor over one HIRC payload. */
|
|
13
|
+
class WwiseCursor {
|
|
14
|
+
/**
|
|
15
|
+
* Creates a cursor over a bounded portion of a Wwise payload.
|
|
16
|
+
*
|
|
17
|
+
* @param {Uint8Array} bytes Payload bytes.
|
|
18
|
+
* @param {number} [offset=0] Initial byte offset.
|
|
19
|
+
* @param {number} [end=bytes.byteLength] Exclusive ending offset.
|
|
20
|
+
*/
|
|
21
|
+
constructor(bytes, offset = 0, end = bytes?.byteLength) {
|
|
22
|
+
if (!(bytes instanceof Uint8Array) || !Number.isSafeInteger(offset) || !Number.isSafeInteger(end) || offset < 0 || end < offset || end > bytes.byteLength) {
|
|
23
|
+
throw new TypeError("Invalid Wwise cursor range");
|
|
24
|
+
}
|
|
25
|
+
this.bytes = bytes;
|
|
26
|
+
this.view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
27
|
+
this.at = offset;
|
|
28
|
+
this.end = end;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** Gets the number of unread bytes in the bounded range. */
|
|
32
|
+
get remaining() {
|
|
33
|
+
return this.end - this.at;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Verifies that a read of the requested size stays within the range.
|
|
38
|
+
*
|
|
39
|
+
* @param {number} size Number of bytes to read.
|
|
40
|
+
* @throws {RangeError} The read would exceed the bounded range.
|
|
41
|
+
*/
|
|
42
|
+
ensure(size) {
|
|
43
|
+
if (!Number.isSafeInteger(size) || size < 0 || this.at + size > this.end) {
|
|
44
|
+
throw new RangeError("truncated Wwise object");
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/** Reads an unsigned 8-bit integer. */
|
|
49
|
+
u8() {
|
|
50
|
+
this.ensure(1);
|
|
51
|
+
return this.view.getUint8(this.at++);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/** Reads a signed 8-bit integer. */
|
|
55
|
+
s8() {
|
|
56
|
+
this.ensure(1);
|
|
57
|
+
return this.view.getInt8(this.at++);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/** Reads a little-endian unsigned 16-bit integer. */
|
|
61
|
+
u16() {
|
|
62
|
+
this.ensure(2);
|
|
63
|
+
const value = this.view.getUint16(this.at, true);
|
|
64
|
+
this.at += 2;
|
|
65
|
+
return value;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/** Reads a little-endian unsigned 32-bit integer. */
|
|
69
|
+
u32() {
|
|
70
|
+
this.ensure(4);
|
|
71
|
+
const value = this.view.getUint32(this.at, true);
|
|
72
|
+
this.at += 4;
|
|
73
|
+
return value;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/** Reads a little-endian signed 32-bit integer. */
|
|
77
|
+
s32() {
|
|
78
|
+
this.ensure(4);
|
|
79
|
+
const value = this.view.getInt32(this.at, true);
|
|
80
|
+
this.at += 4;
|
|
81
|
+
return value;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/** Reads a little-endian 32-bit floating-point value. */
|
|
85
|
+
f32() {
|
|
86
|
+
this.ensure(4);
|
|
87
|
+
const value = this.view.getFloat32(this.at, true);
|
|
88
|
+
this.at += 4;
|
|
89
|
+
return value;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/** Reads a Wwise variable-length unsigned integer. */
|
|
93
|
+
variable() {
|
|
94
|
+
const result = readWwiseVar(this.bytes.subarray(0, this.end), this.at);
|
|
95
|
+
if (!result) {
|
|
96
|
+
throw new RangeError("invalid Wwise variable integer");
|
|
97
|
+
}
|
|
98
|
+
this.at = result.nextOffset;
|
|
99
|
+
return result.value;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Reads one v150 NodeBase from the current cursor position.
|
|
105
|
+
*
|
|
106
|
+
* The cursor is left at the first type-specific byte.
|
|
107
|
+
*/
|
|
108
|
+
function readNodeBase(cursor) {
|
|
109
|
+
const fx = ReadInitialFx(cursor);
|
|
110
|
+
const metadata = ReadInitialMetadata(cursor);
|
|
111
|
+
const overrideBusId = cursor.u32();
|
|
112
|
+
const directParentId = cursor.u32();
|
|
113
|
+
const priority = ReadPriority(cursor);
|
|
114
|
+
const {
|
|
115
|
+
properties,
|
|
116
|
+
ranges,
|
|
117
|
+
attenuationId,
|
|
118
|
+
loopCount
|
|
119
|
+
} = ReadInitialProperties(cursor);
|
|
120
|
+
const positioning = ReadPositioning(cursor);
|
|
121
|
+
const aux = ReadAux(cursor);
|
|
122
|
+
const advanced = ReadAdvanced(cursor);
|
|
123
|
+
const state = ReadStateChunk(cursor);
|
|
124
|
+
const rtpcs = readInitialRtpcs(cursor);
|
|
125
|
+
return {
|
|
126
|
+
fx,
|
|
127
|
+
metadata,
|
|
128
|
+
overrideBusId,
|
|
129
|
+
directParentId,
|
|
130
|
+
priority,
|
|
131
|
+
properties,
|
|
132
|
+
ranges,
|
|
133
|
+
attenuationId,
|
|
134
|
+
loopCount,
|
|
135
|
+
positioning,
|
|
136
|
+
aux,
|
|
137
|
+
advanced,
|
|
138
|
+
state,
|
|
139
|
+
rtpcs
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/** Parses one NodeBase that must consume exactly the supplied byte range. */
|
|
144
|
+
function parseNodeBaseRange(bytes, start, end, {
|
|
145
|
+
bankVersion = WWISE_NODE_BASE_VERSION
|
|
146
|
+
} = {}) {
|
|
147
|
+
if (!(bytes instanceof Uint8Array) || Number(bankVersion) !== WWISE_NODE_BASE_VERSION) {
|
|
148
|
+
return null;
|
|
149
|
+
}
|
|
150
|
+
try {
|
|
151
|
+
const cursor = new WwiseCursor(bytes, start, end);
|
|
152
|
+
const nodeBase = readNodeBase(cursor);
|
|
153
|
+
return cursor.at === end ? nodeBase : null;
|
|
154
|
+
} catch {
|
|
155
|
+
return null;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/** Reads the v150 initial-RTPC list shared by NodeBase and attenuation. */
|
|
160
|
+
function readInitialRtpcs(cursor) {
|
|
161
|
+
const count = boundedCount(cursor.u16(), cursor.remaining, 14, 4096);
|
|
162
|
+
const rtpcs = [];
|
|
163
|
+
for (let index = 0; index < count; index++) {
|
|
164
|
+
rtpcs.push(readInitialRtpc(cursor));
|
|
165
|
+
}
|
|
166
|
+
return rtpcs;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/** Reads one v150 initial RTPC. */
|
|
170
|
+
function readInitialRtpc(cursor) {
|
|
171
|
+
const controlId = cursor.u32();
|
|
172
|
+
const controlType = cursor.u8();
|
|
173
|
+
const accumulation = cursor.u8();
|
|
174
|
+
const parameterId = cursor.variable();
|
|
175
|
+
const curveId = cursor.u32();
|
|
176
|
+
const scaling = cursor.u8();
|
|
177
|
+
const pointCount = boundedCount(cursor.u16(), cursor.remaining, 12, 65535);
|
|
178
|
+
if (controlType > 4 || accumulation > 6 || !VALID_CURVE_SCALING.has(scaling)) {
|
|
179
|
+
throw new RangeError("invalid initial RTPC enum");
|
|
180
|
+
}
|
|
181
|
+
return {
|
|
182
|
+
controlId,
|
|
183
|
+
controlType,
|
|
184
|
+
accumulation,
|
|
185
|
+
parameterId,
|
|
186
|
+
curveId,
|
|
187
|
+
scaling,
|
|
188
|
+
points: readCurvePoints(cursor, pointCount)
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/** Reads exact Wwise graph points without inferring curve meaning. */
|
|
193
|
+
function readCurvePoints(cursor, count) {
|
|
194
|
+
const points = [];
|
|
195
|
+
for (let index = 0; index < count; index++) {
|
|
196
|
+
const from = finite(cursor.f32());
|
|
197
|
+
const to = finite(cursor.f32());
|
|
198
|
+
const interpolation = cursor.u32();
|
|
199
|
+
if (interpolation > 9) {
|
|
200
|
+
throw new RangeError("invalid curve interpolation");
|
|
201
|
+
}
|
|
202
|
+
points.push({
|
|
203
|
+
from,
|
|
204
|
+
to,
|
|
205
|
+
interpolation
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
return points;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/** Validates an encoded count before allocating or iterating it. */
|
|
212
|
+
function boundedCount(value, remaining, stride, maximum) {
|
|
213
|
+
if (!Number.isSafeInteger(value) || value < 0 || value > maximum || value * stride > remaining) {
|
|
214
|
+
throw new RangeError("invalid Wwise object count");
|
|
215
|
+
}
|
|
216
|
+
return value;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
/** Rejects non-finite authored curve/position values. */
|
|
220
|
+
function finite(value) {
|
|
221
|
+
if (!Number.isFinite(value)) {
|
|
222
|
+
throw new RangeError("non-finite Wwise object value");
|
|
223
|
+
}
|
|
224
|
+
return value;
|
|
225
|
+
}
|
|
226
|
+
function ReadInitialFx(cursor) {
|
|
227
|
+
const overrideParentRaw = cursor.u8();
|
|
228
|
+
const count = cursor.u8();
|
|
229
|
+
const bypassAllRaw = count ? cursor.u8() : 0;
|
|
230
|
+
const slots = [];
|
|
231
|
+
boundedCount(count, cursor.remaining, 6, 255);
|
|
232
|
+
for (let index = 0; index < count; index++) {
|
|
233
|
+
const slot = cursor.u8();
|
|
234
|
+
const fxId = cursor.u32();
|
|
235
|
+
const flags = cursor.u8();
|
|
236
|
+
slots.push({
|
|
237
|
+
index: slot,
|
|
238
|
+
fxId,
|
|
239
|
+
flags,
|
|
240
|
+
bypass: Boolean(flags & 0x01),
|
|
241
|
+
shareSet: Boolean(flags & 0x02),
|
|
242
|
+
rendered: Boolean(flags & 0x04)
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
return {
|
|
246
|
+
overrideParentRaw,
|
|
247
|
+
overrideParent: Boolean(overrideParentRaw),
|
|
248
|
+
bypassAllRaw,
|
|
249
|
+
bypassAll: Boolean(bypassAllRaw),
|
|
250
|
+
slots
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
function ReadInitialMetadata(cursor) {
|
|
254
|
+
const overrideParentRaw = cursor.u8();
|
|
255
|
+
const count = cursor.u8();
|
|
256
|
+
const slots = [];
|
|
257
|
+
boundedCount(count, cursor.remaining, 6, 255);
|
|
258
|
+
for (let index = 0; index < count; index++) {
|
|
259
|
+
const slot = cursor.u8();
|
|
260
|
+
const fxId = cursor.u32();
|
|
261
|
+
const shareSetRaw = cursor.u8();
|
|
262
|
+
slots.push({
|
|
263
|
+
index: slot,
|
|
264
|
+
fxId,
|
|
265
|
+
shareSetRaw,
|
|
266
|
+
shareSet: Boolean(shareSetRaw)
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
return {
|
|
270
|
+
overrideParentRaw,
|
|
271
|
+
overrideParent: Boolean(overrideParentRaw),
|
|
272
|
+
slots
|
|
273
|
+
};
|
|
274
|
+
}
|
|
275
|
+
function ReadPriority(cursor) {
|
|
276
|
+
const flags = cursor.u8();
|
|
277
|
+
return {
|
|
278
|
+
flags,
|
|
279
|
+
overrideParent: Boolean(flags & 0x01),
|
|
280
|
+
applyDistanceFactor: Boolean(flags & 0x02),
|
|
281
|
+
overrideMidiEventsBehavior: Boolean(flags & 0x04),
|
|
282
|
+
overrideMidiNoteTracking: Boolean(flags & 0x08),
|
|
283
|
+
enableMidiNoteTracking: Boolean(flags & 0x10),
|
|
284
|
+
midiBreakLoopOnNoteOff: Boolean(flags & 0x20)
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
function ReadInitialProperties(cursor) {
|
|
288
|
+
const propertyCount = boundedCount(cursor.u8(), cursor.remaining, 5, 255);
|
|
289
|
+
const propertyIds = [];
|
|
290
|
+
for (let index = 0; index < propertyCount; index++) {
|
|
291
|
+
propertyIds.push(cursor.u8());
|
|
292
|
+
}
|
|
293
|
+
const properties = propertyIds.map(id => {
|
|
294
|
+
const rawValue = cursor.u32();
|
|
295
|
+
if (id === LOOP_COUNT_PROPERTY_ID) {
|
|
296
|
+
return {
|
|
297
|
+
id,
|
|
298
|
+
rawValue,
|
|
299
|
+
valueType: "loop-count",
|
|
300
|
+
value: rawValue
|
|
301
|
+
};
|
|
302
|
+
}
|
|
303
|
+
if (id === ATTENUATION_PROPERTY_ID) {
|
|
304
|
+
return {
|
|
305
|
+
id,
|
|
306
|
+
rawValue,
|
|
307
|
+
valueType: "id",
|
|
308
|
+
value: rawValue
|
|
309
|
+
};
|
|
310
|
+
}
|
|
311
|
+
return {
|
|
312
|
+
id,
|
|
313
|
+
rawValue,
|
|
314
|
+
valueType: "union",
|
|
315
|
+
floatValue: FloatFromBits(rawValue)
|
|
316
|
+
};
|
|
317
|
+
});
|
|
318
|
+
const rangeCount = boundedCount(cursor.u8(), cursor.remaining, 9, 255);
|
|
319
|
+
const rangeIds = [];
|
|
320
|
+
for (let index = 0; index < rangeCount; index++) {
|
|
321
|
+
rangeIds.push(cursor.u8());
|
|
322
|
+
}
|
|
323
|
+
const ranges = rangeIds.map(id => {
|
|
324
|
+
const minRaw = cursor.u32();
|
|
325
|
+
const maxRaw = cursor.u32();
|
|
326
|
+
return {
|
|
327
|
+
id,
|
|
328
|
+
minRaw,
|
|
329
|
+
maxRaw,
|
|
330
|
+
minFloat: FloatFromBits(minRaw),
|
|
331
|
+
maxFloat: FloatFromBits(maxRaw)
|
|
332
|
+
};
|
|
333
|
+
});
|
|
334
|
+
const attenuationProperties = properties.filter(property => property.id === ATTENUATION_PROPERTY_ID);
|
|
335
|
+
const loopCountProperties = properties.filter(property => property.id === LOOP_COUNT_PROPERTY_ID);
|
|
336
|
+
if (attenuationProperties.length > 1) {
|
|
337
|
+
throw new RangeError("duplicate v150 Wwise attenuation property");
|
|
338
|
+
}
|
|
339
|
+
if (loopCountProperties.length > 1) {
|
|
340
|
+
throw new RangeError("duplicate v150 Wwise loop-count property");
|
|
341
|
+
}
|
|
342
|
+
const loopCount = loopCountProperties[0]?.value ?? null;
|
|
343
|
+
if (loopCount !== null && loopCount > 32767) {
|
|
344
|
+
throw new RangeError("invalid v150 Wwise loop count");
|
|
345
|
+
}
|
|
346
|
+
return {
|
|
347
|
+
properties,
|
|
348
|
+
ranges,
|
|
349
|
+
attenuationId: attenuationProperties[0]?.value ?? null,
|
|
350
|
+
// Wwise serializes this property only when looping is enabled.
|
|
351
|
+
// Zero means infinite; positive values are finite authored repeats.
|
|
352
|
+
loopCount
|
|
353
|
+
};
|
|
354
|
+
}
|
|
355
|
+
function ReadPositioning(cursor) {
|
|
356
|
+
const flags = cursor.u8();
|
|
357
|
+
const overrideParent = Boolean(flags & 0x01);
|
|
358
|
+
const listenerRelative = Boolean(flags & 0x02);
|
|
359
|
+
const pannerType = flags >>> 2 & 0x03;
|
|
360
|
+
const positionType = flags >>> 5 & 0x03;
|
|
361
|
+
let spatial = null;
|
|
362
|
+
let automation = null;
|
|
363
|
+
if (positionType === 3) {
|
|
364
|
+
throw new RangeError("invalid v150 Wwise position type");
|
|
365
|
+
}
|
|
366
|
+
if (overrideParent && listenerRelative) {
|
|
367
|
+
const spatialFlags = cursor.u8();
|
|
368
|
+
spatial = {
|
|
369
|
+
flags: spatialFlags,
|
|
370
|
+
mode: spatialFlags & 0x03,
|
|
371
|
+
enableAttenuation: Boolean(spatialFlags & 0x08),
|
|
372
|
+
holdEmitterPositionOrientation: Boolean(spatialFlags & 0x10),
|
|
373
|
+
holdListenerOrientation: Boolean(spatialFlags & 0x20),
|
|
374
|
+
enableDiffraction: Boolean(spatialFlags & 0x40)
|
|
375
|
+
};
|
|
376
|
+
if (positionType !== 0) {
|
|
377
|
+
automation = ReadAutomation(cursor);
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
return {
|
|
381
|
+
flags,
|
|
382
|
+
overrideParent,
|
|
383
|
+
listenerRelative,
|
|
384
|
+
pannerType,
|
|
385
|
+
positionType,
|
|
386
|
+
spatial,
|
|
387
|
+
automation
|
|
388
|
+
};
|
|
389
|
+
}
|
|
390
|
+
function ReadAutomation(cursor) {
|
|
391
|
+
const pathMode = cursor.u8();
|
|
392
|
+
const transitionTime = cursor.s32();
|
|
393
|
+
const vertexCount = boundedCount(cursor.u32(), cursor.remaining, 16, 65535);
|
|
394
|
+
const vertices = [];
|
|
395
|
+
for (let index = 0; index < vertexCount; index++) {
|
|
396
|
+
vertices.push({
|
|
397
|
+
x: finite(cursor.f32()),
|
|
398
|
+
y: finite(cursor.f32()),
|
|
399
|
+
z: finite(cursor.f32()),
|
|
400
|
+
duration: cursor.s32()
|
|
401
|
+
});
|
|
402
|
+
}
|
|
403
|
+
const playlistCount = boundedCount(cursor.u32(), cursor.remaining, 20, 65535);
|
|
404
|
+
const playlist = [];
|
|
405
|
+
for (let index = 0; index < playlistCount; index++) {
|
|
406
|
+
playlist.push({
|
|
407
|
+
verticesOffset: cursor.u32(),
|
|
408
|
+
numVertices: cursor.u32()
|
|
409
|
+
});
|
|
410
|
+
}
|
|
411
|
+
const ranges = [];
|
|
412
|
+
for (let index = 0; index < playlistCount; index++) {
|
|
413
|
+
ranges.push({
|
|
414
|
+
x: finite(cursor.f32()),
|
|
415
|
+
y: finite(cursor.f32()),
|
|
416
|
+
z: finite(cursor.f32())
|
|
417
|
+
});
|
|
418
|
+
}
|
|
419
|
+
return {
|
|
420
|
+
pathMode,
|
|
421
|
+
transitionTime,
|
|
422
|
+
vertices,
|
|
423
|
+
playlist,
|
|
424
|
+
ranges
|
|
425
|
+
};
|
|
426
|
+
}
|
|
427
|
+
function ReadAux(cursor) {
|
|
428
|
+
const flags = cursor.u8();
|
|
429
|
+
const hasAux = Boolean(flags & 0x08);
|
|
430
|
+
const auxIds = [];
|
|
431
|
+
if (hasAux) {
|
|
432
|
+
for (let index = 0; index < 4; index++) {
|
|
433
|
+
auxIds.push(cursor.u32());
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
return {
|
|
437
|
+
flags,
|
|
438
|
+
overrideUserAux: Boolean(flags & 0x04),
|
|
439
|
+
hasAux,
|
|
440
|
+
overrideReflectionsAux: Boolean(flags & 0x10),
|
|
441
|
+
auxIds,
|
|
442
|
+
reflectionsAuxBusId: cursor.u32()
|
|
443
|
+
};
|
|
444
|
+
}
|
|
445
|
+
function ReadAdvanced(cursor) {
|
|
446
|
+
const flags = cursor.u8();
|
|
447
|
+
const virtualQueueBehavior = cursor.u8();
|
|
448
|
+
const maxInstances = cursor.u16();
|
|
449
|
+
const belowThresholdBehavior = cursor.u8();
|
|
450
|
+
const hdrFlags = cursor.u8();
|
|
451
|
+
if (virtualQueueBehavior > 2 || belowThresholdBehavior > 3) {
|
|
452
|
+
throw new RangeError("invalid v150 Wwise advanced setting");
|
|
453
|
+
}
|
|
454
|
+
return {
|
|
455
|
+
flags,
|
|
456
|
+
killNewest: Boolean(flags & 0x01),
|
|
457
|
+
useVirtualBehavior: Boolean(flags & 0x02),
|
|
458
|
+
ignoreParentMaxInstances: Boolean(flags & 0x08),
|
|
459
|
+
overrideVirtualVoiceBehavior: Boolean(flags & 0x10),
|
|
460
|
+
virtualQueueBehavior,
|
|
461
|
+
maxInstances,
|
|
462
|
+
belowThresholdBehavior,
|
|
463
|
+
hdrFlags,
|
|
464
|
+
overrideHdrEnvelope: Boolean(hdrFlags & 0x01),
|
|
465
|
+
overrideAnalysis: Boolean(hdrFlags & 0x02),
|
|
466
|
+
normalizeLoudness: Boolean(hdrFlags & 0x04),
|
|
467
|
+
enableEnvelope: Boolean(hdrFlags & 0x08)
|
|
468
|
+
};
|
|
469
|
+
}
|
|
470
|
+
function ReadStateChunk(cursor) {
|
|
471
|
+
const propertyCount = boundedCount(cursor.variable(), cursor.remaining, 3, 4096);
|
|
472
|
+
const properties = [];
|
|
473
|
+
for (let index = 0; index < propertyCount; index++) {
|
|
474
|
+
const propertyId = cursor.variable();
|
|
475
|
+
const accumulation = cursor.u8();
|
|
476
|
+
const inDbRaw = cursor.u8();
|
|
477
|
+
if (accumulation > 6 || inDbRaw > 1) {
|
|
478
|
+
throw new RangeError("invalid v150 Wwise state property");
|
|
479
|
+
}
|
|
480
|
+
properties.push({
|
|
481
|
+
propertyId,
|
|
482
|
+
accumulation,
|
|
483
|
+
inDbRaw,
|
|
484
|
+
inDb: Boolean(inDbRaw)
|
|
485
|
+
});
|
|
486
|
+
}
|
|
487
|
+
const groupCount = boundedCount(cursor.variable(), cursor.remaining, 6, 4096);
|
|
488
|
+
const groups = [];
|
|
489
|
+
for (let index = 0; index < groupCount; index++) {
|
|
490
|
+
const groupId = cursor.u32();
|
|
491
|
+
const syncType = cursor.u8();
|
|
492
|
+
const stateCount = boundedCount(cursor.variable(), cursor.remaining, 6, 4096);
|
|
493
|
+
const states = [];
|
|
494
|
+
if (syncType > 9) {
|
|
495
|
+
throw new RangeError("invalid v150 Wwise state sync type");
|
|
496
|
+
}
|
|
497
|
+
for (let stateIndex = 0; stateIndex < stateCount; stateIndex++) {
|
|
498
|
+
const stateId = cursor.u32();
|
|
499
|
+
const valueCount = boundedCount(cursor.u16(), cursor.remaining, 6, 65535);
|
|
500
|
+
const propertyIds = [];
|
|
501
|
+
for (let valueIndex = 0; valueIndex < valueCount; valueIndex++) {
|
|
502
|
+
propertyIds.push(cursor.u16());
|
|
503
|
+
}
|
|
504
|
+
const values = propertyIds.map(propertyId => ({
|
|
505
|
+
propertyId,
|
|
506
|
+
value: finite(cursor.f32())
|
|
507
|
+
}));
|
|
508
|
+
states.push({
|
|
509
|
+
stateId,
|
|
510
|
+
values
|
|
511
|
+
});
|
|
512
|
+
}
|
|
513
|
+
groups.push({
|
|
514
|
+
groupId,
|
|
515
|
+
syncType,
|
|
516
|
+
states
|
|
517
|
+
});
|
|
518
|
+
}
|
|
519
|
+
return {
|
|
520
|
+
properties,
|
|
521
|
+
groups
|
|
522
|
+
};
|
|
523
|
+
}
|
|
524
|
+
function FloatFromBits(value) {
|
|
525
|
+
const bytes = new ArrayBuffer(4);
|
|
526
|
+
const view = new DataView(bytes);
|
|
527
|
+
view.setUint32(0, value, true);
|
|
528
|
+
return view.getFloat32(0, true);
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
export { WWISE_NODE_BASE_VERSION, WwiseCursor, boundedCount, finite, parseNodeBaseRange, readCurvePoints, readInitialRtpc, readInitialRtpcs, readNodeBase };
|
|
532
|
+
//# sourceMappingURL=nodeBase.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nodeBase.js","sources":["../../../../../src/formats/bnk/core/nodeBase.js"],"sourcesContent":["// Exact Wwise v150 common audio-node decoding. This module is internal to the\n// BNK toolkit: it preserves authored facts and byte unions without assigning\n// runtime playback or attenuation-curve semantics.\n\nimport { readWwiseVar } from \"./helpers.js\";\n\nexport const WWISE_NODE_BASE_VERSION = 150;\n\nconst ATTENUATION_PROPERTY_ID = 0x55;\nconst LOOP_COUNT_PROPERTY_ID = 0x54;\nconst VALID_CURVE_SCALING = new Set([ 0, 2, 3, 4 ]);\n\n/** Bounds-aware little-endian cursor over one HIRC payload. */\nexport class WwiseCursor\n{\n /**\n * Creates a cursor over a bounded portion of a Wwise payload.\n *\n * @param {Uint8Array} bytes Payload bytes.\n * @param {number} [offset=0] Initial byte offset.\n * @param {number} [end=bytes.byteLength] Exclusive ending offset.\n */\n constructor(bytes, offset = 0, end = bytes?.byteLength)\n {\n if (!(bytes instanceof Uint8Array)\n || !Number.isSafeInteger(offset)\n || !Number.isSafeInteger(end)\n || offset < 0\n || end < offset\n || end > bytes.byteLength)\n {\n throw new TypeError(\"Invalid Wwise cursor range\");\n }\n\n this.bytes = bytes;\n this.view = new DataView(\n bytes.buffer,\n bytes.byteOffset,\n bytes.byteLength,\n );\n this.at = offset;\n this.end = end;\n }\n\n /** Gets the number of unread bytes in the bounded range. */\n get remaining()\n {\n return this.end - this.at;\n }\n\n /**\n * Verifies that a read of the requested size stays within the range.\n *\n * @param {number} size Number of bytes to read.\n * @throws {RangeError} The read would exceed the bounded range.\n */\n ensure(size)\n {\n if (!Number.isSafeInteger(size)\n || size < 0\n || this.at + size > this.end)\n {\n throw new RangeError(\"truncated Wwise object\");\n }\n }\n\n /** Reads an unsigned 8-bit integer. */\n u8()\n {\n this.ensure(1);\n return this.view.getUint8(this.at++);\n }\n\n /** Reads a signed 8-bit integer. */\n s8()\n {\n this.ensure(1);\n return this.view.getInt8(this.at++);\n }\n\n /** Reads a little-endian unsigned 16-bit integer. */\n u16()\n {\n this.ensure(2);\n const value = this.view.getUint16(this.at, true);\n\n this.at += 2;\n return value;\n }\n\n /** Reads a little-endian unsigned 32-bit integer. */\n u32()\n {\n this.ensure(4);\n const value = this.view.getUint32(this.at, true);\n\n this.at += 4;\n return value;\n }\n\n /** Reads a little-endian signed 32-bit integer. */\n s32()\n {\n this.ensure(4);\n const value = this.view.getInt32(this.at, true);\n\n this.at += 4;\n return value;\n }\n\n /** Reads a little-endian 32-bit floating-point value. */\n f32()\n {\n this.ensure(4);\n const value = this.view.getFloat32(this.at, true);\n\n this.at += 4;\n return value;\n }\n\n /** Reads a Wwise variable-length unsigned integer. */\n variable()\n {\n const result = readWwiseVar(\n this.bytes.subarray(0, this.end),\n this.at,\n );\n\n if (!result)\n {\n throw new RangeError(\"invalid Wwise variable integer\");\n }\n\n this.at = result.nextOffset;\n return result.value;\n }\n}\n\n/**\n * Reads one v150 NodeBase from the current cursor position.\n *\n * The cursor is left at the first type-specific byte.\n */\nexport function readNodeBase(cursor)\n{\n const fx = ReadInitialFx(cursor);\n const metadata = ReadInitialMetadata(cursor);\n const overrideBusId = cursor.u32();\n const directParentId = cursor.u32();\n const priority = ReadPriority(cursor);\n const {\n properties,\n ranges,\n attenuationId,\n loopCount,\n } = ReadInitialProperties(cursor);\n const positioning = ReadPositioning(cursor);\n const aux = ReadAux(cursor);\n const advanced = ReadAdvanced(cursor);\n const state = ReadStateChunk(cursor);\n const rtpcs = readInitialRtpcs(cursor);\n\n return {\n fx,\n metadata,\n overrideBusId,\n directParentId,\n priority,\n properties,\n ranges,\n attenuationId,\n loopCount,\n positioning,\n aux,\n advanced,\n state,\n rtpcs,\n };\n}\n\n/** Parses one NodeBase that must consume exactly the supplied byte range. */\nexport function parseNodeBaseRange(\n bytes,\n start,\n end,\n { bankVersion = WWISE_NODE_BASE_VERSION } = {},\n)\n{\n if (!(bytes instanceof Uint8Array)\n || Number(bankVersion) !== WWISE_NODE_BASE_VERSION)\n {\n return null;\n }\n\n try\n {\n const cursor = new WwiseCursor(bytes, start, end);\n const nodeBase = readNodeBase(cursor);\n\n return cursor.at === end ? nodeBase : null;\n }\n catch\n {\n return null;\n }\n}\n\n/** Reads the v150 initial-RTPC list shared by NodeBase and attenuation. */\nexport function readInitialRtpcs(cursor)\n{\n const count = boundedCount(cursor.u16(), cursor.remaining, 14, 4096);\n const rtpcs = [];\n\n for (let index = 0; index < count; index++)\n {\n rtpcs.push(readInitialRtpc(cursor));\n }\n\n return rtpcs;\n}\n\n/** Reads one v150 initial RTPC. */\nexport function readInitialRtpc(cursor)\n{\n const controlId = cursor.u32();\n const controlType = cursor.u8();\n const accumulation = cursor.u8();\n const parameterId = cursor.variable();\n const curveId = cursor.u32();\n const scaling = cursor.u8();\n const pointCount = boundedCount(\n cursor.u16(),\n cursor.remaining,\n 12,\n 65535,\n );\n\n if (controlType > 4\n || accumulation > 6\n || !VALID_CURVE_SCALING.has(scaling))\n {\n throw new RangeError(\"invalid initial RTPC enum\");\n }\n\n return {\n controlId,\n controlType,\n accumulation,\n parameterId,\n curveId,\n scaling,\n points: readCurvePoints(cursor, pointCount),\n };\n}\n\n/** Reads exact Wwise graph points without inferring curve meaning. */\nexport function readCurvePoints(cursor, count)\n{\n const points = [];\n\n for (let index = 0; index < count; index++)\n {\n const from = finite(cursor.f32());\n const to = finite(cursor.f32());\n const interpolation = cursor.u32();\n\n if (interpolation > 9)\n {\n throw new RangeError(\"invalid curve interpolation\");\n }\n\n points.push({ from, to, interpolation });\n }\n\n return points;\n}\n\n/** Validates an encoded count before allocating or iterating it. */\nexport function boundedCount(value, remaining, stride, maximum)\n{\n if (!Number.isSafeInteger(value)\n || value < 0\n || value > maximum\n || value * stride > remaining)\n {\n throw new RangeError(\"invalid Wwise object count\");\n }\n\n return value;\n}\n\n/** Rejects non-finite authored curve/position values. */\nexport function finite(value)\n{\n if (!Number.isFinite(value))\n {\n throw new RangeError(\"non-finite Wwise object value\");\n }\n\n return value;\n}\n\nfunction ReadInitialFx(cursor)\n{\n const overrideParentRaw = cursor.u8();\n const count = cursor.u8();\n const bypassAllRaw = count ? cursor.u8() : 0;\n const slots = [];\n\n boundedCount(count, cursor.remaining, 6, 255);\n\n for (let index = 0; index < count; index++)\n {\n const slot = cursor.u8();\n const fxId = cursor.u32();\n const flags = cursor.u8();\n\n slots.push({\n index: slot,\n fxId,\n flags,\n bypass: Boolean(flags & 0x01),\n shareSet: Boolean(flags & 0x02),\n rendered: Boolean(flags & 0x04),\n });\n }\n\n return {\n overrideParentRaw,\n overrideParent: Boolean(overrideParentRaw),\n bypassAllRaw,\n bypassAll: Boolean(bypassAllRaw),\n slots,\n };\n}\n\nfunction ReadInitialMetadata(cursor)\n{\n const overrideParentRaw = cursor.u8();\n const count = cursor.u8();\n const slots = [];\n\n boundedCount(count, cursor.remaining, 6, 255);\n\n for (let index = 0; index < count; index++)\n {\n const slot = cursor.u8();\n const fxId = cursor.u32();\n const shareSetRaw = cursor.u8();\n\n slots.push({\n index: slot,\n fxId,\n shareSetRaw,\n shareSet: Boolean(shareSetRaw),\n });\n }\n\n return {\n overrideParentRaw,\n overrideParent: Boolean(overrideParentRaw),\n slots,\n };\n}\n\nfunction ReadPriority(cursor)\n{\n const flags = cursor.u8();\n\n return {\n flags,\n overrideParent: Boolean(flags & 0x01),\n applyDistanceFactor: Boolean(flags & 0x02),\n overrideMidiEventsBehavior: Boolean(flags & 0x04),\n overrideMidiNoteTracking: Boolean(flags & 0x08),\n enableMidiNoteTracking: Boolean(flags & 0x10),\n midiBreakLoopOnNoteOff: Boolean(flags & 0x20),\n };\n}\n\nfunction ReadInitialProperties(cursor)\n{\n const propertyCount = boundedCount(\n cursor.u8(),\n cursor.remaining,\n 5,\n 255,\n );\n const propertyIds = [];\n\n for (let index = 0; index < propertyCount; index++)\n {\n propertyIds.push(cursor.u8());\n }\n\n const properties = propertyIds.map((id) =>\n {\n const rawValue = cursor.u32();\n\n if (id === LOOP_COUNT_PROPERTY_ID)\n {\n return {\n id,\n rawValue,\n valueType: \"loop-count\",\n value: rawValue,\n };\n }\n if (id === ATTENUATION_PROPERTY_ID)\n {\n return {\n id,\n rawValue,\n valueType: \"id\",\n value: rawValue,\n };\n }\n\n return {\n id,\n rawValue,\n valueType: \"union\",\n floatValue: FloatFromBits(rawValue),\n };\n });\n const rangeCount = boundedCount(\n cursor.u8(),\n cursor.remaining,\n 9,\n 255,\n );\n const rangeIds = [];\n\n for (let index = 0; index < rangeCount; index++)\n {\n rangeIds.push(cursor.u8());\n }\n\n const ranges = rangeIds.map((id) =>\n {\n const minRaw = cursor.u32();\n const maxRaw = cursor.u32();\n\n return {\n id,\n minRaw,\n maxRaw,\n minFloat: FloatFromBits(minRaw),\n maxFloat: FloatFromBits(maxRaw),\n };\n });\n const attenuationProperties = properties.filter(\n property => property.id === ATTENUATION_PROPERTY_ID,\n );\n const loopCountProperties = properties.filter(\n property => property.id === LOOP_COUNT_PROPERTY_ID,\n );\n\n if (attenuationProperties.length > 1)\n {\n throw new RangeError(\"duplicate v150 Wwise attenuation property\");\n }\n if (loopCountProperties.length > 1)\n {\n throw new RangeError(\"duplicate v150 Wwise loop-count property\");\n }\n\n const loopCount = loopCountProperties[0]?.value ?? null;\n\n if (loopCount !== null && loopCount > 32767)\n {\n throw new RangeError(\"invalid v150 Wwise loop count\");\n }\n\n return {\n properties,\n ranges,\n attenuationId: attenuationProperties[0]?.value ?? null,\n // Wwise serializes this property only when looping is enabled.\n // Zero means infinite; positive values are finite authored repeats.\n loopCount,\n };\n}\n\nfunction ReadPositioning(cursor)\n{\n const flags = cursor.u8();\n const overrideParent = Boolean(flags & 0x01);\n const listenerRelative = Boolean(flags & 0x02);\n const pannerType = (flags >>> 2) & 0x03;\n const positionType = (flags >>> 5) & 0x03;\n let spatial = null;\n let automation = null;\n\n if (positionType === 3)\n {\n throw new RangeError(\"invalid v150 Wwise position type\");\n }\n\n if (overrideParent && listenerRelative)\n {\n const spatialFlags = cursor.u8();\n\n spatial = {\n flags: spatialFlags,\n mode: spatialFlags & 0x03,\n enableAttenuation: Boolean(spatialFlags & 0x08),\n holdEmitterPositionOrientation: Boolean(spatialFlags & 0x10),\n holdListenerOrientation: Boolean(spatialFlags & 0x20),\n enableDiffraction: Boolean(spatialFlags & 0x40),\n };\n\n if (positionType !== 0)\n {\n automation = ReadAutomation(cursor);\n }\n }\n\n return {\n flags,\n overrideParent,\n listenerRelative,\n pannerType,\n positionType,\n spatial,\n automation,\n };\n}\n\nfunction ReadAutomation(cursor)\n{\n const pathMode = cursor.u8();\n const transitionTime = cursor.s32();\n const vertexCount = boundedCount(\n cursor.u32(),\n cursor.remaining,\n 16,\n 65535,\n );\n const vertices = [];\n\n for (let index = 0; index < vertexCount; index++)\n {\n vertices.push({\n x: finite(cursor.f32()),\n y: finite(cursor.f32()),\n z: finite(cursor.f32()),\n duration: cursor.s32(),\n });\n }\n\n const playlistCount = boundedCount(\n cursor.u32(),\n cursor.remaining,\n 20,\n 65535,\n );\n const playlist = [];\n\n for (let index = 0; index < playlistCount; index++)\n {\n playlist.push({\n verticesOffset: cursor.u32(),\n numVertices: cursor.u32(),\n });\n }\n\n const ranges = [];\n\n for (let index = 0; index < playlistCount; index++)\n {\n ranges.push({\n x: finite(cursor.f32()),\n y: finite(cursor.f32()),\n z: finite(cursor.f32()),\n });\n }\n\n return {\n pathMode,\n transitionTime,\n vertices,\n playlist,\n ranges,\n };\n}\n\nfunction ReadAux(cursor)\n{\n const flags = cursor.u8();\n const hasAux = Boolean(flags & 0x08);\n const auxIds = [];\n\n if (hasAux)\n {\n for (let index = 0; index < 4; index++)\n {\n auxIds.push(cursor.u32());\n }\n }\n\n return {\n flags,\n overrideUserAux: Boolean(flags & 0x04),\n hasAux,\n overrideReflectionsAux: Boolean(flags & 0x10),\n auxIds,\n reflectionsAuxBusId: cursor.u32(),\n };\n}\n\nfunction ReadAdvanced(cursor)\n{\n const flags = cursor.u8();\n const virtualQueueBehavior = cursor.u8();\n const maxInstances = cursor.u16();\n const belowThresholdBehavior = cursor.u8();\n const hdrFlags = cursor.u8();\n\n if (virtualQueueBehavior > 2 || belowThresholdBehavior > 3)\n {\n throw new RangeError(\"invalid v150 Wwise advanced setting\");\n }\n\n return {\n flags,\n killNewest: Boolean(flags & 0x01),\n useVirtualBehavior: Boolean(flags & 0x02),\n ignoreParentMaxInstances: Boolean(flags & 0x08),\n overrideVirtualVoiceBehavior: Boolean(flags & 0x10),\n virtualQueueBehavior,\n maxInstances,\n belowThresholdBehavior,\n hdrFlags,\n overrideHdrEnvelope: Boolean(hdrFlags & 0x01),\n overrideAnalysis: Boolean(hdrFlags & 0x02),\n normalizeLoudness: Boolean(hdrFlags & 0x04),\n enableEnvelope: Boolean(hdrFlags & 0x08),\n };\n}\n\nfunction ReadStateChunk(cursor)\n{\n const propertyCount = boundedCount(\n cursor.variable(),\n cursor.remaining,\n 3,\n 4096,\n );\n const properties = [];\n\n for (let index = 0; index < propertyCount; index++)\n {\n const propertyId = cursor.variable();\n const accumulation = cursor.u8();\n const inDbRaw = cursor.u8();\n\n if (accumulation > 6 || inDbRaw > 1)\n {\n throw new RangeError(\"invalid v150 Wwise state property\");\n }\n\n properties.push({\n propertyId,\n accumulation,\n inDbRaw,\n inDb: Boolean(inDbRaw),\n });\n }\n\n const groupCount = boundedCount(\n cursor.variable(),\n cursor.remaining,\n 6,\n 4096,\n );\n const groups = [];\n\n for (let index = 0; index < groupCount; index++)\n {\n const groupId = cursor.u32();\n const syncType = cursor.u8();\n const stateCount = boundedCount(\n cursor.variable(),\n cursor.remaining,\n 6,\n 4096,\n );\n const states = [];\n\n if (syncType > 9)\n {\n throw new RangeError(\"invalid v150 Wwise state sync type\");\n }\n\n for (let stateIndex = 0; stateIndex < stateCount; stateIndex++)\n {\n const stateId = cursor.u32();\n const valueCount = boundedCount(\n cursor.u16(),\n cursor.remaining,\n 6,\n 65535,\n );\n const propertyIds = [];\n\n for (let valueIndex = 0; valueIndex < valueCount; valueIndex++)\n {\n propertyIds.push(cursor.u16());\n }\n\n const values = propertyIds.map(propertyId => ({\n propertyId,\n value: finite(cursor.f32()),\n }));\n\n states.push({ stateId, values });\n }\n\n groups.push({ groupId, syncType, states });\n }\n\n return { properties, groups };\n}\n\nfunction FloatFromBits(value)\n{\n const bytes = new ArrayBuffer(4);\n const view = new DataView(bytes);\n\n view.setUint32(0, value, true);\n return view.getFloat32(0, true);\n}\n"],"names":["WWISE_NODE_BASE_VERSION","ATTENUATION_PROPERTY_ID","LOOP_COUNT_PROPERTY_ID","VALID_CURVE_SCALING","Set","WwiseCursor","constructor","bytes","offset","end","byteLength","Uint8Array","Number","isSafeInteger","TypeError","view","DataView","buffer","byteOffset","at","remaining","ensure","size","RangeError","u8","getUint8","s8","getInt8","u16","value","getUint16","u32","getUint32","s32","getInt32","f32","getFloat32","variable","result","readWwiseVar","subarray","nextOffset","readNodeBase","cursor","fx","ReadInitialFx","metadata","ReadInitialMetadata","overrideBusId","directParentId","priority","ReadPriority","properties","ranges","attenuationId","loopCount","ReadInitialProperties","positioning","ReadPositioning","aux","ReadAux","advanced","ReadAdvanced","state","ReadStateChunk","rtpcs","readInitialRtpcs","parseNodeBaseRange","start","bankVersion","nodeBase","count","boundedCount","index","push","readInitialRtpc","controlId","controlType","accumulation","parameterId","curveId","scaling","pointCount","has","points","readCurvePoints","from","finite","to","interpolation","stride","maximum","isFinite","overrideParentRaw","bypassAllRaw","slots","slot","fxId","flags","bypass","Boolean","shareSet","rendered","overrideParent","bypassAll","shareSetRaw","applyDistanceFactor","overrideMidiEventsBehavior","overrideMidiNoteTracking","enableMidiNoteTracking","midiBreakLoopOnNoteOff","propertyCount","propertyIds","map","id","rawValue","valueType","floatValue","FloatFromBits","rangeCount","rangeIds","minRaw","maxRaw","minFloat","maxFloat","attenuationProperties","filter","property","loopCountProperties","length","listenerRelative","pannerType","positionType","spatial","automation","spatialFlags","mode","enableAttenuation","holdEmitterPositionOrientation","holdListenerOrientation","enableDiffraction","ReadAutomation","pathMode","transitionTime","vertexCount","vertices","x","y","z","duration","playlistCount","playlist","verticesOffset","numVertices","hasAux","auxIds","overrideUserAux","overrideReflectionsAux","reflectionsAuxBusId","virtualQueueBehavior","maxInstances","belowThresholdBehavior","hdrFlags","killNewest","useVirtualBehavior","ignoreParentMaxInstances","overrideVirtualVoiceBehavior","overrideHdrEnvelope","overrideAnalysis","normalizeLoudness","enableEnvelope","propertyId","inDbRaw","inDb","groupCount","groups","groupId","syncType","stateCount","states","stateIndex","stateId","valueCount","valueIndex","values","ArrayBuffer","setUint32"],"mappings":";;AAAA;AACA;AACA;;AAIO,MAAMA,uBAAuB,GAAG;AAEvC,MAAMC,uBAAuB,GAAG,IAAI;AACpC,MAAMC,sBAAsB,GAAG,IAAI;AACnC,M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