@hussmartinez/audio-sdk 0.5.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +105 -22
- package/dist/assets/audio/audio.worker.js +1 -1
- package/dist/element.d.ts +1010 -1
- package/dist/element.js +121 -0
- package/dist/element.js.map +1 -0
- package/dist/index.d.ts +761 -149
- package/dist/index.js +321 -1782
- package/dist/index.js.map +1 -1
- package/dist/lazy/inline-worker-CVcXmYih.js +30 -0
- package/dist/lazy/{inline-worker-CR5UIkzK.js.map → inline-worker-CVcXmYih.js.map} +1 -1
- package/dist/react.d.ts +1957 -3
- package/dist/react.js +1 -0
- package/dist/shared/AudioEditor-C9yohR_Z.js +2801 -0
- package/dist/shared/AudioEditor-C9yohR_Z.js.map +1 -0
- package/dist/shared/text-CgDrmmTa.js +2663 -0
- package/dist/shared/text-CgDrmmTa.js.map +1 -0
- package/dist/styles.css +329 -0
- package/formats/hm-audio-command/v2.schema.json +381 -0
- package/formats/hm-audio-plan/v2.schema.json +226 -0
- package/package.json +10 -6
- package/dist/lazy/inline-worker-CR5UIkzK.js +0 -30
|
@@ -0,0 +1,381 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://github.com/ie-huss-martinez/audio-sdk/blob/main/formats/hm-audio-command/v2.schema.json",
|
|
4
|
+
"title": "hm-audio-command, version 2",
|
|
5
|
+
"description": "One user-level edit to an hm-audio-plan of version 2 (docs/formats/hm-audio-plan.md, docs/adr/0006, sdk-core ADR 0045). Clip edits never move another clip; time edits add or remove time on the tracks they name. The commands undo runs, such as audio.replaceClips, are internal and not part of this format. Beyond this schema, the reducer checks each command against the plan it applies to.",
|
|
6
|
+
"oneOf": [
|
|
7
|
+
{
|
|
8
|
+
"description": "Adds clips to a track, each at its own position, in free space.",
|
|
9
|
+
"type": "object",
|
|
10
|
+
"required": ["type", "track", "clips"],
|
|
11
|
+
"additionalProperties": false,
|
|
12
|
+
"properties": {
|
|
13
|
+
"type": {
|
|
14
|
+
"const": "audio.insertClips"
|
|
15
|
+
},
|
|
16
|
+
"track": {
|
|
17
|
+
"$ref": "https://github.com/ie-huss-martinez/audio-sdk/blob/main/formats/hm-audio-plan/v2.schema.json#/$defs/key"
|
|
18
|
+
},
|
|
19
|
+
"clips": {
|
|
20
|
+
"type": "array",
|
|
21
|
+
"minItems": 1,
|
|
22
|
+
"items": {
|
|
23
|
+
"$ref": "https://github.com/ie-huss-martinez/audio-sdk/blob/main/formats/hm-audio-plan/v2.schema.json#/$defs/clip"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"description": "Removes clips, on any tracks, leaving silence.",
|
|
30
|
+
"type": "object",
|
|
31
|
+
"required": ["type", "keys"],
|
|
32
|
+
"additionalProperties": false,
|
|
33
|
+
"properties": {
|
|
34
|
+
"type": {
|
|
35
|
+
"const": "audio.removeClips"
|
|
36
|
+
},
|
|
37
|
+
"keys": {
|
|
38
|
+
"type": "array",
|
|
39
|
+
"minItems": 1,
|
|
40
|
+
"items": {
|
|
41
|
+
"$ref": "https://github.com/ie-huss-martinez/audio-sdk/blob/main/formats/hm-audio-plan/v2.schema.json#/$defs/key"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"description": "Changes the source range a clip plays. The audio stays where it is on the timeline.",
|
|
48
|
+
"type": "object",
|
|
49
|
+
"required": ["type", "key", "start", "end"],
|
|
50
|
+
"additionalProperties": false,
|
|
51
|
+
"properties": {
|
|
52
|
+
"type": {
|
|
53
|
+
"const": "audio.trimClip"
|
|
54
|
+
},
|
|
55
|
+
"key": {
|
|
56
|
+
"$ref": "https://github.com/ie-huss-martinez/audio-sdk/blob/main/formats/hm-audio-plan/v2.schema.json#/$defs/key"
|
|
57
|
+
},
|
|
58
|
+
"start": {
|
|
59
|
+
"$ref": "https://github.com/ie-huss-martinez/audio-sdk/blob/main/formats/hm-audio-plan/v2.schema.json#/$defs/frames"
|
|
60
|
+
},
|
|
61
|
+
"end": {
|
|
62
|
+
"$ref": "https://github.com/ie-huss-martinez/audio-sdk/blob/main/formats/hm-audio-plan/v2.schema.json#/$defs/frames"
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"description": "Splits a clip at a timeline frame strictly inside it. The second part takes newKey.",
|
|
68
|
+
"type": "object",
|
|
69
|
+
"required": ["type", "key", "at", "newKey"],
|
|
70
|
+
"additionalProperties": false,
|
|
71
|
+
"properties": {
|
|
72
|
+
"type": {
|
|
73
|
+
"const": "audio.splitClip"
|
|
74
|
+
},
|
|
75
|
+
"key": {
|
|
76
|
+
"$ref": "https://github.com/ie-huss-martinez/audio-sdk/blob/main/formats/hm-audio-plan/v2.schema.json#/$defs/key"
|
|
77
|
+
},
|
|
78
|
+
"at": {
|
|
79
|
+
"$ref": "https://github.com/ie-huss-martinez/audio-sdk/blob/main/formats/hm-audio-plan/v2.schema.json#/$defs/frames"
|
|
80
|
+
},
|
|
81
|
+
"newKey": {
|
|
82
|
+
"$ref": "https://github.com/ie-huss-martinez/audio-sdk/blob/main/formats/hm-audio-plan/v2.schema.json#/$defs/key"
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"description": "Moves clips by a signed number of frames, and to another track when one is named.",
|
|
88
|
+
"type": "object",
|
|
89
|
+
"required": ["type", "keys", "by"],
|
|
90
|
+
"additionalProperties": false,
|
|
91
|
+
"properties": {
|
|
92
|
+
"type": {
|
|
93
|
+
"const": "audio.moveClips"
|
|
94
|
+
},
|
|
95
|
+
"keys": {
|
|
96
|
+
"type": "array",
|
|
97
|
+
"minItems": 1,
|
|
98
|
+
"items": {
|
|
99
|
+
"$ref": "https://github.com/ie-huss-martinez/audio-sdk/blob/main/formats/hm-audio-plan/v2.schema.json#/$defs/key"
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
"by": {
|
|
103
|
+
"description": "A signed whole number of frames.",
|
|
104
|
+
"type": "integer",
|
|
105
|
+
"minimum": -9007199254740991,
|
|
106
|
+
"maximum": 9007199254740991
|
|
107
|
+
},
|
|
108
|
+
"track": {
|
|
109
|
+
"$ref": "https://github.com/ie-huss-martinez/audio-sdk/blob/main/formats/hm-audio-plan/v2.schema.json#/$defs/key"
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"description": "Sets the gain of clips.",
|
|
115
|
+
"type": "object",
|
|
116
|
+
"required": ["type", "keys", "gainDb"],
|
|
117
|
+
"additionalProperties": false,
|
|
118
|
+
"properties": {
|
|
119
|
+
"type": {
|
|
120
|
+
"const": "audio.setGain"
|
|
121
|
+
},
|
|
122
|
+
"keys": {
|
|
123
|
+
"type": "array",
|
|
124
|
+
"minItems": 1,
|
|
125
|
+
"items": {
|
|
126
|
+
"$ref": "https://github.com/ie-huss-martinez/audio-sdk/blob/main/formats/hm-audio-plan/v2.schema.json#/$defs/key"
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
"gainDb": {
|
|
130
|
+
"$ref": "https://github.com/ie-huss-martinez/audio-sdk/blob/main/formats/hm-audio-plan/v2.schema.json#/$defs/gainDb"
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
"description": "Sets a clip's fade in or fade out.",
|
|
136
|
+
"type": "object",
|
|
137
|
+
"required": ["type", "key", "edge", "frames", "curve"],
|
|
138
|
+
"additionalProperties": false,
|
|
139
|
+
"properties": {
|
|
140
|
+
"type": {
|
|
141
|
+
"const": "audio.setFade"
|
|
142
|
+
},
|
|
143
|
+
"key": {
|
|
144
|
+
"$ref": "https://github.com/ie-huss-martinez/audio-sdk/blob/main/formats/hm-audio-plan/v2.schema.json#/$defs/key"
|
|
145
|
+
},
|
|
146
|
+
"edge": {
|
|
147
|
+
"enum": ["in", "out"]
|
|
148
|
+
},
|
|
149
|
+
"frames": {
|
|
150
|
+
"$ref": "https://github.com/ie-huss-martinez/audio-sdk/blob/main/formats/hm-audio-plan/v2.schema.json#/$defs/frames"
|
|
151
|
+
},
|
|
152
|
+
"curve": {
|
|
153
|
+
"enum": ["linear", "equalPower"]
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
"description": "Removes a range of time from the named tracks. With ripple, later clips on those tracks move earlier by its length. newKeys gives, by track, the key of the part after the range, where the range lies inside one clip.",
|
|
159
|
+
"type": "object",
|
|
160
|
+
"required": ["type", "start", "end", "tracks", "ripple"],
|
|
161
|
+
"additionalProperties": false,
|
|
162
|
+
"properties": {
|
|
163
|
+
"type": {
|
|
164
|
+
"const": "audio.deleteRange"
|
|
165
|
+
},
|
|
166
|
+
"start": {
|
|
167
|
+
"$ref": "https://github.com/ie-huss-martinez/audio-sdk/blob/main/formats/hm-audio-plan/v2.schema.json#/$defs/frames"
|
|
168
|
+
},
|
|
169
|
+
"end": {
|
|
170
|
+
"$ref": "https://github.com/ie-huss-martinez/audio-sdk/blob/main/formats/hm-audio-plan/v2.schema.json#/$defs/frames"
|
|
171
|
+
},
|
|
172
|
+
"tracks": {
|
|
173
|
+
"type": "array",
|
|
174
|
+
"minItems": 1,
|
|
175
|
+
"items": {
|
|
176
|
+
"$ref": "https://github.com/ie-huss-martinez/audio-sdk/blob/main/formats/hm-audio-plan/v2.schema.json#/$defs/key"
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
"ripple": {
|
|
180
|
+
"type": "boolean"
|
|
181
|
+
},
|
|
182
|
+
"newKeys": {
|
|
183
|
+
"description": "New clip keys, by the key of the track each is for.",
|
|
184
|
+
"type": "object",
|
|
185
|
+
"propertyNames": {
|
|
186
|
+
"minLength": 1
|
|
187
|
+
},
|
|
188
|
+
"additionalProperties": {
|
|
189
|
+
"$ref": "https://github.com/ie-huss-martinez/audio-sdk/blob/main/formats/hm-audio-plan/v2.schema.json#/$defs/key"
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
"description": "Removes everything outside a range, on every track, and moves what's kept to the start.",
|
|
196
|
+
"type": "object",
|
|
197
|
+
"required": ["type", "start", "end"],
|
|
198
|
+
"additionalProperties": false,
|
|
199
|
+
"properties": {
|
|
200
|
+
"type": {
|
|
201
|
+
"const": "audio.keepRange"
|
|
202
|
+
},
|
|
203
|
+
"start": {
|
|
204
|
+
"$ref": "https://github.com/ie-huss-martinez/audio-sdk/blob/main/formats/hm-audio-plan/v2.schema.json#/$defs/frames"
|
|
205
|
+
},
|
|
206
|
+
"end": {
|
|
207
|
+
"$ref": "https://github.com/ie-huss-martinez/audio-sdk/blob/main/formats/hm-audio-plan/v2.schema.json#/$defs/frames"
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
"description": "Opens silence on the named tracks, splitting a clip that lies across the frame. newKeys gives, by track, the key of the second part of a split clip.",
|
|
213
|
+
"type": "object",
|
|
214
|
+
"required": ["type", "at", "frames", "tracks"],
|
|
215
|
+
"additionalProperties": false,
|
|
216
|
+
"properties": {
|
|
217
|
+
"type": {
|
|
218
|
+
"const": "audio.insertTime"
|
|
219
|
+
},
|
|
220
|
+
"at": {
|
|
221
|
+
"$ref": "https://github.com/ie-huss-martinez/audio-sdk/blob/main/formats/hm-audio-plan/v2.schema.json#/$defs/frames"
|
|
222
|
+
},
|
|
223
|
+
"frames": {
|
|
224
|
+
"type": "integer",
|
|
225
|
+
"minimum": 1,
|
|
226
|
+
"maximum": 9007199254740991
|
|
227
|
+
},
|
|
228
|
+
"tracks": {
|
|
229
|
+
"type": "array",
|
|
230
|
+
"minItems": 1,
|
|
231
|
+
"items": {
|
|
232
|
+
"$ref": "https://github.com/ie-huss-martinez/audio-sdk/blob/main/formats/hm-audio-plan/v2.schema.json#/$defs/key"
|
|
233
|
+
}
|
|
234
|
+
},
|
|
235
|
+
"newKeys": {
|
|
236
|
+
"description": "New clip keys, by the key of the track each is for.",
|
|
237
|
+
"type": "object",
|
|
238
|
+
"propertyNames": {
|
|
239
|
+
"minLength": 1
|
|
240
|
+
},
|
|
241
|
+
"additionalProperties": {
|
|
242
|
+
"$ref": "https://github.com/ie-huss-martinez/audio-sdk/blob/main/formats/hm-audio-plan/v2.schema.json#/$defs/key"
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
"description": "Adds an empty track at an index.",
|
|
249
|
+
"type": "object",
|
|
250
|
+
"required": ["type", "key", "index"],
|
|
251
|
+
"additionalProperties": false,
|
|
252
|
+
"properties": {
|
|
253
|
+
"type": {
|
|
254
|
+
"const": "audio.addTrack"
|
|
255
|
+
},
|
|
256
|
+
"key": {
|
|
257
|
+
"$ref": "https://github.com/ie-huss-martinez/audio-sdk/blob/main/formats/hm-audio-plan/v2.schema.json#/$defs/key"
|
|
258
|
+
},
|
|
259
|
+
"index": {
|
|
260
|
+
"type": "integer",
|
|
261
|
+
"minimum": 0,
|
|
262
|
+
"maximum": 9007199254740991
|
|
263
|
+
},
|
|
264
|
+
"name": {
|
|
265
|
+
"$ref": "https://github.com/ie-huss-martinez/audio-sdk/blob/main/formats/hm-audio-plan/v2.schema.json#/$defs/trackName"
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
"description": "Removes tracks, with their clips. A plan keeps at least one track.",
|
|
271
|
+
"type": "object",
|
|
272
|
+
"required": ["type", "keys"],
|
|
273
|
+
"additionalProperties": false,
|
|
274
|
+
"properties": {
|
|
275
|
+
"type": {
|
|
276
|
+
"const": "audio.removeTracks"
|
|
277
|
+
},
|
|
278
|
+
"keys": {
|
|
279
|
+
"type": "array",
|
|
280
|
+
"minItems": 1,
|
|
281
|
+
"items": {
|
|
282
|
+
"$ref": "https://github.com/ie-huss-martinez/audio-sdk/blob/main/formats/hm-audio-plan/v2.schema.json#/$defs/key"
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
"description": "Moves a track to an index of the resulting plan.",
|
|
289
|
+
"type": "object",
|
|
290
|
+
"required": ["type", "key", "to"],
|
|
291
|
+
"additionalProperties": false,
|
|
292
|
+
"properties": {
|
|
293
|
+
"type": {
|
|
294
|
+
"const": "audio.moveTrack"
|
|
295
|
+
},
|
|
296
|
+
"key": {
|
|
297
|
+
"$ref": "https://github.com/ie-huss-martinez/audio-sdk/blob/main/formats/hm-audio-plan/v2.schema.json#/$defs/key"
|
|
298
|
+
},
|
|
299
|
+
"to": {
|
|
300
|
+
"type": "integer",
|
|
301
|
+
"minimum": 0,
|
|
302
|
+
"maximum": 9007199254740991
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
"description": "Sets the fields given of a track, at least one.",
|
|
308
|
+
"type": "object",
|
|
309
|
+
"required": ["type", "key"],
|
|
310
|
+
"additionalProperties": false,
|
|
311
|
+
"properties": {
|
|
312
|
+
"type": {
|
|
313
|
+
"const": "audio.setTrack"
|
|
314
|
+
},
|
|
315
|
+
"key": {
|
|
316
|
+
"$ref": "https://github.com/ie-huss-martinez/audio-sdk/blob/main/formats/hm-audio-plan/v2.schema.json#/$defs/key"
|
|
317
|
+
},
|
|
318
|
+
"name": {
|
|
319
|
+
"$ref": "https://github.com/ie-huss-martinez/audio-sdk/blob/main/formats/hm-audio-plan/v2.schema.json#/$defs/trackName"
|
|
320
|
+
},
|
|
321
|
+
"gainDb": {
|
|
322
|
+
"$ref": "https://github.com/ie-huss-martinez/audio-sdk/blob/main/formats/hm-audio-plan/v2.schema.json#/$defs/gainDb"
|
|
323
|
+
},
|
|
324
|
+
"muted": {
|
|
325
|
+
"type": "boolean"
|
|
326
|
+
},
|
|
327
|
+
"soloed": {
|
|
328
|
+
"type": "boolean"
|
|
329
|
+
}
|
|
330
|
+
},
|
|
331
|
+
"minProperties": 3
|
|
332
|
+
},
|
|
333
|
+
{
|
|
334
|
+
"description": "Sets the master gain.",
|
|
335
|
+
"type": "object",
|
|
336
|
+
"required": ["type", "gainDb"],
|
|
337
|
+
"additionalProperties": false,
|
|
338
|
+
"properties": {
|
|
339
|
+
"type": {
|
|
340
|
+
"const": "audio.setMasterGain"
|
|
341
|
+
},
|
|
342
|
+
"gainDb": {
|
|
343
|
+
"$ref": "https://github.com/ie-huss-martinez/audio-sdk/blob/main/formats/hm-audio-plan/v2.schema.json#/$defs/gainDb"
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
},
|
|
347
|
+
{
|
|
348
|
+
"description": "Sets the plan's channel count.",
|
|
349
|
+
"type": "object",
|
|
350
|
+
"required": ["type", "channels"],
|
|
351
|
+
"additionalProperties": false,
|
|
352
|
+
"properties": {
|
|
353
|
+
"type": {
|
|
354
|
+
"const": "audio.setChannels"
|
|
355
|
+
},
|
|
356
|
+
"channels": {
|
|
357
|
+
"type": "integer",
|
|
358
|
+
"minimum": 1,
|
|
359
|
+
"maximum": 9007199254740991
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
},
|
|
363
|
+
{
|
|
364
|
+
"description": "Sets one metadata field.",
|
|
365
|
+
"type": "object",
|
|
366
|
+
"required": ["type", "field", "value"],
|
|
367
|
+
"additionalProperties": false,
|
|
368
|
+
"properties": {
|
|
369
|
+
"type": {
|
|
370
|
+
"const": "audio.setMetadata"
|
|
371
|
+
},
|
|
372
|
+
"field": {
|
|
373
|
+
"enum": ["title", "artist", "album", "year", "comment"]
|
|
374
|
+
},
|
|
375
|
+
"value": {
|
|
376
|
+
"$ref": "https://github.com/ie-huss-martinez/audio-sdk/blob/main/formats/hm-audio-plan/v2.schema.json#/$defs/metadataText"
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
]
|
|
381
|
+
}
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://github.com/ie-huss-martinez/audio-sdk/blob/main/formats/hm-audio-plan/v2.schema.json",
|
|
4
|
+
"title": "hm-audio-plan, version 2",
|
|
5
|
+
"description": "An audio-sdk multitrack plan: tracks of clips positioned in time over immutable sources, mixed on playback and export, with the metadata export writes (docs/formats/hm-audio-plan.md, docs/adr/0006, sdk-core ADR 0045). Every position and length is a whole number of frames at sampleRate. Beyond this schema, readers check that every clip lies within a source the document lists, that its fades fit it, that each track's clips are in time order and don't overlap, and that keys are unique across tracks and clips.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": [
|
|
8
|
+
"format",
|
|
9
|
+
"version",
|
|
10
|
+
"sampleRate",
|
|
11
|
+
"channels",
|
|
12
|
+
"gainDb",
|
|
13
|
+
"sources",
|
|
14
|
+
"tracks",
|
|
15
|
+
"metadata"
|
|
16
|
+
],
|
|
17
|
+
"additionalProperties": false,
|
|
18
|
+
"properties": {
|
|
19
|
+
"format": {
|
|
20
|
+
"const": "hm-audio-plan"
|
|
21
|
+
},
|
|
22
|
+
"version": {
|
|
23
|
+
"const": 2
|
|
24
|
+
},
|
|
25
|
+
"sampleRate": {
|
|
26
|
+
"description": "Frames per second.",
|
|
27
|
+
"type": "integer",
|
|
28
|
+
"minimum": 1,
|
|
29
|
+
"maximum": 9007199254740991
|
|
30
|
+
},
|
|
31
|
+
"channels": {
|
|
32
|
+
"type": "integer",
|
|
33
|
+
"minimum": 1,
|
|
34
|
+
"maximum": 9007199254740991
|
|
35
|
+
},
|
|
36
|
+
"gainDb": {
|
|
37
|
+
"description": "The master gain, applied to the mix.",
|
|
38
|
+
"$ref": "#/$defs/gainDb"
|
|
39
|
+
},
|
|
40
|
+
"sources": {
|
|
41
|
+
"description": "The sources the clips play, by the ids the clips use.",
|
|
42
|
+
"type": "object",
|
|
43
|
+
"propertyNames": {
|
|
44
|
+
"minLength": 1
|
|
45
|
+
},
|
|
46
|
+
"additionalProperties": {
|
|
47
|
+
"$ref": "#/$defs/source"
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"tracks": {
|
|
51
|
+
"description": "The tracks, from top to bottom. A plan has at least one.",
|
|
52
|
+
"type": "array",
|
|
53
|
+
"minItems": 1,
|
|
54
|
+
"items": {
|
|
55
|
+
"$ref": "#/$defs/track"
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
"metadata": {
|
|
59
|
+
"$ref": "#/$defs/metadata"
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
"$defs": {
|
|
63
|
+
"frames": {
|
|
64
|
+
"description": "A whole number of frames.",
|
|
65
|
+
"type": "integer",
|
|
66
|
+
"minimum": 0,
|
|
67
|
+
"maximum": 9007199254740991
|
|
68
|
+
},
|
|
69
|
+
"key": {
|
|
70
|
+
"description": "A track's or a clip's key, stable across edits. Tracks and clips share one namespace.",
|
|
71
|
+
"type": "string",
|
|
72
|
+
"minLength": 1
|
|
73
|
+
},
|
|
74
|
+
"gainDb": {
|
|
75
|
+
"description": "A gain in decibels. Copied, never computed, so it compares exactly.",
|
|
76
|
+
"type": "number",
|
|
77
|
+
"minimum": -120,
|
|
78
|
+
"maximum": 120
|
|
79
|
+
},
|
|
80
|
+
"fade": {
|
|
81
|
+
"type": "object",
|
|
82
|
+
"required": ["frames", "curve"],
|
|
83
|
+
"additionalProperties": false,
|
|
84
|
+
"properties": {
|
|
85
|
+
"frames": {
|
|
86
|
+
"$ref": "#/$defs/frames"
|
|
87
|
+
},
|
|
88
|
+
"curve": {
|
|
89
|
+
"enum": ["linear", "equalPower"]
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
"clip": {
|
|
94
|
+
"description": "A range of a source, from start inclusive to end exclusive, placed on the timeline frame at, with its gain and fades.",
|
|
95
|
+
"type": "object",
|
|
96
|
+
"required": ["key", "at", "source", "start", "end", "gainDb", "fadeIn", "fadeOut"],
|
|
97
|
+
"additionalProperties": false,
|
|
98
|
+
"properties": {
|
|
99
|
+
"key": {
|
|
100
|
+
"$ref": "#/$defs/key"
|
|
101
|
+
},
|
|
102
|
+
"at": {
|
|
103
|
+
"description": "The timeline frame the clip starts on.",
|
|
104
|
+
"$ref": "#/$defs/frames"
|
|
105
|
+
},
|
|
106
|
+
"source": {
|
|
107
|
+
"type": "string",
|
|
108
|
+
"minLength": 1
|
|
109
|
+
},
|
|
110
|
+
"start": {
|
|
111
|
+
"$ref": "#/$defs/frames"
|
|
112
|
+
},
|
|
113
|
+
"end": {
|
|
114
|
+
"$ref": "#/$defs/frames"
|
|
115
|
+
},
|
|
116
|
+
"gainDb": {
|
|
117
|
+
"$ref": "#/$defs/gainDb"
|
|
118
|
+
},
|
|
119
|
+
"fadeIn": {
|
|
120
|
+
"$ref": "#/$defs/fade"
|
|
121
|
+
},
|
|
122
|
+
"fadeOut": {
|
|
123
|
+
"$ref": "#/$defs/fade"
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
"trackName": {
|
|
128
|
+
"description": "A track's name, in Unicode code points. Empty means none. It's untrusted text.",
|
|
129
|
+
"type": "string",
|
|
130
|
+
"maxLength": 100
|
|
131
|
+
},
|
|
132
|
+
"track": {
|
|
133
|
+
"description": "Clips in time order that never overlap, with the track's name, gain, mute and solo.",
|
|
134
|
+
"type": "object",
|
|
135
|
+
"required": ["key", "name", "gainDb", "muted", "soloed", "clips"],
|
|
136
|
+
"additionalProperties": false,
|
|
137
|
+
"properties": {
|
|
138
|
+
"key": {
|
|
139
|
+
"$ref": "#/$defs/key"
|
|
140
|
+
},
|
|
141
|
+
"name": {
|
|
142
|
+
"$ref": "#/$defs/trackName"
|
|
143
|
+
},
|
|
144
|
+
"gainDb": {
|
|
145
|
+
"$ref": "#/$defs/gainDb"
|
|
146
|
+
},
|
|
147
|
+
"muted": {
|
|
148
|
+
"type": "boolean"
|
|
149
|
+
},
|
|
150
|
+
"soloed": {
|
|
151
|
+
"type": "boolean"
|
|
152
|
+
},
|
|
153
|
+
"clips": {
|
|
154
|
+
"type": "array",
|
|
155
|
+
"items": {
|
|
156
|
+
"$ref": "#/$defs/clip"
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
"source": {
|
|
162
|
+
"type": "object",
|
|
163
|
+
"required": ["frames"],
|
|
164
|
+
"additionalProperties": false,
|
|
165
|
+
"properties": {
|
|
166
|
+
"frames": {
|
|
167
|
+
"description": "The source's length in frames.",
|
|
168
|
+
"type": "integer",
|
|
169
|
+
"minimum": 1,
|
|
170
|
+
"maximum": 9007199254740991
|
|
171
|
+
},
|
|
172
|
+
"asset": {
|
|
173
|
+
"$ref": "#/$defs/asset"
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
"asset": {
|
|
178
|
+
"description": "A content-addressed reference to the source's bytes (sdk-core ADR 0045, section 2).",
|
|
179
|
+
"type": "object",
|
|
180
|
+
"required": ["asset", "mediaType", "size"],
|
|
181
|
+
"additionalProperties": false,
|
|
182
|
+
"properties": {
|
|
183
|
+
"asset": {
|
|
184
|
+
"type": "string",
|
|
185
|
+
"pattern": "^sha256:[0-9a-f]{64}$"
|
|
186
|
+
},
|
|
187
|
+
"mediaType": {
|
|
188
|
+
"type": "string",
|
|
189
|
+
"maxLength": 255,
|
|
190
|
+
"pattern": "^[a-z0-9][a-z0-9!#$&^_.+-]*/[a-z0-9][a-z0-9!#$&^_.+-]*$"
|
|
191
|
+
},
|
|
192
|
+
"size": {
|
|
193
|
+
"type": "integer",
|
|
194
|
+
"minimum": 0,
|
|
195
|
+
"maximum": 9007199254740991
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
"metadataText": {
|
|
200
|
+
"type": "string",
|
|
201
|
+
"maxLength": 1000
|
|
202
|
+
},
|
|
203
|
+
"metadata": {
|
|
204
|
+
"type": "object",
|
|
205
|
+
"required": ["title", "artist", "album", "year", "comment"],
|
|
206
|
+
"additionalProperties": false,
|
|
207
|
+
"properties": {
|
|
208
|
+
"title": {
|
|
209
|
+
"$ref": "#/$defs/metadataText"
|
|
210
|
+
},
|
|
211
|
+
"artist": {
|
|
212
|
+
"$ref": "#/$defs/metadataText"
|
|
213
|
+
},
|
|
214
|
+
"album": {
|
|
215
|
+
"$ref": "#/$defs/metadataText"
|
|
216
|
+
},
|
|
217
|
+
"year": {
|
|
218
|
+
"$ref": "#/$defs/metadataText"
|
|
219
|
+
},
|
|
220
|
+
"comment": {
|
|
221
|
+
"$ref": "#/$defs/metadataText"
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hussmartinez/audio-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Client-side audio SDK: a headless core, a React editor and a custom element. Audio never leaves the device.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -48,7 +48,8 @@
|
|
|
48
48
|
"node": ">=24"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@hussmartinez/sdk-core": "^0.4.
|
|
51
|
+
"@hussmartinez/sdk-core": "^0.4.4",
|
|
52
|
+
"@hussmartinez/ui": "^0.14.0"
|
|
52
53
|
},
|
|
53
54
|
"peerDependencies": {
|
|
54
55
|
"react": ">=18.3",
|
|
@@ -76,8 +77,9 @@
|
|
|
76
77
|
"@types/react": "^19.3.0",
|
|
77
78
|
"@types/react-dom": "^19.3.0",
|
|
78
79
|
"@vitest/browser-playwright": "5.1.0",
|
|
79
|
-
"dependency-cruiser": "^18.7.2",
|
|
80
80
|
"ajv": "^8.20.0",
|
|
81
|
+
"axe-core": "^4.11.0",
|
|
82
|
+
"dependency-cruiser": "^18.7.2",
|
|
81
83
|
"fast-check": "^4.10.2",
|
|
82
84
|
"husky": "^9.1.7",
|
|
83
85
|
"lint-staged": "^17.6.0",
|
|
@@ -99,19 +101,21 @@
|
|
|
99
101
|
"lint:deps": "hm-lint-deps src",
|
|
100
102
|
"check:single-copy": "hm-check-single-copy",
|
|
101
103
|
"check:playwright-image": "hm-check-playwright-image",
|
|
102
|
-
"conformance:update": "vitest run --project unit test/conformance --update",
|
|
104
|
+
"conformance:update": "vitest run --project unit test/conformance test/v1 --update",
|
|
103
105
|
"typecheck": "tsc -p tsconfig.json && tsc -p tsconfig.test.json",
|
|
104
106
|
"build": "vite build && pnpm check:api",
|
|
105
107
|
"test": "vitest run --project unit",
|
|
106
108
|
"test:browser": "hm-in-image vitest run --project browser",
|
|
107
109
|
"test:browser:all": "hm-in-image vitest run --project browser --mode all-browsers",
|
|
108
|
-
"build:examples": "pnpm --filter
|
|
110
|
+
"build:examples": "pnpm --filter \"./examples/*\" build",
|
|
109
111
|
"test:e2e": "pnpm --filter @hussmartinez/audio-sdk-e2e test:e2e",
|
|
112
|
+
"test:visual": "hm-test-visual",
|
|
113
|
+
"test:visual:update": "hm-test-visual --update",
|
|
110
114
|
"check:size": "size-limit",
|
|
111
115
|
"check:api": "tsc -p tsconfig.build.json && api-extractor run && api-extractor run -c api-extractor.react.json && api-extractor run -c api-extractor.element.json",
|
|
112
116
|
"check:package": "publint run --pack pnpm --strict && attw --pack . --profile esm-only --exclude-entrypoints ./styles.css",
|
|
113
117
|
"api:update": "tsc -p tsconfig.build.json && api-extractor run --local && api-extractor run -c api-extractor.react.json --local && api-extractor run -c api-extractor.element.json --local",
|
|
114
|
-
"verify": "pnpm lint && pnpm lint:css && pnpm typecheck && pnpm lint:deps && pnpm check:single-copy && pnpm check:playwright-image && pnpm build && pnpm test && pnpm test:browser && pnpm build:examples && pnpm test:e2e && pnpm check:size && pnpm check:api && pnpm check:package",
|
|
118
|
+
"verify": "pnpm lint && pnpm lint:css && pnpm typecheck && pnpm lint:deps && pnpm check:single-copy && pnpm check:playwright-image && pnpm build && pnpm test && pnpm test:browser && pnpm build:examples && pnpm test:e2e && pnpm test:visual && pnpm check:size && pnpm check:api && pnpm check:package",
|
|
115
119
|
"verify:fast": "pnpm typecheck && pnpm test && pnpm lint:deps && pnpm check:single-copy && pnpm check:playwright-image && pnpm check:api"
|
|
116
120
|
}
|
|
117
121
|
}
|