@motionscript/browser 0.1.0-alpha.6 → 0.1.0-alpha.8

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.
Files changed (148) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/NOTICE +15 -14
  3. package/README.md +66 -43
  4. package/dist/asset-bytes.d.ts +7 -4
  5. package/dist/asset-bytes.d.ts.map +1 -1
  6. package/dist/asset-bytes.js +9 -4
  7. package/dist/asset-bytes.js.map +1 -1
  8. package/dist/audio/bus-graph.d.ts.map +1 -1
  9. package/dist/audio/bus-graph.js +15 -6
  10. package/dist/audio/bus-graph.js.map +1 -1
  11. package/dist/audio/effect-graph.d.ts +62 -0
  12. package/dist/audio/effect-graph.d.ts.map +1 -0
  13. package/dist/audio/effect-graph.js +234 -0
  14. package/dist/audio/effect-graph.js.map +1 -0
  15. package/dist/audio/index.d.ts.map +1 -1
  16. package/dist/audio/index.js +2 -3
  17. package/dist/audio/index.js.map +1 -1
  18. package/dist/audio/mixer.d.ts +4 -4
  19. package/dist/audio/mixer.d.ts.map +1 -1
  20. package/dist/audio/mixer.js +18 -38
  21. package/dist/audio/mixer.js.map +1 -1
  22. package/dist/audio/player.d.ts +12 -6
  23. package/dist/audio/player.d.ts.map +1 -1
  24. package/dist/audio/player.js +49 -62
  25. package/dist/audio/player.js.map +1 -1
  26. package/dist/browser/THIRD_PARTY_LICENSES.txt +379 -27
  27. package/dist/browser/audio.js +1 -1
  28. package/dist/browser/chunks/chunk-IILVN4SK.js +2 -0
  29. package/dist/browser/chunks/chunk-IILVN4SK.js.map +7 -0
  30. package/dist/browser/chunks/chunk-KLXMRKTL.js +2 -0
  31. package/dist/browser/chunks/chunk-L5UFQACH.js +163 -0
  32. package/dist/browser/chunks/chunk-L5UFQACH.js.map +7 -0
  33. package/dist/browser/chunks/mediabunny-mp3-encoder-ZCIHVVTJ.js +14 -0
  34. package/dist/browser/chunks/mediabunny-mp3-encoder-ZCIHVVTJ.js.map +7 -0
  35. package/dist/browser/index.js +51 -1343
  36. package/dist/browser/index.js.map +4 -4
  37. package/dist/browser/manifest.json +8 -8
  38. package/dist/browser/ms_renderer_bg.wasm +0 -0
  39. package/dist/canvaskit-renderer.d.ts +8 -0
  40. package/dist/canvaskit-renderer.d.ts.map +1 -0
  41. package/dist/canvaskit-renderer.js +23 -0
  42. package/dist/canvaskit-renderer.js.map +1 -0
  43. package/dist/concat.d.ts +33 -7
  44. package/dist/concat.d.ts.map +1 -1
  45. package/dist/concat.js +117 -72
  46. package/dist/concat.js.map +1 -1
  47. package/dist/deliver.d.ts +10 -0
  48. package/dist/deliver.d.ts.map +1 -0
  49. package/dist/deliver.js +22 -0
  50. package/dist/deliver.js.map +1 -0
  51. package/dist/dynamic-nodes.d.ts.map +1 -1
  52. package/dist/dynamic-nodes.js +2 -3
  53. package/dist/dynamic-nodes.js.map +1 -1
  54. package/dist/engine.d.ts +37 -9
  55. package/dist/engine.d.ts.map +1 -1
  56. package/dist/engine.js +41 -32
  57. package/dist/engine.js.map +1 -1
  58. package/dist/export-audio.d.ts +36 -0
  59. package/dist/export-audio.d.ts.map +1 -0
  60. package/dist/export-audio.js +56 -0
  61. package/dist/export-audio.js.map +1 -0
  62. package/dist/exporter.d.ts +125 -14
  63. package/dist/exporter.d.ts.map +1 -1
  64. package/dist/exporter.js +133 -89
  65. package/dist/exporter.js.map +1 -1
  66. package/dist/formats.d.ts +36 -0
  67. package/dist/formats.d.ts.map +1 -0
  68. package/dist/formats.js +83 -0
  69. package/dist/formats.js.map +1 -0
  70. package/dist/frame-loop.d.ts +190 -0
  71. package/dist/frame-loop.d.ts.map +1 -0
  72. package/dist/frame-loop.js +304 -0
  73. package/dist/frame-loop.js.map +1 -0
  74. package/dist/getter.d.ts +4 -1
  75. package/dist/getter.d.ts.map +1 -1
  76. package/dist/getter.js +7 -6
  77. package/dist/getter.js.map +1 -1
  78. package/dist/index.d.ts +12 -11
  79. package/dist/index.d.ts.map +1 -1
  80. package/dist/index.js +17 -21
  81. package/dist/index.js.map +1 -1
  82. package/dist/mix-timeline-audio.d.ts +5 -5
  83. package/dist/mix-timeline-audio.d.ts.map +1 -1
  84. package/dist/mix-timeline-audio.js +10 -12
  85. package/dist/mix-timeline-audio.js.map +1 -1
  86. package/dist/parallel/export-parallel.d.ts +32 -0
  87. package/dist/parallel/export-parallel.d.ts.map +1 -0
  88. package/dist/parallel/export-parallel.js +114 -0
  89. package/dist/parallel/export-parallel.js.map +1 -0
  90. package/dist/parallel/governor.d.ts +57 -0
  91. package/dist/parallel/governor.d.ts.map +1 -0
  92. package/dist/parallel/governor.js +79 -0
  93. package/dist/parallel/governor.js.map +1 -0
  94. package/dist/parallel/lane.d.ts +45 -0
  95. package/dist/parallel/lane.d.ts.map +1 -0
  96. package/dist/parallel/lane.js +2 -0
  97. package/dist/parallel/lane.js.map +1 -0
  98. package/dist/parallel/lanes.d.ts +20 -0
  99. package/dist/parallel/lanes.d.ts.map +1 -0
  100. package/dist/parallel/lanes.js +152 -0
  101. package/dist/parallel/lanes.js.map +1 -0
  102. package/dist/parallel/plan.d.ts +23 -0
  103. package/dist/parallel/plan.d.ts.map +1 -0
  104. package/dist/parallel/plan.js +30 -0
  105. package/dist/parallel/plan.js.map +1 -0
  106. package/dist/parallel/run-lanes.d.ts +38 -0
  107. package/dist/parallel/run-lanes.d.ts.map +1 -0
  108. package/dist/parallel/run-lanes.js +164 -0
  109. package/dist/parallel/run-lanes.js.map +1 -0
  110. package/dist/parallel/session.d.ts +9 -0
  111. package/dist/parallel/session.d.ts.map +1 -0
  112. package/dist/parallel/session.js +79 -0
  113. package/dist/parallel/session.js.map +1 -0
  114. package/dist/render-context.d.ts +2 -0
  115. package/dist/render-context.d.ts.map +1 -1
  116. package/dist/render-context.js +8 -4
  117. package/dist/render-context.js.map +1 -1
  118. package/dist/renderer.d.ts +22 -0
  119. package/dist/renderer.d.ts.map +1 -0
  120. package/dist/renderer.js +23 -0
  121. package/dist/renderer.js.map +1 -0
  122. package/dist/screenshot.d.ts +4 -4
  123. package/dist/screenshot.d.ts.map +1 -1
  124. package/dist/screenshot.js +3 -3
  125. package/dist/screenshot.js.map +1 -1
  126. package/dist/still.d.ts +17 -19
  127. package/dist/still.d.ts.map +1 -1
  128. package/dist/still.js +27 -34
  129. package/dist/still.js.map +1 -1
  130. package/dist/ticker.d.ts +22 -8
  131. package/dist/ticker.d.ts.map +1 -1
  132. package/dist/ticker.js +55 -20
  133. package/dist/ticker.js.map +1 -1
  134. package/package.json +9 -10
  135. package/dist/browser/chunks/GLTFLoader-PGXD4V5B.js +0 -2
  136. package/dist/browser/chunks/GLTFLoader-PGXD4V5B.js.map +0 -7
  137. package/dist/browser/chunks/SkeletonUtils-XYDMTGTM.js +0 -2
  138. package/dist/browser/chunks/chunk-2MAFJWBZ.js +0 -2
  139. package/dist/browser/chunks/chunk-2MAFJWBZ.js.map +0 -7
  140. package/dist/browser/chunks/chunk-CTLBXZSU.js +0 -4119
  141. package/dist/browser/chunks/chunk-CTLBXZSU.js.map +0 -7
  142. package/dist/browser/chunks/chunk-FQ32PDIU.js +0 -2
  143. package/dist/browser/chunks/chunk-FQ32PDIU.js.map +0 -7
  144. package/dist/browser/chunks/chunk-FY3BTKY4.js +0 -2
  145. package/dist/browser/chunks/chunk-FY3BTKY4.js.map +0 -7
  146. package/dist/browser/chunks/three.module-Z4EOVUWF.js +0 -2
  147. package/dist/browser/chunks/three.module-Z4EOVUWF.js.map +0 -7
  148. /package/dist/browser/chunks/{SkeletonUtils-XYDMTGTM.js.map → chunk-KLXMRKTL.js.map} +0 -0
@@ -1,5 +1,384 @@
1
1
  Third-party software bundled into @motionscript/browser's browser build (dist/browser/).
2
2
 
