@scalable-vector-audio/sva-wasm 0.7.1 → 0.7.2
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/package.json +1 -1
- package/sva_wasm.d.ts +15 -1
- package/sva_wasm.js +55 -27
- package/sva_wasm_bg.wasm +0 -0
package/package.json
CHANGED
package/sva_wasm.d.ts
CHANGED
|
@@ -35,6 +35,12 @@ export class Composition {
|
|
|
35
35
|
* `live`. Opening and every edit look the store on disk up, so each is awaited.
|
|
36
36
|
*/
|
|
37
37
|
stream(target: string, block: number, options: any): Promise<Stream>;
|
|
38
|
+
/**
|
|
39
|
+
* `target` staged as `render` would, until `persist`; `{ stats, representations }`,
|
|
40
|
+
* the latter `representations()` for `readings`, null unasked. Options: `rate`, `bits`,
|
|
41
|
+
* `flop_budget`, `readings`.
|
|
42
|
+
*/
|
|
43
|
+
warm(target: string, options: any): Promise<any>;
|
|
38
44
|
readonly cache_bytes: number;
|
|
39
45
|
readonly cache_entries: number;
|
|
40
46
|
readonly cache_evictions: number;
|
|
@@ -82,6 +88,12 @@ export class Stream {
|
|
|
82
88
|
* `expr` in place of the target.
|
|
83
89
|
*/
|
|
84
90
|
edit(expr: string): Promise<void>;
|
|
91
|
+
/**
|
|
92
|
+
* Reads the stored samples the next second of blocks plays, and the stream plays on
|
|
93
|
+
* meanwhile. A block reading stored samples not yet read computes them, or, live, starts
|
|
94
|
+
* the note silent where its live remainder is not ready.
|
|
95
|
+
*/
|
|
96
|
+
fetch(): Promise<void>;
|
|
85
97
|
/**
|
|
86
98
|
* Writes the next block into `out`, component `c` from `c * block`, and returns the
|
|
87
99
|
* samples each component took: `block`, fewer where silence ends inside it, `0` after.
|
|
@@ -137,6 +149,7 @@ export interface InitOutput {
|
|
|
137
149
|
readonly composition_set_cache_policy: (a: number, b: number, c: number) => [number, number];
|
|
138
150
|
readonly composition_set_prune_policy: (a: number, b: number, c: number) => [number, number];
|
|
139
151
|
readonly composition_stream: (a: number, b: number, c: number, d: number, e: any) => any;
|
|
152
|
+
readonly composition_warm: (a: number, b: number, c: number, d: any) => any;
|
|
140
153
|
readonly outline: (a: number, b: number) => [number, number, number];
|
|
141
154
|
readonly rendering_channels: (a: number) => number;
|
|
142
155
|
readonly rendering_duration_secs: (a: number) => number;
|
|
@@ -152,6 +165,7 @@ export interface InitOutput {
|
|
|
152
165
|
readonly stream_channels: (a: number) => [number, number, number];
|
|
153
166
|
readonly stream_edit: (a: number, b: number, c: number) => any;
|
|
154
167
|
readonly stream_end: (a: number) => [number, number, number, number];
|
|
168
|
+
readonly stream_fetch: (a: number) => any;
|
|
155
169
|
readonly stream_held_bytes: (a: number) => [number, number, number];
|
|
156
170
|
readonly stream_next: (a: number, b: number, c: number, d: any) => [number, number, number];
|
|
157
171
|
readonly stream_position: (a: number) => [number, number, number];
|
|
@@ -162,7 +176,7 @@ export interface InitOutput {
|
|
|
162
176
|
readonly stream_work: (a: number) => [number, number, number];
|
|
163
177
|
readonly wasm_bindgen__convert__closures_____invoke__h76bd71bceeca2b95: (a: number, b: number, c: any, d: any) => void;
|
|
164
178
|
readonly wasm_bindgen__convert__closures_____invoke__hd55bb211d6a08150: (a: number, b: number, c: any) => [number, number];
|
|
165
|
-
readonly
|
|
179
|
+
readonly wasm_bindgen__convert__closures_____invoke__h1fa9803413ae3c8c: (a: number, b: number) => any;
|
|
166
180
|
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
167
181
|
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
168
182
|
readonly __wbindgen_exn_store: (a: number) => void;
|
package/sva_wasm.js
CHANGED
|
@@ -194,6 +194,20 @@ export class Composition {
|
|
|
194
194
|
const ret = wasm.composition_stream(this.__wbg_ptr, ptr0, len0, block, options);
|
|
195
195
|
return ret;
|
|
196
196
|
}
|
|
197
|
+
/**
|
|
198
|
+
* `target` staged as `render` would, until `persist`; `{ stats, representations }`,
|
|
199
|
+
* the latter `representations()` for `readings`, null unasked. Options: `rate`, `bits`,
|
|
200
|
+
* `flop_budget`, `readings`.
|
|
201
|
+
* @param {string} target
|
|
202
|
+
* @param {any} options
|
|
203
|
+
* @returns {Promise<any>}
|
|
204
|
+
*/
|
|
205
|
+
warm(target, options) {
|
|
206
|
+
const ptr0 = passStringToWasm0(target, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
207
|
+
const len0 = WASM_VECTOR_LEN;
|
|
208
|
+
const ret = wasm.composition_warm(this.__wbg_ptr, ptr0, len0, options);
|
|
209
|
+
return ret;
|
|
210
|
+
}
|
|
197
211
|
}
|
|
198
212
|
if (Symbol.dispose) Composition.prototype[Symbol.dispose] = Composition.prototype.free;
|
|
199
213
|
|
|
@@ -380,6 +394,16 @@ export class Stream {
|
|
|
380
394
|
}
|
|
381
395
|
return ret[0] === 0 ? undefined : ret[1];
|
|
382
396
|
}
|
|
397
|
+
/**
|
|
398
|
+
* Reads the stored samples the next second of blocks plays, and the stream plays on
|
|
399
|
+
* meanwhile. A block reading stored samples not yet read computes them, or, live, starts
|
|
400
|
+
* the note silent where its live remainder is not ready.
|
|
401
|
+
* @returns {Promise<void>}
|
|
402
|
+
*/
|
|
403
|
+
fetch() {
|
|
404
|
+
const ret = wasm.stream_fetch(this.__wbg_ptr);
|
|
405
|
+
return ret;
|
|
406
|
+
}
|
|
383
407
|
/**
|
|
384
408
|
* @returns {number}
|
|
385
409
|
*/
|
|
@@ -548,7 +572,7 @@ function __wbg_get_imports() {
|
|
|
548
572
|
__wbg__wbg_cb_unref_997e73d32238e655: function(arg0) {
|
|
549
573
|
arg0._wbg_cb_unref();
|
|
550
574
|
},
|
|
551
|
-
|
|
575
|
+
__wbg_arrayBuffer_dbd53e75db738fae: function(arg0) {
|
|
552
576
|
const ret = arg0.arrayBuffer();
|
|
553
577
|
return ret;
|
|
554
578
|
},
|
|
@@ -560,7 +584,7 @@ function __wbg_get_imports() {
|
|
|
560
584
|
const ret = arg0.call(arg1, arg2);
|
|
561
585
|
return ret;
|
|
562
586
|
}, arguments); },
|
|
563
|
-
|
|
587
|
+
__wbg_close_5aa4fdce5d27170d: function(arg0) {
|
|
564
588
|
const ret = arg0.close();
|
|
565
589
|
return ret;
|
|
566
590
|
},
|
|
@@ -568,7 +592,7 @@ function __wbg_get_imports() {
|
|
|
568
592
|
const ret = Composition.__wrap(arg0);
|
|
569
593
|
return ret;
|
|
570
594
|
},
|
|
571
|
-
|
|
595
|
+
__wbg_createWritable_813278137702c672: function(arg0) {
|
|
572
596
|
const ret = arg0.createWritable();
|
|
573
597
|
return ret;
|
|
574
598
|
},
|
|
@@ -580,15 +604,15 @@ function __wbg_get_imports() {
|
|
|
580
604
|
const ret = Array.from(arg0);
|
|
581
605
|
return ret;
|
|
582
606
|
},
|
|
583
|
-
|
|
607
|
+
__wbg_getDirectoryHandle_abeab464f3c65f25: function(arg0, arg1, arg2, arg3) {
|
|
584
608
|
const ret = arg0.getDirectoryHandle(getStringFromWasm0(arg1, arg2), arg3);
|
|
585
609
|
return ret;
|
|
586
610
|
},
|
|
587
|
-
|
|
611
|
+
__wbg_getFileHandle_9b7788a10f51304f: function(arg0, arg1, arg2, arg3) {
|
|
588
612
|
const ret = arg0.getFileHandle(getStringFromWasm0(arg1, arg2), arg3);
|
|
589
613
|
return ret;
|
|
590
614
|
},
|
|
591
|
-
|
|
615
|
+
__wbg_getFile_880d5e36fcbe5891: function(arg0) {
|
|
592
616
|
const ret = arg0.getFile();
|
|
593
617
|
return ret;
|
|
594
618
|
},
|
|
@@ -618,7 +642,7 @@ function __wbg_get_imports() {
|
|
|
618
642
|
const ret = Array.isArray(arg0);
|
|
619
643
|
return ret;
|
|
620
644
|
},
|
|
621
|
-
|
|
645
|
+
__wbg_keys_bb1628b5f767331c: function(arg0) {
|
|
622
646
|
const ret = arg0.keys();
|
|
623
647
|
return ret;
|
|
624
648
|
},
|
|
@@ -630,7 +654,7 @@ function __wbg_get_imports() {
|
|
|
630
654
|
const ret = arg0.length;
|
|
631
655
|
return ret;
|
|
632
656
|
},
|
|
633
|
-
|
|
657
|
+
__wbg_move_7b940aab376195ce: function(arg0, arg1, arg2, arg3) {
|
|
634
658
|
const ret = arg0.move(arg1, getStringFromWasm0(arg2, arg3));
|
|
635
659
|
return ret;
|
|
636
660
|
},
|
|
@@ -638,6 +662,10 @@ function __wbg_get_imports() {
|
|
|
638
662
|
const ret = new Uint8Array(arg0);
|
|
639
663
|
return ret;
|
|
640
664
|
},
|
|
665
|
+
__wbg_new_536d8ff546834a3d: function(arg0, arg1) {
|
|
666
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
667
|
+
return ret;
|
|
668
|
+
},
|
|
641
669
|
__wbg_new_8f72ed7c652bf5a2: function(arg0, arg1) {
|
|
642
670
|
try {
|
|
643
671
|
var state0 = {a: arg0, b: arg1};
|
|
@@ -660,10 +688,6 @@ function __wbg_get_imports() {
|
|
|
660
688
|
const ret = new Object();
|
|
661
689
|
return ret;
|
|
662
690
|
},
|
|
663
|
-
__wbg_new_c76aa635a13cdc59: function(arg0, arg1) {
|
|
664
|
-
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
665
|
-
return ret;
|
|
666
|
-
},
|
|
667
691
|
__wbg_new_from_slice_4ee02165f9de919e: function(arg0, arg1) {
|
|
668
692
|
const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
|
|
669
693
|
return ret;
|
|
@@ -686,18 +710,18 @@ function __wbg_get_imports() {
|
|
|
686
710
|
state0.a = 0;
|
|
687
711
|
}
|
|
688
712
|
},
|
|
689
|
-
|
|
713
|
+
__wbg_next_f4b7785cddb77159: function(arg0) {
|
|
690
714
|
const ret = arg0.next();
|
|
691
715
|
return ret;
|
|
692
716
|
},
|
|
693
|
-
|
|
717
|
+
__wbg_parse_77f086087c089de1: function() { return handleError(function (arg0, arg1) {
|
|
694
718
|
const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
|
|
695
719
|
return ret;
|
|
696
720
|
}, arguments); },
|
|
697
721
|
__wbg_prototypesetcall_ae9f5e7459250748: function(arg0, arg1, arg2) {
|
|
698
722
|
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
|
|
699
723
|
},
|
|
700
|
-
|
|
724
|
+
__wbg_query_3333eea8f8b016ee: function(arg0) {
|
|
701
725
|
const ret = arg0.query();
|
|
702
726
|
return ret;
|
|
703
727
|
},
|
|
@@ -712,11 +736,11 @@ function __wbg_get_imports() {
|
|
|
712
736
|
const ret = Math.random();
|
|
713
737
|
return ret;
|
|
714
738
|
},
|
|
715
|
-
|
|
739
|
+
__wbg_removeEntry_2a712749f1dc4003: function(arg0, arg1, arg2, arg3) {
|
|
716
740
|
const ret = arg0.removeEntry(getStringFromWasm0(arg1, arg2), arg3);
|
|
717
741
|
return ret;
|
|
718
742
|
},
|
|
719
|
-
|
|
743
|
+
__wbg_removeEntry_7ea9843e2b12fd01: function(arg0, arg1, arg2) {
|
|
720
744
|
const ret = arg0.removeEntry(getStringFromWasm0(arg1, arg2));
|
|
721
745
|
return ret;
|
|
722
746
|
},
|
|
@@ -724,7 +748,7 @@ function __wbg_get_imports() {
|
|
|
724
748
|
const ret = Rendering.__wrap(arg0);
|
|
725
749
|
return ret;
|
|
726
750
|
},
|
|
727
|
-
|
|
751
|
+
__wbg_request_8ca00ebd07e4a6e8: function(arg0, arg1, arg2, arg3) {
|
|
728
752
|
const ret = arg0.request(getStringFromWasm0(arg1, arg2), arg3);
|
|
729
753
|
return ret;
|
|
730
754
|
},
|
|
@@ -736,16 +760,20 @@ function __wbg_get_imports() {
|
|
|
736
760
|
const ret = Reflect.set(arg0, arg1, arg2);
|
|
737
761
|
return ret;
|
|
738
762
|
}, arguments); },
|
|
739
|
-
|
|
763
|
+
__wbg_set_name_676ed49f8d7df324: function(arg0, arg1, arg2) {
|
|
740
764
|
arg0.name = getStringFromWasm0(arg1, arg2);
|
|
741
765
|
},
|
|
742
|
-
|
|
766
|
+
__wbg_set_refusal_e944caff565482ce: function(arg0, arg1) {
|
|
743
767
|
arg0.refusal = arg1;
|
|
744
768
|
},
|
|
745
|
-
|
|
769
|
+
__wbg_size_98080bde78dcec98: function(arg0) {
|
|
746
770
|
const ret = arg0.size;
|
|
747
771
|
return ret;
|
|
748
772
|
},
|
|
773
|
+
__wbg_slice_d3997ea27cf70829: function(arg0, arg1, arg2) {
|
|
774
|
+
const ret = arg0.slice(arg1, arg2);
|
|
775
|
+
return ret;
|
|
776
|
+
},
|
|
749
777
|
__wbg_static_accessor_GLOBAL_8eb4cd83130a11a0: function() {
|
|
750
778
|
const ret = typeof global === 'undefined' ? null : global;
|
|
751
779
|
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
@@ -774,18 +802,18 @@ function __wbg_get_imports() {
|
|
|
774
802
|
const ret = arg0.then(arg1);
|
|
775
803
|
return ret;
|
|
776
804
|
},
|
|
777
|
-
|
|
805
|
+
__wbg_write_84516362671d6058: function(arg0, arg1) {
|
|
778
806
|
const ret = arg0.write(arg1);
|
|
779
807
|
return ret;
|
|
780
808
|
},
|
|
781
809
|
__wbindgen_generic_0000000000000001: function(arg0, arg1) {
|
|
782
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx:
|
|
810
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 540, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
783
811
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__hd55bb211d6a08150);
|
|
784
812
|
return ret;
|
|
785
813
|
},
|
|
786
814
|
__wbindgen_generic_0000000000000002: function(arg0, arg1) {
|
|
787
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx:
|
|
788
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
815
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 90, ret: NamedExternref("Promise<any>"), inner_ret: Some(NamedExternref("Promise<any>")) }, mutable: true }) -> Externref`.
|
|
816
|
+
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h1fa9803413ae3c8c);
|
|
789
817
|
return ret;
|
|
790
818
|
},
|
|
791
819
|
__wbindgen_generic_0000000000000003: function(arg0) {
|
|
@@ -814,8 +842,8 @@ function __wbg_get_imports() {
|
|
|
814
842
|
};
|
|
815
843
|
}
|
|
816
844
|
|
|
817
|
-
function
|
|
818
|
-
const ret = wasm.
|
|
845
|
+
function wasm_bindgen__convert__closures_____invoke__h1fa9803413ae3c8c(arg0, arg1) {
|
|
846
|
+
const ret = wasm.wasm_bindgen__convert__closures_____invoke__h1fa9803413ae3c8c(arg0, arg1);
|
|
819
847
|
return ret;
|
|
820
848
|
}
|
|
821
849
|
|
package/sva_wasm_bg.wasm
CHANGED
|
Binary file
|