3
+ @mediabunny/mp3-encoder 1.62.1
4
+ License: MPL-2.0
5
+
6
+ Mozilla Public License Version 2.0
7
+ ==================================
8
+
9
+ 1. Definitions
10
+ --------------
11
+
12
+ 1.1. "Contributor"
13
+ means each individual or legal entity that creates, contributes to
14
+ the creation of, or owns Covered Software.
15
+
16
+ 1.2. "Contributor Version"
17
+ means the combination of the Contributions of others (if any) used
18
+ by a Contributor and that particular Contributor's Contribution.
19
+
20
+ 1.3. "Contribution"
21
+ means Covered Software of a particular Contributor.
22
+
23
+ 1.4. "Covered Software"
24
+ means Source Code Form to which the initial Contributor has attached
25
+ the notice in Exhibit A, the Executable Form of such Source Code
26
+ Form, and Modifications of such Source Code Form, in each case
27
+ including portions thereof.
28
+
29
+ 1.5. "Incompatible With Secondary Licenses"
30
+ means
31
+
32
+ (a) that the initial Contributor has attached the notice described
33
+ in Exhibit B to the Covered Software; or
34
+
35
+ (b) that the Covered Software was made available under the terms of
36
+ version 1.1 or earlier of the License, but not also under the
37
+ terms of a Secondary License.
38
+
39
+ 1.6. "Executable Form"
40
+ means any form of the work other than Source Code Form.
41
+
42
+ 1.7. "Larger Work"
43
+ means a work that combines Covered Software with other material, in
44
+ a separate file or files, that is not Covered Software.
45
+
46
+ 1.8. "License"
47
+ means this document.
48
+
49
+ 1.9. "Licensable"
50
+ means having the right to grant, to the maximum extent possible,
51
+ whether at the time of the initial grant or subsequently, any and
52
+ all of the rights conveyed by this License.
53
+
54
+ 1.10. "Modifications"
55
+ means any of the following:
56
+
57
+ (a) any file in Source Code Form that results from an addition to,
58
+ deletion from, or modification of the contents of Covered
59
+ Software; or
60
+
61
+ (b) any new file in Source Code Form that contains any Covered
62
+ Software.
63
+
64
+ 1.11. "Patent Claims" of a Contributor
65
+ means any patent claim(s), including without limitation, method,
66
+ process, and apparatus claims, in any patent Licensable by such
67
+ Contributor that would be infringed, but for the grant of the
68
+ License, by the making, using, selling, offering for sale, having
69
+ made, import, or transfer of either its Contributions or its
70
+ Contributor Version.
71
+
72
+ 1.12. "Secondary License"
73
+ means either the GNU General Public License, Version 2.0, the GNU
74
+ Lesser General Public License, Version 2.1, the GNU Affero General
75
+ Public License, Version 3.0, or any later versions of those
76
+ licenses.
77
+
78
+ 1.13. "Source Code Form"
79
+ means the form of the work preferred for making modifications.
80
+
81
+ 1.14. "You" (or "Your")
82
+ means an individual or a legal entity exercising rights under this
83
+ License. For legal entities, "You" includes any entity that
84
+ controls, is controlled by, or is under common control with You. For
85
+ purposes of this definition, "control" means (a) the power, direct
86
+ or indirect, to cause the direction or management of such entity,
87
+ whether by contract or otherwise, or (b) ownership of more than
88
+ fifty percent (50%) of the outstanding shares or beneficial
89
+ ownership of such entity.
90
+
91
+ 2. License Grants and Conditions
92
+ --------------------------------
93
+
94
+ 2.1. Grants
95
+
96
+ Each Contributor hereby grants You a world-wide, royalty-free,
97
+ non-exclusive license:
98
+
99
+ (a) under intellectual property rights (other than patent or trademark)
100
+ Licensable by such Contributor to use, reproduce, make available,
101
+ modify, display, perform, distribute, and otherwise exploit its
102
+ Contributions, either on an unmodified basis, with Modifications, or
103
+ as part of a Larger Work; and
104
+
105
+ (b) under Patent Claims of such Contributor to make, use, sell, offer
106
+ for sale, have made, import, and otherwise transfer either its
107
+ Contributions or its Contributor Version.
108
+
109
+ 2.2. Effective Date
110
+
111
+ The licenses granted in Section 2.1 with respect to any Contribution
112
+ become effective for each Contribution on the date the Contributor first
113
+ distributes such Contribution.
114
+
115
+ 2.3. Limitations on Grant Scope
116
+
117
+ The licenses granted in this Section 2 are the only rights granted under
118
+ this License. No additional rights or licenses will be implied from the
119
+ distribution or licensing of Covered Software under this License.
120
+ Notwithstanding Section 2.1(b) above, no patent license is granted by a
121
+ Contributor:
122
+
123
+ (a) for any code that a Contributor has removed from Covered Software;
124
+ or
125
+
126
+ (b) for infringements caused by: (i) Your and any other third party's
127
+ modifications of Covered Software, or (ii) the combination of its
128
+ Contributions with other software (except as part of its Contributor
129
+ Version); or
130
+
131
+ (c) under Patent Claims infringed by Covered Software in the absence of
132
+ its Contributions.
133
+
134
+ This License does not grant any rights in the trademarks, service marks,
135
+ or logos of any Contributor (except as may be necessary to comply with
136
+ the notice requirements in Section 3.4).
137
+
138
+ 2.4. Subsequent Licenses
139
+
140
+ No Contributor makes additional grants as a result of Your choice to
141
+ distribute the Covered Software under a subsequent version of this
142
+ License (see Section 10.2) or under the terms of a Secondary License (if
143
+ permitted under the terms of Section 3.3).
144
+
145
+ 2.5. Representation
146
+
147
+ Each Contributor represents that the Contributor believes its
148
+ Contributions are its original creation(s) or it has sufficient rights
149
+ to grant the rights to its Contributions conveyed by this License.
150
+
151
+ 2.6. Fair Use
152
+
153
+ This License is not intended to limit any rights You have under
154
+ applicable copyright doctrines of fair use, fair dealing, or other
155
+ equivalents.
156
+
157
+ 2.7. Conditions
158
+
159
+ Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
160
+ in Section 2.1.
161
+
162
+ 3. Responsibilities
163
+ -------------------
164
+
165
+ 3.1. Distribution of Source Form
166
+
167
+ All distribution of Covered Software in Source Code Form, including any
168
+ Modifications that You create or to which You contribute, must be under
169
+ the terms of this License. You must inform recipients that the Source
170
+ Code Form of the Covered Software is governed by the terms of this
171
+ License, and how they can obtain a copy of this License. You may not
172
+ attempt to alter or restrict the recipients' rights in the Source Code
173
+ Form.
174
+
175
+ 3.2. Distribution of Executable Form
176
+
177
+ If You distribute Covered Software in Executable Form then:
178
+
179
+ (a) such Covered Software must also be made available in Source Code
180
+ Form, as described in Section 3.1, and You must inform recipients of
181
+ the Executable Form how they can obtain a copy of such Source Code
182
+ Form by reasonable means in a timely manner, at a charge no more
183
+ than the cost of distribution to the recipient; and
184
+
185
+ (b) You may distribute such Executable Form under the terms of this
186
+ License, or sublicense it under different terms, provided that the
187
+ license for the Executable Form does not attempt to limit or alter
188
+ the recipients' rights in the Source Code Form under this License.
189
+
190
+ 3.3. Distribution of a Larger Work
191
+
192
+ You may create and distribute a Larger Work under terms of Your choice,
193
+ provided that You also comply with the requirements of this License for
194
+ the Covered Software. If the Larger Work is a combination of Covered
195
+ Software with a work governed by one or more Secondary Licenses, and the
196
+ Covered Software is not Incompatible With Secondary Licenses, this
197
+ License permits You to additionally distribute such Covered Software
198
+ under the terms of such Secondary License(s), so that the recipient of
199
+ the Larger Work may, at their option, further distribute the Covered
200
+ Software under the terms of either this License or such Secondary
201
+ License(s).
202
+
203
+ 3.4. Notices
204
+
205
+ You may not remove or alter the substance of any license notices
206
+ (including copyright notices, patent notices, disclaimers of warranty,
207
+ or limitations of liability) contained within the Source Code Form of
208
+ the Covered Software, except that You may alter any license notices to
209
+ the extent required to remedy known factual inaccuracies.
210
+
211
+ 3.5. Application of Additional Terms
212
+
213
+ You may choose to offer, and to charge a fee for, warranty, support,
214
+ indemnity or liability obligations to one or more recipients of Covered
215
+ Software. However, You may do so only on Your own behalf, and not on
216
+ behalf of any Contributor. You must make it absolutely clear that any
217
+ such warranty, support, indemnity, or liability obligation is offered by
218
+ You alone, and You hereby agree to indemnify every Contributor for any
219
+ liability incurred by such Contributor as a result of warranty, support,
220
+ indemnity or liability terms You offer. You may include additional
221
+ disclaimers of warranty and limitations of liability specific to any
222
+ jurisdiction.
223
+
224
+ 4. Inability to Comply Due to Statute or Regulation
225
+ ---------------------------------------------------
226
+
227
+ If it is impossible for You to comply with any of the terms of this
228
+ License with respect to some or all of the Covered Software due to
229
+ statute, judicial order, or regulation then You must: (a) comply with
230
+ the terms of this License to the maximum extent possible; and (b)
231
+ describe the limitations and the code they affect. Such description must
232
+ be placed in a text file included with all distributions of the Covered
233
+ Software under this License. Except to the extent prohibited by statute
234
+ or regulation, such description must be sufficiently detailed for a
235
+ recipient of ordinary skill to be able to understand it.
236
+
237
+ 5. Termination
238
+ --------------
239
+
240
+ 5.1. The rights granted under this License will terminate automatically
241
+ if You fail to comply with any of its terms. However, if You become
242
+ compliant, then the rights granted under this License from a particular
243
+ Contributor are reinstated (a) provisionally, unless and until such
244
+ Contributor explicitly and finally terminates Your grants, and (b) on an
245
+ ongoing basis, if such Contributor fails to notify You of the
246
+ non-compliance by some reasonable means prior to 60 days after You have
247
+ come back into compliance. Moreover, Your grants from a particular
248
+ Contributor are reinstated on an ongoing basis if such Contributor
249
+ notifies You of the non-compliance by some reasonable means, this is the
250
+ first time You have received notice of non-compliance with this License
251
+ from such Contributor, and You become compliant prior to 30 days after
252
+ Your receipt of the notice.
253
+
254
+ 5.2. If You initiate litigation against any entity by asserting a patent
255
+ infringement claim (excluding declaratory judgment actions,
256
+ counter-claims, and cross-claims) alleging that a Contributor Version
257
+ directly or indirectly infringes any patent, then the rights granted to
258
+ You by any and all Contributors for the Covered Software under Section
259
+ 2.1 of this License shall terminate.
260
+
261
+ 5.3. In the event of termination under Sections 5.1 or 5.2 above, all
262
+ end user license agreements (excluding distributors and resellers) which
263
+ have been validly granted by You or Your distributors under this License
264
+ prior to termination shall survive termination.
265
+
266
+ ************************************************************************
267
+ * *
268
+ * 6. Disclaimer of Warranty *
269
+ * ------------------------- *
270
+ * *
271
+ * Covered Software is provided under this License on an "as is" *
272
+ * basis, without warranty of any kind, either expressed, implied, or *
273
+ * statutory, including, without limitation, warranties that the *
274
+ * Covered Software is free of defects, merchantable, fit for a *
275
+ * particular purpose or non-infringing. The entire risk as to the *
276
+ * quality and performance of the Covered Software is with You. *
277
+ * Should any Covered Software prove defective in any respect, You *
278
+ * (not any Contributor) assume the cost of any necessary servicing, *
279
+ * repair, or correction. This disclaimer of warranty constitutes an *
280
+ * essential part of this License. No use of any Covered Software is *
281
+ * authorized under this License except under this disclaimer. *
282
+ * *
283
+ ************************************************************************
284
+
285
+ ************************************************************************
286
+ * *
287
+ * 7. Limitation of Liability *
288
+ * -------------------------- *
289
+ * *
290
+ * Under no circumstances and under no legal theory, whether tort *
291
+ * (including negligence), contract, or otherwise, shall any *
292
+ * Contributor, or anyone who distributes Covered Software as *
293
+ * permitted above, be liable to You for any direct, indirect, *
294
+ * special, incidental, or consequential damages of any character *
295
+ * including, without limitation, damages for lost profits, loss of *
296
+ * goodwill, work stoppage, computer failure or malfunction, or any *
297
+ * and all other commercial damages or losses, even if such party *
298
+ * shall have been informed of the possibility of such damages. This *
299
+ * limitation of liability shall not apply to liability for death or *
300
+ * personal injury resulting from such party's negligence to the *
301
+ * extent applicable law prohibits such limitation. Some *
302
+ * jurisdictions do not allow the exclusion or limitation of *
303
+ * incidental or consequential damages, so this exclusion and *
304
+ * limitation may not apply to You. *
305
+ * *
306
+ ************************************************************************
307
+
308
+ 8. Litigation
309
+ -------------
310
+
311
+ Any litigation relating to this License may be brought only in the
312
+ courts of a jurisdiction where the defendant maintains its principal
313
+ place of business and such litigation shall be governed by laws of that
314
+ jurisdiction, without reference to its conflict-of-law provisions.
315
+ Nothing in this Section shall prevent a party's ability to bring
316
+ cross-claims or counter-claims.
317
+
318
+ 9. Miscellaneous
319
+ ----------------
320
+
321
+ This License represents the complete agreement concerning the subject
322
+ matter hereof. If any provision of this License is held to be
323
+ unenforceable, such provision shall be reformed only to the extent
324
+ necessary to make it enforceable. Any law or regulation which provides
325
+ that the language of a contract shall be construed against the drafter
326
+ shall not be used to construe this License against a Contributor.
327
+
328
+ 10. Versions of the License
329
+ ---------------------------
330
+
331
+ 10.1. New Versions
332
+
333
+ Mozilla Foundation is the license steward. Except as provided in Section
334
+ 10.3, no one other than the license steward has the right to modify or
335
+ publish new versions of this License. Each version will be given a
336
+ distinguishing version number.
337
+
338
+ 10.2. Effect of New Versions
339
+
340
+ You may distribute the Covered Software under the terms of the version
341
+ of the License under which You originally received the Covered Software,
342
+ or under the terms of any subsequent version published by the license
343
+ steward.
344
+
345
+ 10.3. Modified Versions
346
+
347
+ If you create software not governed by this License, and you want to
348
+ create a new license for such software, you may create and use a
349
+ modified version of this License if you rename the license and remove
350
+ any references to the name of the license steward (except to note that
351
+ such modified license differs from this License).
352
+
353
+ 10.4. Distributing Source Code Form that is Incompatible With Secondary
354
+ Licenses
355
+
356
+ If You choose to distribute Source Code Form that is Incompatible With
357
+ Secondary Licenses under the terms of this version of the License, the
358
+ notice described in Exhibit B of this License must be attached.
359
+
360
+ Exhibit A - Source Code Form License Notice
361
+ -------------------------------------------
362
+
363
+ This Source Code Form is subject to the terms of the Mozilla Public
364
+ License, v. 2.0. If a copy of the MPL was not distributed with this
365
+ file, You can obtain one at https://mozilla.org/MPL/2.0/.
366
+
367
+ If it is not possible or desirable to put the notice in a particular
368
+ file, then You may include the notice in a location (such as a LICENSE
369
+ file in a relevant directory) where a recipient would be likely to look
370
+ for such a notice.
371
+
372
+ You may add additional accurate notices of copyright ownership.
373
+
374
+ Exhibit B - "Incompatible With Secondary Licenses" Notice
375
+ ---------------------------------------------------------
376
+
377
+ This Source Code Form is "Incompatible With Secondary Licenses", as
378
+ defined by the Mozilla Public License, v. 2.0.
379
+
380
+ ------------------------------------------------------------------------------
381
+
3
382
  esbuild-wasm 0.28.2
4
383
  License: MIT
5
384
 
@@ -403,30 +782,3 @@ Exhibit B - "Incompatible With Secondary Licenses" Notice
403
782
 
404
783
  This Source Code Form is "Incompatible With Secondary Licenses", as
405
784
  defined by the Mozilla Public License, v. 2.0.
406
-
407
- ------------------------------------------------------------------------------
408
-
409
- three 0.185.1
410
- License: MIT
411
-
412
- The MIT License
413
-
414
- Copyright © 2010-2026 three.js authors
415
-
416
- Permission is hereby granted, free of charge, to any person obtaining a copy
417
- of this software and associated documentation files (the "Software"), to deal
418
- in the Software without restriction, including without limitation the rights
419
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
420
- copies of the Software, and to permit persons to whom the Software is
421
- furnished to do so, subject to the following conditions:
422
-
423
- The above copyright notice and this permission notice shall be included in
424
- all copies or substantial portions of the Software.
425
-
426
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
427
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
428
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
429
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
430
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
431
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
432
- THE SOFTWARE.
@@ -1,2 +1,2 @@
1
- import{d as e,e as i,f as r,g as A,h as d,i as o}from"./chunks/chunk-2MAFJWBZ.js";import"./chunks/chunk-FY3BTKY4.js";export{e as AudioBusGraph,i as DEFAULT_SAMPLE_RATE,A as WebAudioMixer,o as WebAudioPlayer,o as WebAudioSink,d as encodeWav,r as mixAudio};
1
+ import{c as e,d as i,e as r,f as A,g as d,h as o}from"./chunks/chunk-IILVN4SK.js";import"./chunks/chunk-KLXMRKTL.js";export{e as AudioBusGraph,i as DEFAULT_SAMPLE_RATE,A as WebAudioMixer,o as WebAudioPlayer,o as WebAudioSink,d as encodeWav,r as mixAudio};
2
2
  //# sourceMappingURL=audio.js.map
@@ -0,0 +1,2 @@
1
+ var _=null;function nt(e){_=e}async function F(e){if(!_)return null;try{return await _(e)}catch{return null}}async function B(e){let t=await fetch(e);if(!t.ok){let n=t.statusText?`${t.status} ${t.statusText}`:`${t.status}`;throw new Error(`Fetching "${e}" failed: HTTP ${n}`)}return t.blob()}async function st(e){return await F(e)??B(e)}import{busStopKey as X}from"@motionscript/core";import{clipTimeAtSource as H,isRamp as E,resolveRamp as K,sampleRamp as T,sourceTimeAtClip as U,staticValue as P,transitionGainAt as Q,transitionSpans as z}from"@motionscript/core";var L=200;function I(e,t,n,s,r,i=c=>c){let c=u=>{let f=i(u);return Number.isFinite(f)?f:e.value};if(!E(t)){e.value=c(t);return}if(!Number.isFinite(s)||s<=0){e.value=c(P(t,e.value));return}let a=K(t,s);if(a.length===0)return;let d=n-r;e.setValueAtTime(c(T(t,Math.max(0,r),s,e.value)),n);for(let u=1;u<a.length;u++){let f=a[u-1],o=a[u],l=d+f.time,h=d+o.time;if(h<=n)continue;let p=o.time-f.time;if(p<=0){e.setValueAtTime(c(o.value),Math.max(h,n));continue}let m=Math.max(0,(n-l)/p),x=Math.max(l,n);if(o.linear)m===0&&e.setValueAtTime(c(f.value),x),e.linearRampToValueAtTime(c(o.value),h);else{let y=h-x,g=Math.max(2,Math.ceil(y*L)),v=new Float32Array(g);for(let w=0;w<g;w++){let O=m+(1-m)*(w/(g-1));v[w]=c(f.value+(o.value-f.value)*o.ease(O))}e.setValueCurveAtTime(v,x,y)}}}function b(e,t,n,s=e.currentTime,r=0,i=0){let c=[],a=[],d=t,u=o=>{d.connect(o),c.push(o),d=o},f=(o,l,h)=>I(o,l,s,r,i,h);for(let o of n)switch(o.type){case"gain":{let l=e.createGain();f(l.gain,o.value),u(l);break}case"highpass":case"lowpass":{let l=e.createBiquadFilter();l.type=o.type,f(l.frequency,o.frequency),o.q!==void 0&&f(l.Q,o.q),u(l);break}case"tremolo":{let l=e.createGain(),h=e.createOscillator(),p=e.createGain();f(l.gain,o.depth,m=>1-M(m)/2),f(p.gain,o.depth,m=>M(m)/2),f(h.frequency,o.rate),h.connect(p),p.connect(l.gain),c.push(p),a.push(h),u(l);break}case"echo":{let l=d,h=e.createGain(),p=e.createGain();f(p.gain,o.mix??.5,g=>1-M(g)),l.connect(p),p.connect(h);let m=e.createDelay(Math.max(1,J(o.delay)+1));f(m.delayTime,o.delay);let x=e.createGain();f(x.gain,o.feedback,g=>Math.max(0,Math.min(.99,g)));let y=e.createGain();f(y.gain,o.mix??.5,g=>M(g)),l.connect(m),m.connect(x),x.connect(m),m.connect(y),y.connect(h),c.push(p,m,x,y,h),d=h;break}}return{output:d,nodes:c,oscillators:a}}function M(e){return Math.max(0,Math.min(1,e))}function J(e){return E(e)?Math.max(0,...e.keys.map(t=>t.value)):e}function V(e,t,n,s,r,i){if(!n&&!s)return;let c=Math.max(0,i),a=o=>Q(o,t,n,s);e.setValueAtTime(a(c),r);let d=z(t,n,s),u=[];d.in>0&&u.push([0,d.in]),d.out>0&&Number.isFinite(t)&&u.push([t-d.out,t]);let f=r-i;for(let[o,l]of u){let h=Math.max(o,c),p=l-h;if(p<=0)continue;let m=Math.max(2,Math.ceil(p*L)),x=new Float32Array(m);for(let y=0;y<m;y++)x[y]=a(h+p*(y/(m-1)));e.setValueCurveAtTime(x,f+h,p)}}function R(e,t){let n=e.speed??1,s=E(n)?n:void 0,r=s||!(Number.isFinite(n)&&n>0)?1:n,i=e.sourceLength??Math.max(0,t-e.trimStart),c=Number.isFinite(e.endAt),a=c?Math.max(0,e.endAt-e.startAt):H(n,i);return{rate:r,speedRamp:s,sourceLength:i,clipDuration:a,transitionLength:c?a:1/0}}function S(e,t){return e.speedRamp?U(e.speedRamp,e.sourceLength,t):t*e.rate}function k(e,t,n,s,r,i){let c=e.createGain();if(I(c.gain,n.volume??1,r,s.clipDuration,i),t.connect(c),!n.transitionIn&&!n.transitionOut)return{output:c,nodes:[c]};let a=e.createGain();return V(a.gain,s.transitionLength,n.transitionIn,n.transitionOut,r,i),c.connect(a),{output:a,nodes:[c,a]}}function C(e,t,n,s,r,i){if(!t)return;let c=1/L,a=Math.max(0,i),d=u=>Math.max(1e-4,T(t,U(t,n,u),n,1));e.setValueAtTime(d(a),r);for(let u=a+c;u<=s+c;u+=c){let f=Math.min(u,s);if(e.linearRampToValueAtTime(d(f),r+(f-a)),f>=s)break}}var A=class{ctx;destination;constructor(t,n){this.ctx=t,this.destination=n}inputFor(t,n,s){return!t||t.length===0?this.destination:this.chainFrom(t,0,n,s)}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,n,s,r){if(n>=t.length)return this.destination;let i=t[n],c=t.slice(n).map(X).join(">"),a=this.inputs.get(c);if(a)return a;let d=this.chainFrom(t,n+1,s,r),u=this.ctx.createGain();u.gain.value=1;let f={type:"gain",value:i.mute?0:i.volume},o=i.endAt-i.startAt,l=b(this.ctx,u,[...i.effects??[],f],s,o,r-i.startAt),h=l.output;if(i.transitionIn||i.transitionOut){let p=this.ctx.createGain();V(p.gain,o,i.transitionIn,i.transitionOut,s,r-i.startAt),h.connect(p),this.nodes.push(p),h=p}h.connect(d),this.nodes.push(u,...l.nodes),this.oscillators.push(...l.oscillators);for(let p of l.oscillators)p.start(s);return this.inputs.set(c,u),u}};function Y(e,t){if(!e.loop)return null;let n=Math.min(Math.max(0,e.trimStart),t),s=Math.min(e.trimEnd??t,t);return s>n?{start:n,end:s}:null}function G(e,t){e.loop=t.loop;let n=e.buffer?Y(t,e.buffer.duration):null;return n&&(e.loopStart=n.start,e.loopEnd=n.end),n}function D(e,t){return!e||t<e.end?t:e.start+(t-e.start)%(e.end-e.start)}var $=44100;function Z(e,t){if(!t)return e;try{return t.getAudioMeta(e).src||e}catch{try{return t.getVideoMeta(e).src||e}catch{return e}}}async function q(e,t){let n=await F(e)??await B(e);return t.decodeAudioData(await n.arrayBuffer())}async function tt(e,t,n={}){if(e.length===0)return null;let s=n.sampleRate??$,r=Math.ceil(t*s);if(r<=0)return null;let i=[...new Set(e.map(o=>o.request.src))],c=new OfflineAudioContext(2,r,s),a=new Set(e.filter(o=>!o.request.optional).map(o=>o.request.src)),d=new Map;await Promise.all(i.map(async o=>{try{d.set(o,await q(Z(o,n.catalog),c))}catch(l){if(a.has(o))throw l}}));let u=new OfflineAudioContext(2,r,s),f=new A(u,u.destination);for(let{request:o,globalOffset:l}of e){let h=d.get(o.src);if(!h)continue;let p=l+o.startAt,x=Math.min(l+o.endAt,t)-p;if(x<=0)continue;let y=u.createBufferSource();y.buffer=h,G(y,o);let g=R(o,h.duration);g.rate!==1&&(y.playbackRate.value=g.rate),C(y.playbackRate,g.speedRamp,g.sourceLength,g.clipDuration,p,0);let v=b(u,y,o.effects??[],p,g.clipDuration,0);k(u,v.output,o,g,p,0).output.connect(f.inputFor(o.bus,0,-l));let O=S(g,x);y.start(p,o.trimStart,O);for(let W of v.oscillators)W.start(p)}return u.startRendering()}var N=class{sampleRate;catalog;constructor(t=$,n){this.sampleRate=t,this.catalog=n}mix(t,n){return tt(t,n,{sampleRate:this.sampleRate,catalog:this.catalog})}};function mt(e){let t=e.numberOfChannels,n=e.length,s=2,r=t*s,i=n*r,c=new ArrayBuffer(44+i),a=new DataView(c),d=(o,l)=>{for(let h=0;h<l.length;h++)a.setUint8(o+h,l.charCodeAt(h))};d(0,"RIFF"),a.setUint32(4,36+i,!0),d(8,"WAVE"),d(12,"fmt "),a.setUint32(16,16,!0),a.setUint16(20,1,!0),a.setUint16(22,t,!0),a.setUint32(24,e.sampleRate,!0),a.setUint32(28,e.sampleRate*r,!0),a.setUint16(32,r,!0),a.setUint16(34,8*s,!0),d(36,"data"),a.setUint32(40,i,!0);let u=[];for(let o=0;o<t;o++)u.push(e.getChannelData(o));let f=44;for(let o=0;o<n;o++)for(let l=0;l<t;l++){let h=Math.max(-1,Math.min(1,u[l][o]));a.setInt16(f,h<0?h*32768:h*32767,!0),f+=s}return new Uint8Array(c)}import{AudioSink as et}from"@motionscript/core";var j=class extends et{borrowed;_context=null;bufferCache=new Map;decoding=new Map;active=new Map;scheduled=[];disposed=!1;_graph=null;muted=!1;volume=1;constructor(t){super(),this.borrowed=t}getContext(){return this._context??=this.borrowed??new AudioContext,this._context}get context(){return this.getContext()}get graph(){if(!this._graph){let t=this.context.createGain();t.connect(this.context.destination),this._graph={master:t,buses:new A(this.context,t)},this.applyMasterGain()}return this._graph}unlock(){this.context.state==="suspended"&&this.context.resume()}has(t){return this.bufferCache.has(t)}async append(t,n){if(this.bufferCache.has(t))return;let s=this.decoding.get(t);if(s)return s;let r=this.context.decodeAudioData(n).then(i=>{this.bufferCache.set(t,i)}).finally(()=>{this.decoding.delete(t)});this.decoding.set(t,r),await r}retain(t){for(let n of[...this.bufferCache.keys()])t.has(n)||this.bufferCache.delete(n);for(let[n,s]of this.active)t.has(s.request.src)||this.stopSource(n,s)}schedule(t){let n=new Set(t.map(s=>s.id));for(let[s,r]of this.active)n.has(s)||this.stopSource(s,r);this.scheduled=t.slice()}syncTo(t){let n=new Set;for(let s of this.scheduled)if(t>=s.startAt&&t<s.endAt&&(n.add(s.id),!this.active.has(s.id))){let i=this.bufferCache.get(s.src);i&&this.playBuffer(i,s,t)}for(let[s,r]of this.active)n.has(s)||this.stopSource(s,r)}async play(t,n,s){this.context.state==="suspended"&&await this.context.resume(),this.syncTo(t)}stop(){for(let[t,n]of this.active)this.stopSource(t,n);this._graph?.buses.dispose()}setMuted(t){this.muted=t,this.applyMasterGain()}setVolume(t){this.volume=Math.max(0,t),this.applyMasterGain()}applyMasterGain(){this._graph&&(this._graph.master.gain.value=this.muted?0:this.volume)}playBuffer(t,n,s){let r=this.context.currentTime,i=R(n,t.duration),c=Math.max(0,s-n.startAt),a=this.context.createBufferSource();a.buffer=t;let d=G(a,n);i.rate!==1&&(a.playbackRate.value=i.rate),C(a.playbackRate,i.speedRamp,i.sourceLength,i.clipDuration,r,c);let u=b(this.context,a,n.effects??[],r,i.clipDuration,c),f=k(this.context,u.output,n,i,r,c);f.output.connect(this.graph.buses.inputFor(n.bus,r,s));let o=n.trimStart+S(i,c);a.start(r,D(d,o));for(let l of u.oscillators)l.start(r);a.onended=()=>{this.active.get(n.id)?.source===a&&this.active.delete(n.id)},this.active.set(n.id,{source:a,request:n,nodes:[...u.nodes,...f.nodes],oscillators:u.oscillators})}stopSource(t,n){try{n.source.onended=null,n.source.stop();for(let s of n.oscillators)s.stop();n.source.disconnect();for(let s of n.nodes)s.disconnect()}catch{}this.active.delete(t)}dispose(){if(this.disposed)return;this.disposed=!0,super.dispose(),this.bufferCache.clear(),this.decoding.clear(),this.scheduled.length=0,this._graph?.buses.dispose();try{this._graph?.master.disconnect()}catch{}let t=this.borrowed?null:this._context;t&&t.state!=="closed"&&t.close()}};export{nt as a,st as b,A as c,$ as d,tt as e,N as f,mt as g,j as h};
2
+ //# sourceMappingURL=chunk-IILVN4SK.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/asset-bytes.ts", "../../../src/audio/bus-graph.ts", "../../../src/audio/effect-graph.ts", "../../../src/audio/loop-region.ts", "../../../src/audio/mixer.ts", "../../../src/audio/player.ts"],
4
+ "sourcesContent": ["/**\r\n * Where a source URL's bytes come from: a host's local store, then the network.\r\n * The renderer's storage adapter reads every asset through it (`loadBytes`).\r\n *\r\n * ## Why the web adapter needs this at all\r\n *\r\n * The storage adapter addresses every asset by URL and fetches it. That is\r\n * right for an asset that lives somewhere, and wrong for one whose bytes the\r\n * host already has in hand — a file the user has just chosen, a render a local\r\n * model has just produced, a picture whose upload has not finished or cannot\r\n * start because there is no network. In all three the adapter downloads bytes\r\n * that never needed to travel.\r\n *\r\n * `NodeStorageAdapter` has had the answer since it was written: an injected\r\n * `AssetLoader`, with an `inline` map consulted ahead of the disk. This is the\r\n * same seam for the browser.\r\n *\r\n * ## Why it is module-level\r\n *\r\n * The storage adapter is constructed at several sites *inside* this package —\r\n * sessions, the exporter, the audio mixer and the still renderer — none of\r\n * which a host can reach. A constructor argument would\r\n * therefore cover the preview and leave export and stills on the network,\r\n * which is the worst of both: the picture a user sees would come from local\r\n * bytes and the one they render would not.\r\n *\r\n * So this is an *injection point*, not a cache. The adapter still owns every\r\n * decode, every cache, every size ceiling and every eviction rule; all this\r\n * changes is where the compressed bytes came from. A source that answers `null`\r\n * — which is what an unregistered URL, an evicted entry or a host with no local\r\n * store does — leaves the adapter exactly as it was.\r\n */\r\n\r\n/** Local bytes for a source URL, or `null` to go to the network. */\r\nexport type AssetByteSource = (src: string) => Promise<Blob | null>;\r\n\r\nlet source: AssetByteSource | null = null;\r\n\r\n/**\r\n * Installs the byte source for this browsing context, or clears it with `null`.\r\n *\r\n * Called once per window that renders. Later calls replace the previous source\r\n * rather than stacking, because two sources disagreeing about one URL has no\r\n * sensible answer.\r\n */\r\nexport function setAssetByteSource(next: AssetByteSource | null): void {\r\n source = next;\r\n}\r\n\r\n/**\r\n * The bytes for `src`, or `null`.\r\n *\r\n * Swallows a throwing source on purpose. A host's local store failing is a\r\n * cache miss, not a render failure — the caller falls through to `fetch`, which\r\n * is what it would have done had the source never been installed.\r\n */\r\nexport async function localAssetBytes(src: string): Promise<Blob | null> {\r\n if (!source) return null;\r\n try {\r\n return await source(src);\r\n } catch {\r\n return null;\r\n }\r\n}\r\n\r\n/**\r\n * The network's bytes for `url`. A response that is not OK is a failed load,\r\n * never bytes: a 404 page handed to the font manager marked a family loaded\r\n * with no face in it.\r\n */\r\nexport async function fetchAssetBytes(url: string): Promise<Blob> {\r\n const response = await fetch(url);\r\n if (!response.ok) {\r\n const status = response.statusText ? `${response.status} ${response.statusText}` : `${response.status}`;\r\n throw new Error(`Fetching \"${url}\" failed: HTTP ${status}`);\r\n }\r\n return response.blob();\r\n}\r\n\r\n/** The bytes for `src`: the host's local store first, then the network. */\r\nexport async function loadAssetBytes(src: string): Promise<Blob> {\r\n return (await localAssetBytes(src)) ?? fetchAssetBytes(src);\r\n}\r\n", "import { busStopKey, type AudioBusStop, type AudioEffect } from \"@motionscript/core\";\r\nimport { applyTransitions, buildAudioEffectGraph } from \"./effect-graph\";\r\n\r\n/**\r\n * The live chains for one audio context's buses.\r\n *\r\n * Held per context rather than per clip, because that is the whole difference\r\n * between a bus and per-clip processing: every clip naming a bus connects into\r\n * the *same* nodes, so a reverb on a bus is one tail the group shares rather\r\n * than one tail each. Flattening the levels into per-clip gain would sound\r\n * right; flattening the effects would not.\r\n */\r\nexport class AudioBusGraph {\r\n constructor(\r\n private readonly ctx: BaseAudioContext,\r\n /** Where the last bus in a chain connects — the master, or the destination. */\r\n private readonly destination: AudioNode,\r\n ) { }\r\n\r\n /**\r\n * The input node a clip on `bus` should connect to, building the chain the\r\n * first time it is asked for.\r\n *\r\n * `bus` is source-adjacent first, so `bus[0]` is the one the clip feeds and\r\n * each stop after it is that bus's own parent. An empty or absent chain\r\n * returns the destination, which is what every clip did before buses\r\n * existed.\r\n *\r\n * `startTime` is the context time a new chain's schedule starts from, and\r\n * `clipTime` the same instant in the stops' own seconds. A curve on a stop\r\n * runs over its `startAt`–`endAt`, so the two are what place it.\r\n */\r\n inputFor(bus: readonly AudioBusStop[] | undefined, startTime: number, clipTime: number): AudioNode {\r\n if (!bus || bus.length === 0) return this.destination;\r\n return this.chainFrom(bus, 0, startTime, clipTime);\r\n }\r\n\r\n /** Disconnect every live bus node, so the next {@link inputFor} builds afresh. Safe to call more than once. */\r\n dispose(): void {\r\n for (const node of this.nodes) {\r\n try { node.disconnect(); } catch { /* already torn down */ }\r\n }\r\n for (const osc of this.oscillators) {\r\n try { osc.stop(); } catch { /* never started, or already stopped */ }\r\n }\r\n this.nodes.length = 0;\r\n this.oscillators.length = 0;\r\n this.inputs.clear();\r\n }\r\n\r\n private readonly inputs = new Map<string, AudioNode>();\r\n private readonly nodes: AudioNode[] = [];\r\n private readonly oscillators: OscillatorNode[] = [];\r\n\r\n /**\r\n * Build (or reuse) the chain for `bus[index]`, connected to whatever\r\n * `bus[index + 1]` resolves to.\r\n *\r\n * Recursive rather than iterative because a bus's *output* has to exist\r\n * before its own nodes can connect to it, and the outermost bus is the last\r\n * entry.\r\n *\r\n * Reused by everything that changes what it sounds like, down to the master,\r\n * not by id alone: a bus edited under a playing device, or one id on two\r\n * tracks, is a different chain, and one built for the first would play the\r\n * second through stale levels and a curve anchored to the wrong span.\r\n */\r\n private chainFrom(bus: readonly AudioBusStop[], index: number, startTime: number, clipTime: number): AudioNode {\r\n if (index >= bus.length) return this.destination;\r\n\r\n const stop = bus[index];\r\n const key = bus.slice(index).map(busStopKey).join(\">\");\r\n const existing = this.inputs.get(key);\r\n if (existing) return existing;\r\n\r\n const output = this.chainFrom(bus, index + 1, startTime, clipTime);\r\n\r\n // A pass-through head every clip connects to, so the bus has one input\r\n // whatever its effects turn out to be.\r\n const input = this.ctx.createGain();\r\n input.gain.value = 1;\r\n\r\n // The level is a gain after the effects, as a sound's own level is, so a\r\n // ramp on it is scheduled exactly as one in `effects` is.\r\n const level: AudioEffect = { type: \"gain\", value: stop.mute ? 0 : stop.volume };\r\n const span = stop.endAt - stop.startAt;\r\n const graph = buildAudioEffectGraph(\r\n this.ctx, input, [...(stop.effects ?? []), level], startTime, span, clipTime - stop.startAt,\r\n );\r\n let tail = graph.output;\r\n if (stop.transitionIn || stop.transitionOut) {\r\n const transition = this.ctx.createGain();\r\n applyTransitions(transition.gain, span, stop.transitionIn, stop.transitionOut, startTime, clipTime - stop.startAt);\r\n tail.connect(transition);\r\n this.nodes.push(transition);\r\n tail = transition;\r\n }\r\n tail.connect(output);\r\n\r\n this.nodes.push(input, ...graph.nodes);\r\n this.oscillators.push(...graph.oscillators);\r\n for (const osc of graph.oscillators) osc.start(startTime);\r\n\r\n this.inputs.set(key, input);\r\n return input;\r\n }\r\n}\r\n", "import {\r\n clipTimeAtSource,\r\n isRamp,\r\n resolveRamp,\r\n sampleRamp,\r\n sourceTimeAtClip,\r\n staticValue,\r\n transitionGainAt,\r\n transitionSpans,\r\n type AudioEffect,\r\n type AudioRequest,\r\n type AudioTransition,\r\n type Param,\r\n type Ramp,\r\n} from \"@motionscript/core\";\r\n\r\n/**\r\n * The Web Audio graph for one source's effect chain.\r\n *\r\n * `output` is the last node, to connect downstream; `nodes` are every node to\r\n * `disconnect()` on teardown; `oscillators` are tremolo LFOs the caller starts\r\n * and stops alongside the source.\r\n */\r\nexport interface AudioEffectGraph {\r\n output: AudioNode;\r\n nodes: AudioNode[];\r\n oscillators: OscillatorNode[];\r\n}\r\n\r\n/** Sample points per second an eased segment or a transition is baked into: about every 5 ms. */\r\nconst CURVE_SAMPLES_PER_SECOND = 200;\r\n\r\n/**\r\n * Apply a {@link Param} to a Web Audio {@link AudioParam}: a number once, a\r\n * ramp as a schedule — linear segments as `linearRampToValueAtTime`, eased\r\n * ones baked into `setValueCurveAtTime`.\r\n *\r\n * `elapsed` is the clip seconds already played when a mid-clip seek starts the\r\n * source, so \"now\" reads the ramp at the clip's current position. `clamp` keeps\r\n * every scheduled value in a param's valid range.\r\n */\r\nfunction applyParam(\r\n audioParam: AudioParam,\r\n param: Param,\r\n startTime: number,\r\n clipDuration: number,\r\n elapsed: number,\r\n clamp: (v: number) => number = (v) => v,\r\n): void {\r\n // The platform throws on a non-finite value.\r\n const finite = (v: number): number => {\r\n const c = clamp(v);\r\n return Number.isFinite(c) ? c : audioParam.value;\r\n };\r\n\r\n if (!isRamp(param)) {\r\n audioParam.value = finite(param);\r\n return;\r\n }\r\n if (!Number.isFinite(clipDuration) || clipDuration <= 0) {\r\n audioParam.value = finite(staticValue(param, audioParam.value));\r\n return;\r\n }\r\n\r\n const keys = resolveRamp(param, clipDuration);\r\n if (keys.length === 0) return;\r\n const base = startTime - elapsed;\r\n audioParam.setValueAtTime(finite(sampleRamp(param, Math.max(0, elapsed), clipDuration, audioParam.value)), startTime);\r\n\r\n for (let i = 1; i < keys.length; i++) {\r\n const previous = keys[i - 1];\r\n const key = keys[i];\r\n const segStart = base + previous.time;\r\n const segEnd = base + key.time;\r\n if (segEnd <= startTime) continue;\r\n\r\n const span = key.time - previous.time;\r\n if (span <= 0) {\r\n audioParam.setValueAtTime(finite(key.value), Math.max(segEnd, startTime));\r\n continue;\r\n }\r\n\r\n // A segment already under way when the source starts carries on from\r\n // the value set at `startTime` rather than restarting from its own.\r\n const done = Math.max(0, (startTime - segStart) / span);\r\n const curveStart = Math.max(segStart, startTime);\r\n if (key.linear) {\r\n if (done === 0) audioParam.setValueAtTime(finite(previous.value), curveStart);\r\n audioParam.linearRampToValueAtTime(finite(key.value), segEnd);\r\n } else {\r\n const curveDur = segEnd - curveStart;\r\n const count = Math.max(2, Math.ceil(curveDur * CURVE_SAMPLES_PER_SECOND));\r\n const samples = new Float32Array(count);\r\n for (let n = 0; n < count; n++) {\r\n const local = done + (1 - done) * (n / (count - 1));\r\n samples[n] = finite(previous.value + (key.value - previous.value) * key.ease(local));\r\n }\r\n audioParam.setValueCurveAtTime(samples, curveStart, curveDur);\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * Builds the Web Audio graph for a clip's effect chain, after an\r\n * already-created `source`. Shared by live playback ({@link WebAudioSink}) and\r\n * offline export (`mixAudio`) so both sound identical.\r\n *\r\n * `startTime` is the context time the source starts; `clipDuration` the clip\r\n * seconds ramps run over (a clip's, or a bus's span); `elapsed` the clip seconds\r\n * already played at a mid-clip seek (0 for a clean start, negative before the\r\n * span begins).\r\n */\r\nexport function buildAudioEffectGraph(\r\n ctx: BaseAudioContext,\r\n source: AudioNode,\r\n effects: readonly AudioEffect[],\r\n startTime: number = ctx.currentTime,\r\n clipDuration: number = 0,\r\n elapsed: number = 0,\r\n): AudioEffectGraph {\r\n const nodes: AudioNode[] = [];\r\n const oscillators: OscillatorNode[] = [];\r\n let cursor: AudioNode = source;\r\n\r\n const series = (node: AudioNode): void => {\r\n cursor.connect(node);\r\n nodes.push(node);\r\n cursor = node;\r\n };\r\n\r\n const apply = (p: AudioParam, v: Param, clamp?: (n: number) => number): void =>\r\n applyParam(p, v, startTime, clipDuration, elapsed, clamp);\r\n\r\n for (const effect of effects) {\r\n switch (effect.type) {\r\n case \"gain\": {\r\n const gain = ctx.createGain();\r\n apply(gain.gain, effect.value);\r\n series(gain);\r\n break;\r\n }\r\n case \"highpass\":\r\n case \"lowpass\": {\r\n const biquad = ctx.createBiquadFilter();\r\n biquad.type = effect.type;\r\n apply(biquad.frequency, effect.frequency);\r\n if (effect.q !== undefined) apply(biquad.Q, effect.q);\r\n series(biquad);\r\n break;\r\n }\r\n case \"tremolo\": {\r\n // A carrier gain an LFO swings: with depth d the carrier sits at\r\n // 1 - d/2 and the swing is d/2.\r\n const carrier = ctx.createGain();\r\n const lfo = ctx.createOscillator();\r\n const lfoDepth = ctx.createGain();\r\n\r\n apply(carrier.gain, effect.depth, (d) => 1 - clamp01(d) / 2);\r\n apply(lfoDepth.gain, effect.depth, (d) => clamp01(d) / 2);\r\n apply(lfo.frequency, effect.rate);\r\n\r\n lfo.connect(lfoDepth);\r\n lfoDepth.connect(carrier.gain);\r\n\r\n nodes.push(lfoDepth);\r\n oscillators.push(lfo);\r\n series(carrier);\r\n break;\r\n }\r\n case \"echo\": {\r\n const split = cursor;\r\n const merge = ctx.createGain();\r\n\r\n const dry = ctx.createGain();\r\n apply(dry.gain, effect.mix ?? 0.5, (m) => 1 - clamp01(m));\r\n split.connect(dry);\r\n dry.connect(merge);\r\n\r\n // The delay line is sized once, so it has to hold the ramp's longest delay.\r\n const delay = ctx.createDelay(Math.max(1, maxOf(effect.delay) + 1));\r\n apply(delay.delayTime, effect.delay);\r\n const feedbackGain = ctx.createGain();\r\n apply(feedbackGain.gain, effect.feedback, (f) => Math.max(0, Math.min(0.99, f)));\r\n const wet = ctx.createGain();\r\n apply(wet.gain, effect.mix ?? 0.5, (m) => clamp01(m));\r\n\r\n split.connect(delay);\r\n delay.connect(feedbackGain);\r\n feedbackGain.connect(delay);\r\n delay.connect(wet);\r\n wet.connect(merge);\r\n\r\n nodes.push(dry, delay, feedbackGain, wet, merge);\r\n cursor = merge;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n return { output: cursor, nodes, oscillators };\r\n}\r\n\r\nfunction clamp01(v: number): number {\r\n return Math.max(0, Math.min(1, v));\r\n}\r\n\r\nfunction maxOf(p: Param): number {\r\n return isRamp(p) ? Math.max(0, ...p.keys.map((k) => k.value)) : p;\r\n}\r\n\r\n/**\r\n * Schedule `transitionIn`/`transitionOut` onto a gain over a span `length`\r\n * seconds long, baked like an eased ramp. Between the two it holds at 1.\r\n */\r\nexport function applyTransitions(\r\n gain: AudioParam,\r\n length: number,\r\n transitionIn: AudioTransition | undefined,\r\n transitionOut: AudioTransition | undefined,\r\n startTime: number,\r\n elapsed: number,\r\n): void {\r\n if (!transitionIn && !transitionOut) return;\r\n const seek = Math.max(0, elapsed);\r\n const at = (t: number): number => transitionGainAt(t, length, transitionIn, transitionOut);\r\n gain.setValueAtTime(at(seek), startTime);\r\n\r\n const spans = transitionSpans(length, transitionIn, transitionOut);\r\n const windows: [number, number][] = [];\r\n if (spans.in > 0) windows.push([0, spans.in]);\r\n if (spans.out > 0 && Number.isFinite(length)) windows.push([length - spans.out, length]);\r\n const base = startTime - elapsed;\r\n for (const [from, to] of windows) {\r\n const begin = Math.max(from, seek);\r\n const duration = to - begin;\r\n if (duration <= 0) continue;\r\n const count = Math.max(2, Math.ceil(duration * CURVE_SAMPLES_PER_SECOND));\r\n const samples = new Float32Array(count);\r\n for (let n = 0; n < count; n++) samples[n] = at(begin + duration * (n / (count - 1)));\r\n gain.setValueCurveAtTime(samples, base + begin, duration);\r\n }\r\n}\r\n\r\n/** How one request plays its source: the rate, and the lengths its ramps and transitions run over. */\r\nexport interface Playback {\r\n /** The constant `playbackRate`; 1 under a ramp, which is scheduled instead. */\r\n rate: number;\r\n speedRamp?: Ramp;\r\n /** Source seconds a speed ramp is placed on. */\r\n sourceLength: number;\r\n /** Clip seconds the volume and effect ramps run over. */\r\n clipDuration: number;\r\n /** What the transitions run over: the clip's length, unknown for an open one. */\r\n transitionLength: number;\r\n}\r\n\r\nexport function playbackOf(req: AudioRequest, bufferDuration: number): Playback {\r\n const speed = req.speed ?? 1;\r\n const speedRamp = isRamp(speed) ? speed : undefined;\r\n const rate = speedRamp || !(Number.isFinite(speed) && (speed as number) > 0) ? 1 : (speed as number);\r\n // Placed on the same length core sized the request with, not the decoded buffer.\r\n const sourceLength = req.sourceLength ?? Math.max(0, bufferDuration - req.trimStart);\r\n const bounded = Number.isFinite(req.endAt);\r\n const clipDuration = bounded ? Math.max(0, req.endAt - req.startAt) : clipTimeAtSource(speed, sourceLength);\r\n return { rate, speedRamp, sourceLength, clipDuration, transitionLength: bounded ? clipDuration : Infinity };\r\n}\r\n\r\n/** Source seconds after `trimStart` that `clipElapsed` clip seconds have played. */\r\nexport function sourceOffsetOf(playback: Playback, clipElapsed: number): number {\r\n return playback.speedRamp\r\n ? sourceTimeAtClip(playback.speedRamp, playback.sourceLength, clipElapsed)\r\n : clipElapsed * playback.rate;\r\n}\r\n\r\n/**\r\n * A request's level, then its transitions, after `from`: the gains every\r\n * request plays through on its way to its bus.\r\n */\r\nexport function buildLevel(\r\n ctx: BaseAudioContext,\r\n from: AudioNode,\r\n req: AudioRequest,\r\n playback: Playback,\r\n startTime: number,\r\n elapsed: number,\r\n): { output: AudioNode; nodes: AudioNode[] } {\r\n const level = ctx.createGain();\r\n applyParam(level.gain, req.volume ?? 1, startTime, playback.clipDuration, elapsed);\r\n from.connect(level);\r\n if (!req.transitionIn && !req.transitionOut) return { output: level, nodes: [level] };\r\n const transition = ctx.createGain();\r\n applyTransitions(transition.gain, playback.transitionLength, req.transitionIn, req.transitionOut, startTime, elapsed);\r\n level.connect(transition);\r\n return { output: transition, nodes: [level, transition] };\r\n}\r\n\r\n/**\r\n * Schedule a speed ramp onto an `AudioBufferSourceNode.playbackRate`.\r\n *\r\n * The ramp runs over **source** seconds and Web Audio schedules in context\r\n * seconds, so this walks clip time in small steps, converts each to a source\r\n * offset through the integral inverse, and lays down the rate there. `elapsed`\r\n * is clip seconds already played at a mid-clip seek.\r\n */\r\nexport function applySpeedToPlaybackRate(\r\n rate: AudioParam,\r\n speed: Ramp | undefined,\r\n sourceLength: number,\r\n clipDuration: number,\r\n startTime: number,\r\n elapsed: number,\r\n): void {\r\n if (!speed) return;\r\n const step = 1 / CURVE_SAMPLES_PER_SECOND;\r\n const seekAt = Math.max(0, elapsed);\r\n const valueAt = (clipElapsed: number): number =>\r\n Math.max(1e-4, sampleRamp(speed, sourceTimeAtClip(speed, sourceLength, clipElapsed), sourceLength, 1));\r\n rate.setValueAtTime(valueAt(seekAt), startTime);\r\n\r\n for (let s = seekAt + step; s <= clipDuration + step; s += step) {\r\n const clamped = Math.min(s, clipDuration);\r\n rate.linearRampToValueAtTime(valueAt(clamped), startTime + (clamped - seekAt));\r\n if (clamped >= clipDuration) break;\r\n }\r\n}\r\n", "import type { AudioRequest } from \"@motionscript/core\";\r\n\r\n/** The span of a decoded buffer a looping request repeats, in source seconds. */\r\nexport interface LoopRegion {\r\n start: number;\r\n end: number;\r\n}\r\n\r\n/**\r\n * The region a looping request repeats: from its in-point to its out-point, or to\r\n * the end of the buffer when it has none. `null` for a request that does not loop,\r\n * and for a degenerate region (an out-point at or before the in-point), where the\r\n * device falls back to wrapping the whole buffer.\r\n *\r\n * Shared by the live device and the offline mixer so a preview and an export loop\r\n * the same samples.\r\n */\r\nexport function loopRegionOf(request: AudioRequest, bufferDuration: number): LoopRegion | null {\r\n if (!request.loop) return null;\r\n const start = Math.min(Math.max(0, request.trimStart), bufferDuration);\r\n const end = Math.min(request.trimEnd ?? bufferDuration, bufferDuration);\r\n return end > start ? { start, end } : null;\r\n}\r\n\r\n/**\r\n * Configure `source` to play `request`'s loop: on or off, and over the trimmed\r\n * region rather than the whole buffer (`loopStart`/`loopEnd` default to the\r\n * whole buffer, which is how a trim used to be lost).\r\n */\r\nexport function applyLoop(source: AudioBufferSourceNode, request: AudioRequest): LoopRegion | null {\r\n source.loop = request.loop;\r\n const region = source.buffer ? loopRegionOf(request, source.buffer.duration) : null;\r\n if (region) {\r\n source.loopStart = region.start;\r\n source.loopEnd = region.end;\r\n }\r\n return region;\r\n}\r\n\r\n/**\r\n * Fold a source offset into a loop region.\r\n *\r\n * A seek into the middle of a looping clip lands at `trimStart + elapsed`, which\r\n * can be many passes past the region's end; the device would not wrap an offset\r\n * that starts outside the region, so it is wrapped here.\r\n */\r\nexport function wrapIntoRegion(region: LoopRegion | null, offset: number): number {\r\n if (!region || offset < region.end) return offset;\r\n return region.start + ((offset - region.start) % (region.end - region.start));\r\n}\r\n", "import type { AssetCatalog } from \"@motionscript/core\";\r\nimport type { AudioMixer, ScheduledAudioRequest } from \"../frame-loop\";\r\nimport { fetchAssetBytes, localAssetBytes } from \"../asset-bytes\";\r\nimport { AudioBusGraph } from \"./bus-graph\";\r\nimport { applyLoop } from \"./loop-region\";\r\nimport { applySpeedToPlaybackRate, buildAudioEffectGraph, buildLevel, playbackOf, sourceOffsetOf } from \"./effect-graph\";\r\n\r\n/** Sample rate used when the caller doesn't pick one. */\r\nexport const DEFAULT_SAMPLE_RATE = 44100;\r\n\r\nexport interface MixAudioOptions {\r\n /** Defaults to {@link DEFAULT_SAMPLE_RATE}. */\r\n sampleRate?: number;\r\n /**\r\n * Resolves a request's `src` to the address its bytes live at, as the storage\r\n * adapter does for the live paths. Omitted, a `src` is\r\n * fetched as written — right only while the host keys its manifest by URL.\r\n */\r\n catalog?: AssetCatalog;\r\n}\r\n\r\n/** Audio first, then video: a clip's own soundtrack is requested under the video's key. */\r\nfunction audioUrl(src: string, catalog: AssetCatalog | undefined): string {\r\n if (!catalog) return src;\r\n try {\r\n return catalog.getAudioMeta(src).src || src;\r\n } catch {\r\n try {\r\n return catalog.getVideoMeta(src).src || src;\r\n } catch {\r\n return src;\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * Reads and decodes an audio source against a scratch `OfflineAudioContext`\r\n * (decoding requires a context but doesn't render through it). The host's byte\r\n * source is asked first, as for every other asset read: a mix that went to the\r\n * network would fail where the preview played, offline or for bytes not yet\r\n * uploaded.\r\n */\r\nasync function fetchAudioBuffer(src: string, ctx: OfflineAudioContext): Promise<AudioBuffer> {\r\n const blob = (await localAssetBytes(src)) ?? (await fetchAssetBytes(src));\r\n return ctx.decodeAudioData(await blob.arrayBuffer());\r\n}\r\n\r\n/**\r\n * Render every scheduled request into one timeline-length buffer.\r\n *\r\n * An `OfflineAudioContext` graph — gain per request, looping/trimming, and the\r\n * same filter chain the live {@link WebAudioSink} builds — rendered in one\r\n * pass rather than scheduled per frame.\r\n *\r\n * Shared by the video exporter and by `mixTimelineAudio`, deliberately: a split\r\n * export and a whole one have to be the same mix, and two implementations of\r\n * \"stack these clips\" would eventually disagree.\r\n *\r\n * Curve-valued filter params and `speed` curves schedule here exactly as they do\r\n * in {@link WebAudioSink.playBuffer}, which is the reference implementation —\r\n * the two must be read side by side when either changes.\r\n *\r\n * One deliberate difference: this schedules at absolute context times, so clip\r\n * starts are sample-accurate here and quantized to `1/fps` in live playback,\r\n * which starts sources at `currentTime` on a clock tick.\r\n */\r\nexport async function mixAudio(\r\n requests: readonly ScheduledAudioRequest[],\r\n totalDuration: number,\r\n options: MixAudioOptions = {},\r\n): Promise<AudioBuffer | null> {\r\n if (requests.length === 0) return null;\r\n const sampleRate = options.sampleRate ?? DEFAULT_SAMPLE_RATE;\r\n const frames = Math.ceil(totalDuration * sampleRate);\r\n if (frames <= 0) return null;\r\n\r\n const uniqueSrcs = [...new Set(requests.map(r => r.request.src))];\r\n const scratchCtx = new OfflineAudioContext(2, frames, sampleRate);\r\n\r\n // A source only a picture's own sound wants may hold no audio at all, which\r\n // is silence rather than a failed mix — see `AudioRequest.optional`.\r\n const asked = new Set(requests.filter(r => !r.request.optional).map(r => r.request.src));\r\n const decoded = new Map<string, AudioBuffer>();\r\n await Promise.all(uniqueSrcs.map(async (src) => {\r\n try {\r\n decoded.set(src, await fetchAudioBuffer(audioUrl(src, options.catalog), scratchCtx));\r\n } catch (cause) {\r\n if (asked.has(src)) throw cause;\r\n }\r\n }));\r\n\r\n const mixCtx = new OfflineAudioContext(2, frames, sampleRate);\r\n // The same shared-chain rule the live device uses, for the same reason: an\r\n // export that flattened buses into per-clip processing would not match what\r\n // the preview sounded like.\r\n const buses = new AudioBusGraph(mixCtx, mixCtx.destination);\r\n\r\n for (const { request: req, globalOffset } of requests) {\r\n const srcBuffer = decoded.get(req.src);\r\n if (!srcBuffer) continue;\r\n\r\n const globalStart = globalOffset + req.startAt;\r\n // `endAt` is `Infinity` for an open clip; either way the timeline bounds it.\r\n const globalEnd = Math.min(globalOffset + req.endAt, totalDuration);\r\n const playDuration = globalEnd - globalStart;\r\n if (playDuration <= 0) continue;\r\n\r\n const source = mixCtx.createBufferSource();\r\n source.buffer = srcBuffer;\r\n applyLoop(source, req);\r\n\r\n // Ramps resolve against the clip's own length, deliberately *not*\r\n // `playDuration`, which is that length truncated by the timeline end:\r\n // resolving against the truncated value would squeeze the whole ramp\r\n // into the surviving part instead of cutting it off. `elapsed` is 0:\r\n // unlike a live seek, the mix always starts a clip at its beginning.\r\n const playback = playbackOf(req, srcBuffer.duration);\r\n if (playback.rate !== 1) source.playbackRate.value = playback.rate;\r\n applySpeedToPlaybackRate(\r\n source.playbackRate, playback.speedRamp, playback.sourceLength, playback.clipDuration, globalStart, 0,\r\n );\r\n\r\n // The same chain as the live WebAudioSink graph, so exports sound like the preview.\r\n const graph = buildAudioEffectGraph(mixCtx, source, req.effects ?? [], globalStart, playback.clipDuration, 0);\r\n const level = buildLevel(mixCtx, graph.output, req, playback, globalStart, 0);\r\n // From the mix's start, whichever clip asks first: a bus's chain is shared,\r\n // so its schedule cannot begin at one clip's start. Context time 0 is\r\n // `-globalOffset` in this request's seconds, which are its stops' too.\r\n level.output.connect(buses.inputFor(req.bus, 0, -globalOffset));\r\n\r\n // start()'s 3rd arg is a source-buffer duration: under a speed ramp the\r\n // buffer consumed over a span of clip time is the integral of the rate,\r\n // not a multiple of it.\r\n const consumed = sourceOffsetOf(playback, playDuration);\r\n\r\n source.start(globalStart, req.trimStart, consumed);\r\n for (const osc of graph.oscillators) osc.start(globalStart);\r\n }\r\n\r\n return mixCtx.startRendering();\r\n}\r\n\r\n/**\r\n * Adapter presenting {@link mixAudio} as the exporter's injected mixer seam.\r\n *\r\n * The sample rate is a constructor argument rather than a third `mix` parameter\r\n * because {@link AudioMixer} — the seam `renderTimeline` calls through — takes\r\n * exactly two, so anything passed as a third would be silently dropped. Fixing\r\n * it here rather than widening the interface keeps the rate a property of *this*\r\n * mixer, which is whose business it is.\r\n */\r\nexport class WebAudioMixer implements AudioMixer<AudioBuffer> {\r\n constructor(\r\n private readonly sampleRate: number = DEFAULT_SAMPLE_RATE,\r\n private readonly catalog?: AssetCatalog,\r\n ) { }\r\n\r\n mix(\r\n requests: readonly ScheduledAudioRequest[],\r\n totalDuration: number,\r\n ): Promise<AudioBuffer | null> {\r\n return mixAudio(requests, totalDuration, {\r\n sampleRate: this.sampleRate,\r\n catalog: this.catalog,\r\n });\r\n }\r\n}\r\n\r\n/**\r\n * Encode an `AudioBuffer` as a 16-bit PCM WAV.\r\n *\r\n * The only other encoder in this package is the AAC track inside the mp4 muxer,\r\n * which is reachable solely by exporting a video — so without this a mixdown has\r\n * no file representation at all. WAV because it needs no codec support and is\r\n * lossless; a host wanting mp3/aac can re-encode from here.\r\n */\r\nexport function encodeWav(buffer: AudioBuffer): Uint8Array<ArrayBuffer> {\r\n const channelCount = buffer.numberOfChannels;\r\n const frameCount = buffer.length;\r\n const bytesPerSample = 2;\r\n const blockAlign = channelCount * bytesPerSample;\r\n const dataBytes = frameCount * blockAlign;\r\n\r\n const out = new ArrayBuffer(44 + dataBytes);\r\n const view = new DataView(out);\r\n\r\n const ascii = (offset: number, text: string) => {\r\n for (let i = 0; i < text.length; i++) view.setUint8(offset + i, text.charCodeAt(i));\r\n };\r\n\r\n ascii(0, \"RIFF\");\r\n view.setUint32(4, 36 + dataBytes, true);\r\n ascii(8, \"WAVE\");\r\n ascii(12, \"fmt \");\r\n view.setUint32(16, 16, true); // PCM header length\r\n view.setUint16(20, 1, true); // format: PCM\r\n view.setUint16(22, channelCount, true);\r\n view.setUint32(24, buffer.sampleRate, true);\r\n view.setUint32(28, buffer.sampleRate * blockAlign, true);\r\n view.setUint16(32, blockAlign, true);\r\n view.setUint16(34, 8 * bytesPerSample, true);\r\n ascii(36, \"data\");\r\n view.setUint32(40, dataBytes, true);\r\n\r\n // Pull each channel out once — getChannelData is a live view, but calling it\r\n // per sample inside the interleave loop is measurably slower.\r\n const channels: Float32Array[] = [];\r\n for (let c = 0; c < channelCount; c++) channels.push(buffer.getChannelData(c));\r\n\r\n let offset = 44;\r\n for (let frame = 0; frame < frameCount; frame++) {\r\n for (let c = 0; c < channelCount; c++) {\r\n // Clamp before scaling: the mix bus can exceed [-1,1] where clips\r\n // overlap, and letting that wrap turns a loud passage into noise.\r\n const sample = Math.max(-1, Math.min(1, channels[c][frame]));\r\n view.setInt16(offset, sample < 0 ? sample * 0x8000 : sample * 0x7fff, true);\r\n offset += bytesPerSample;\r\n }\r\n }\r\n\r\n return new Uint8Array(out);\r\n}\r\n", "import { AudioSink, AudioRequest } from \"@motionscript/core\";\r\nimport { AudioBusGraph } from \"./bus-graph\";\r\nimport { applyLoop, wrapIntoRegion } from \"./loop-region\";\r\nimport { applySpeedToPlaybackRate, buildAudioEffectGraph, buildLevel, playbackOf, sourceOffsetOf } from \"./effect-graph\";\r\n\r\ntype ActiveSource = {\r\n source: AudioBufferSourceNode;\r\n request: AudioRequest;\r\n /** Effect and level nodes to disconnect on teardown. */\r\n nodes: AudioNode[];\r\n /** Tremolo LFOs to stop on teardown. */\r\n oscillators: OscillatorNode[];\r\n};\r\n\r\n/**\r\n * Web Audio implementation of {@link AudioSink} — decodes and caches source\r\n * buffers, then schedules/plays {@link AudioRequest}s as `AudioBufferSourceNode`s\r\n * through a shared master gain (global mute and volume). `schedule` registers the\r\n * active set of requests for the current frame; `syncTo` then starts/stops\r\n * sources to match `clipTime`, so playback follows scrubbing and seeks.\r\n */\r\nexport class WebAudioSink extends AudioSink {\r\n private readonly borrowed: AudioContext | undefined;\r\n private _context: AudioContext | null = null;\r\n private bufferCache = new Map<string, AudioBuffer>();\r\n private decoding = new Map<string, Promise<void>>();\r\n private active = new Map<string, ActiveSource>();\r\n private scheduled: AudioRequest[] = [];\r\n private disposed: boolean = false;\r\n /** The master gain and the live bus chains (shared across every clip that names one), built with the context. */\r\n private _graph: { master: GainNode; buses: AudioBusGraph } | null = null;\r\n private muted = false;\r\n private volume = 1;\r\n\r\n constructor(context?: AudioContext) {\r\n super();\r\n this.borrowed = context;\r\n }\r\n\r\n /**\r\n * The context, created on first use rather than with the sink: a new\r\n * AudioContext opens the audio device (50–65 ms on a desktop), and a\r\n * session that never plays or decodes sound never needs one.\r\n */\r\n getContext(): AudioContext {\r\n this._context ??= this.borrowed ?? new AudioContext();\r\n return this._context;\r\n }\r\n\r\n private get context(): AudioContext {\r\n return this.getContext();\r\n }\r\n\r\n private get graph(): { master: GainNode; buses: AudioBusGraph } {\r\n if (!this._graph) {\r\n const master = this.context.createGain();\r\n master.connect(this.context.destination);\r\n this._graph = { master, buses: new AudioBusGraph(this.context, master) };\r\n this.applyMasterGain();\r\n }\r\n return this._graph;\r\n }\r\n\r\n /**\r\n * Resume the AudioContext. Must be called from within a user gesture\r\n * (e.g. a click handler) the first time, or browsers keep the context\r\n * suspended and no audio is heard.\r\n */\r\n unlock(): void {\r\n if (this.context.state === \"suspended\") {\r\n this.context.resume();\r\n }\r\n }\r\n\r\n has(src: string): boolean {\r\n return this.bufferCache.has(src);\r\n }\r\n\r\n async append(src: string, data: ArrayBuffer): Promise<void> {\r\n if (this.bufferCache.has(src)) return;\r\n const existing = this.decoding.get(src);\r\n if (existing) return existing;\r\n\r\n // decodeAudioData detaches `data` — that's fine, the caller in\r\n // AssetManager.fetchAudio discards its reference immediately after\r\n // awaiting append. Skipping the defensive .slice(0) saves a multi-MB\r\n // allocation per audio source.\r\n const job = this.context.decodeAudioData(data).then((buffer) => {\r\n this.bufferCache.set(src, buffer);\r\n }).finally(() => {\r\n this.decoding.delete(src);\r\n });\r\n this.decoding.set(src, job);\r\n await job;\r\n }\r\n\r\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). */\r\n retain(keep: ReadonlySet<string>): void {\r\n for (const src of [...this.bufferCache.keys()]) {\r\n if (!keep.has(src)) this.bufferCache.delete(src);\r\n }\r\n for (const [id, active] of this.active) {\r\n if (!keep.has(active.request.src)) this.stopSource(id, active);\r\n }\r\n }\r\n\r\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`. */\r\n schedule(requests: readonly AudioRequest[]): void {\r\n const next = new Set(requests.map(r => r.id));\r\n for (const [id, active] of this.active) {\r\n if (!next.has(id)) this.stopSource(id, active);\r\n }\r\n this.scheduled = requests.slice();\r\n }\r\n\r\n /** Starts sources whose `[startAt, endAt)` window now contains `clipTime` (computing the correct buffer offset for the seek point) and stops any that have fallen outside it. */\r\n syncTo(clipTime: number): void {\r\n const liveIds = new Set<string>();\r\n\r\n for (const req of this.scheduled) {\r\n // `endAt` is `Infinity` for an open clip, so the comparison needs no\r\n // nullish fallback — see AudioRequest.endAt.\r\n const isInWindow = clipTime >= req.startAt && clipTime < req.endAt;\r\n if (!isInWindow) continue;\r\n\r\n liveIds.add(req.id);\r\n if (!this.active.has(req.id)) {\r\n const buffer = this.bufferCache.get(req.src);\r\n if (buffer) this.playBuffer(buffer, req, clipTime);\r\n }\r\n }\r\n\r\n for (const [id, active] of this.active) {\r\n if (!liveIds.has(id)) this.stopSource(id, active);\r\n }\r\n }\r\n\r\n async play(time: number, _speed: number, _reverse: boolean): Promise<void> {\r\n if (this.context.state === \"suspended\") {\r\n await this.context.resume();\r\n }\r\n this.syncTo(time);\r\n }\r\n\r\n stop(): void {\r\n for (const [id, active] of this.active) {\r\n this.stopSource(id, active);\r\n }\r\n // A bus's curves are scheduled against the clock of the run that built\r\n // it, so the next play, from wherever it lands, builds them again.\r\n this._graph?.buses.dispose();\r\n }\r\n\r\n setMuted(muted: boolean): void {\r\n this.muted = muted;\r\n this.applyMasterGain();\r\n }\r\n\r\n setVolume(volume: number): void {\r\n this.volume = Math.max(0, volume);\r\n this.applyMasterGain();\r\n }\r\n\r\n /** Mute and volume are held separately so unmuting restores the set level. */\r\n private applyMasterGain(): void {\r\n if (this._graph) this._graph.master.gain.value = this.muted ? 0 : this.volume;\r\n }\r\n\r\n /** Starts a buffer source mid-clip if `clipTime` lands after the request's start — the offset accounts for the request's trim, the elapsed time since `startAt`, and its speed. */\r\n private playBuffer(buffer: AudioBuffer, req: AudioRequest, clipTime: number): void {\r\n const startTime = this.context.currentTime;\r\n const playback = playbackOf(req, buffer.duration);\r\n const elapsed = Math.max(0, clipTime - req.startAt);\r\n\r\n const source = this.context.createBufferSource();\r\n source.buffer = buffer;\r\n const loopRegion = applyLoop(source, req);\r\n if (playback.rate !== 1) source.playbackRate.value = playback.rate;\r\n applySpeedToPlaybackRate(\r\n source.playbackRate, playback.speedRamp, playback.sourceLength, playback.clipDuration, startTime, elapsed,\r\n );\r\n\r\n const graph = buildAudioEffectGraph(\r\n this.context, source, req.effects ?? [], startTime, playback.clipDuration, elapsed,\r\n );\r\n const level = buildLevel(this.context, graph.output, req, playback, startTime, elapsed);\r\n // Into this clip's bus chain, or straight to the master when it has none.\r\n // The chain is shared: two clips on one bus reach the same nodes, which is\r\n // what makes a bus effect one tail rather than one per clip.\r\n level.output.connect(this.graph.buses.inputFor(req.bus, startTime, clipTime));\r\n\r\n const audioOffset = req.trimStart + sourceOffsetOf(playback, elapsed);\r\n source.start(startTime, wrapIntoRegion(loopRegion, audioOffset));\r\n for (const osc of graph.oscillators) osc.start(startTime);\r\n\r\n source.onended = () => {\r\n if (this.active.get(req.id)?.source === source) {\r\n this.active.delete(req.id);\r\n }\r\n };\r\n\r\n this.active.set(req.id, {\r\n source,\r\n request: req,\r\n nodes: [...graph.nodes, ...level.nodes],\r\n oscillators: graph.oscillators,\r\n });\r\n }\r\n\r\n private stopSource(id: string, active: ActiveSource): void {\r\n try {\r\n active.source.onended = null;\r\n active.source.stop();\r\n for (const osc of active.oscillators) osc.stop();\r\n active.source.disconnect();\r\n for (const node of active.nodes) node.disconnect();\r\n } catch {\r\n // already stopped\r\n }\r\n this.active.delete(id);\r\n }\r\n\r\n dispose(): void {\r\n if (this.disposed) return;\r\n this.disposed = true;\r\n super.dispose();\r\n this.bufferCache.clear();\r\n this.decoding.clear();\r\n this.scheduled.length = 0;\r\n this._graph?.buses.dispose();\r\n try {\r\n this._graph?.master.disconnect();\r\n } catch {\r\n // already disconnected\r\n }\r\n const owned = this.borrowed ? null : this._context;\r\n if (owned && owned.state !== \"closed\") {\r\n owned.close();\r\n }\r\n }\r\n}\r\n"],
5
+ "mappings": "AAoCA,IAAIA,EAAiC,KAS/B,SAAUC,GAAmBC,EAA4B,CAC3DF,EAASE,CACb,CASA,eAAsBC,EAAgBC,EAAW,CAC7C,GAAI,CAACJ,EAAQ,OAAO,KACpB,GAAI,CACA,OAAO,MAAMA,EAAOI,CAAG,CAC3B,MAAQ,CACJ,OAAO,IACX,CACJ,CAOA,eAAs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,UAAU,OAAS,EACxB,KAAK,QAAQ,MAAM,QAAO,EAC1B,GAAI,CACA,KAAK,QAAQ,OAAO,WAAU,CAClC,MAAQ,CAER,CACA,IAAM8B,EAAQ,KAAK,SAAW,KAAO,KAAK,SACtCA,GAASA,EAAM,QAAU,UACzBA,EAAM,MAAK,CAEnB",
6
+ "names": ["source", "setAssetByteSource", "next", "localAssetBytes", "src", "fetchAssetBytes", "url", "response", "status", "loadAssetBytes", "busStopKey", "clipTimeAtSource", "isRamp", "resolveRamp", "sampleRamp", "sourceTimeAtClip", "staticValue", "transitionGainAt", "transitionSpans", "CURVE_SAMPLES_PER_SECOND", "applyParam", "audioParam", "param", "startTime", "clipDuration", "elapsed", "clamp", "v", "finite", "c", "keys", "base", "i", "previous", "key", "segStart", "segEnd", "span", "done", "curveStart", "curveDur", "count", "samples", "n", "local", "buildAudioEffectGraph", "ctx", "source", "effects", "nodes", "oscillators", "cursor", "series", "node", "apply", "p", "effect", "gain", "biquad", "carrier", "lfo", "lfoDepth", "d", "clamp01", "split", "merge", "dry", "m", "delay", "maxOf", "feedbackGain", "f", "wet", "k", "applyTransitions", "length", "transitionIn", "transitionOut", "seek", "at", "t", "spans", "windows", "from", "to", "begin", "duration", "playbackOf", "req", "bufferDuration", "speed", "speedRamp", "rate", "sourceLength", "bounded", "sourceOffsetOf", "playback", "clipElapsed", "buildLevel", "level", "transition", "applySpeedToPlaybackRate", "step", "seekAt", "valueAt", "s", "clamped", "AudioBusGraph", "ctx", "destination", "bus", "startTime", "clipTime", "node", "osc", "index", "stop", "key", "busStopKey", "existing", "output", "input", "level", "span", "graph", "buildAudioEffectGraph", "tail", "transition", "applyTransitions", "loopRegionOf", "request", "bufferDuration", "start", "end", "applyLoop", "source", "region", "wrapIntoRegion", "offset", "DEFAULT_SAMPLE_RATE", "audioUrl", "src", "catalog", "fetchAudioBuffer", "ctx", "blob", "localAssetBytes", "fetchAssetBytes", "mixAudio", "requests", "totalDuration", "options", "sampleRate", "frames", "uniqueSrcs", "r", "scratchCtx", "asked", "decoded", "cause", "mixCtx", "buses", "AudioBusGraph", "req", "globalOffset", "srcBuffer", "globalStart", "playDuration", "source", "applyLoop", "playback", "playbackOf", "applySpeedToPlaybackRate", "graph", "buildAudioEffectGraph", "buildLevel", "consumed", "sourceOffsetOf", "osc", "WebAudioMixer", "encodeWav", "buffer", "channelCount", "frameCount", "bytesPerSample", "blockAlign", "dataBytes", "out", "view", "ascii", "offset", "text", "i", "channels", "c", "frame", "sample", "AudioSink", "WebAudioSink", "AudioSink", "context", "master", "AudioBusGraph", "src", "data", "existing", "job", "buffer", "keep", "id", "active", "requests", "next", "r", "clipTime", "liveIds", "req", "time", "_speed", "_reverse", "muted", "volume", "startTime", "playback", "playbackOf", "elapsed", "source", "loopRegion", "applyLoop", "applySpeedToPlaybackRate", "graph", "buildAudioEffectGraph", "level", "buildLevel", "audioOffset", "sourceOffsetOf", "wrapIntoRegion", "osc", "node", "owned"]
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=(a=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(a,{get:(b,c)=>(typeof require<"u"?require:b)[c]}):a)(function(a){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+a+'" is not supported')});var n=(a,b)=>()=>{try{return b||a((b={exports:{}}).exports,b),b.exports}catch(c){throw b=0,c}};var l=(a,b,c,e)=>{if(b&&typeof b=="object"||typeof b=="function")for(let d of i(b))!k.call(a,d)&&d!==c&&f(a,d,{get:()=>b[d],enumerable:!(e=h(b,d))||e.enumerable});return a};var o=(a,b,c)=>(c=a!=null?g(j(a)):{},l(b||!a||!a.__esModule?f(c,"default",{value:a,enumerable:!0}):c,a));export{m as a,n as b,o as c};
2
+ //# sourceMappingURL=chunk-KLXMRKTL.js.map