opus-codec 0.0.85 → 1.0.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/es/actions/Client.d.ts +1 -1
- package/es/actions/Client.d.ts.map +1 -1
- package/es/actions/Client.js +6 -22
- package/es/actions/Client.js.map +1 -1
- package/es/actions/actions.d.ts +2 -2
- package/es/actions/actions.d.ts.map +1 -1
- package/es/actions/actions.js +1 -1
- package/es/actions/actions.js.map +1 -1
- package/es/actions/index.d.ts +1 -1
- package/es/actions/index.d.ts.map +1 -1
- package/es/actions/index.js +1 -1
- package/es/actions/index.js.map +1 -1
- package/es/opus/Decoder.d.ts +3 -2
- package/es/opus/Decoder.d.ts.map +1 -1
- package/es/opus/Decoder.js +8 -5
- package/es/opus/Decoder.js.map +1 -1
- package/es/opus/Encoder.d.ts +4 -3
- package/es/opus/Encoder.d.ts.map +1 -1
- package/es/opus/Encoder.js +9 -6
- package/es/opus/Encoder.js.map +1 -1
- package/es/opus/OpusGettersAndSetters.d.ts +1 -1
- package/es/opus/OpusGettersAndSetters.d.ts.map +1 -1
- package/es/opus/OpusGettersAndSetters.js +119 -41
- package/es/opus/OpusGettersAndSetters.js.map +1 -1
- package/es/opus/RingBuffer.d.ts +2 -7
- package/es/opus/RingBuffer.d.ts.map +1 -1
- package/es/opus/RingBuffer.js +1 -58
- package/es/opus/RingBuffer.js.map +1 -1
- package/es/opus/constants.d.ts +0 -11
- package/es/opus/constants.d.ts.map +1 -1
- package/es/opus/constants.js +30 -41
- package/es/opus/constants.js.map +1 -1
- package/es/opus/index.d.ts +4 -4
- package/es/opus/index.d.ts.map +1 -1
- package/es/opus/index.js +4 -4
- package/es/opus/index.js.map +1 -1
- package/es/runtime/Buffer.d.ts +3 -3
- package/es/runtime/Buffer.d.ts.map +1 -1
- package/es/runtime/Buffer.js.map +1 -1
- package/es/runtime/Integer.d.ts +3 -2
- package/es/runtime/Integer.d.ts.map +1 -1
- package/es/runtime/Integer.js +6 -3
- package/es/runtime/Integer.js.map +1 -1
- package/es/runtime/ResourcesHolder.d.ts +1 -0
- package/es/runtime/ResourcesHolder.d.ts.map +1 -1
- package/es/runtime/ResourcesHolder.js +9 -2
- package/es/runtime/ResourcesHolder.js.map +1 -1
- package/es/runtime/Runtime.d.ts +4 -17
- package/es/runtime/Runtime.d.ts.map +1 -1
- package/es/runtime/Runtime.js +5 -9
- package/es/runtime/Runtime.js.map +1 -1
- package/es/runtime/index.d.ts +4 -5
- package/es/runtime/index.d.ts.map +1 -1
- package/es/runtime/index.js +4 -5
- package/es/runtime/index.js.map +1 -1
- package/native/index.d.ts +14 -49
- package/native/index.js +45 -15
- package/native/index.wasm +0 -0
- package/opus/Decoder.d.ts +3 -2
- package/opus/Decoder.d.ts.map +1 -1
- package/opus/Decoder.js +14 -14
- package/opus/Decoder.js.map +1 -1
- package/opus/Encoder.d.ts +4 -3
- package/opus/Encoder.d.ts.map +1 -1
- package/opus/Encoder.js +14 -14
- package/opus/Encoder.js.map +1 -1
- package/opus/OpusGettersAndSetters.d.ts +1 -1
- package/opus/OpusGettersAndSetters.d.ts.map +1 -1
- package/opus/OpusGettersAndSetters.js +160 -89
- package/opus/OpusGettersAndSetters.js.map +1 -1
- package/opus/RingBuffer.d.ts +2 -7
- package/opus/RingBuffer.d.ts.map +1 -1
- package/opus/RingBuffer.js +1 -61
- package/opus/RingBuffer.js.map +1 -1
- package/opus/constants.d.ts +0 -11
- package/opus/constants.d.ts.map +1 -1
- package/opus/constants.js +31 -44
- package/opus/constants.js.map +1 -1
- package/opus/index.d.ts +4 -4
- package/opus/index.d.ts.map +1 -1
- package/opus/index.js +4 -14
- package/opus/index.js.map +1 -1
- package/package.json +19 -22
- package/runtime/Buffer.d.ts +3 -3
- package/runtime/Buffer.d.ts.map +1 -1
- package/runtime/Buffer.js +1 -4
- package/runtime/Buffer.js.map +1 -1
- package/runtime/Integer.d.ts +3 -2
- package/runtime/Integer.d.ts.map +1 -1
- package/runtime/Integer.js +7 -7
- package/runtime/Integer.js.map +1 -1
- package/runtime/ResourcesHolder.d.ts +1 -0
- package/runtime/ResourcesHolder.d.ts.map +1 -1
- package/runtime/ResourcesHolder.js +10 -6
- package/runtime/ResourcesHolder.js.map +1 -1
- package/runtime/Runtime.d.ts +4 -17
- package/runtime/Runtime.d.ts.map +1 -1
- package/runtime/Runtime.js +6 -13
- package/runtime/Runtime.js.map +1 -1
- package/runtime/index.d.ts +4 -5
- package/runtime/index.d.ts.map +1 -1
- package/runtime/index.js +4 -16
- package/runtime/index.js.map +1 -1
- package/es/runtime/RuntimeString.d.ts +0 -9
- package/es/runtime/RuntimeString.d.ts.map +0 -1
- package/es/runtime/RuntimeString.js +0 -42
- package/es/runtime/RuntimeString.js.map +0 -1
- package/native/index.wasm.map +0 -1
- package/native/libopusenc-cmake/src/COPYING +0 -29
- package/native/libopusenc-cmake/src/README.md +0 -11
- package/native/opus/COPYING +0 -44
- package/native/opus/README +0 -161
- package/native/opus/README.draft +0 -54
- package/native/speexdsp-cmake/src/COPYING +0 -35
- package/native/speexdsp-cmake/src/README +0 -3
- package/native/speexdsp-cmake/src/README.Trimedia +0 -103
- package/native/speexdsp-cmake/src/README.blackfin +0 -22
- package/native/speexdsp-cmake/src/README.win32 +0 -11
- package/runtime/RuntimeString.d.ts +0 -9
- package/runtime/RuntimeString.d.ts.map +0 -1
- package/runtime/RuntimeString.js +0 -45
- package/runtime/RuntimeString.js.map +0 -1
package/es/runtime/Buffer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Buffer.js","sourceRoot":"","sources":["../../runtime/Buffer.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,OAAO,OAAO,MAAM;IACvB,OAAO,CAAC;IACC,KAAK,CAAC;IACN,QAAQ,CAAC;IAClB,YAAmB,OAAgB,EAAE,IAAY;QAC7C,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACxC,CAAC;IACM,MAAM;QACT,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IACM,IAAI;QACP,OAAO,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,
|
|
1
|
+
{"version":3,"file":"Buffer.js","sourceRoot":"","sources":["../../runtime/Buffer.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,OAAO,OAAO,MAAM;IACvB,OAAO,CAAC;IACC,KAAK,CAAC;IACN,QAAQ,CAAC;IAClB,YAAmB,OAAgB,EAAE,IAAY;QAC7C,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACxC,CAAC;IACM,MAAM;QACT,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IACM,IAAI;QACP,OAAO,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC;IAC3E,CAAC;IACM,IAAI;QACP,OAAO,IAAI,CAAC,KAAK,CAAC;IACtB,CAAC;IACM,OAAO;QACV,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACjC,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC;IACrB,CAAC;CACJ"}
|
package/es/runtime/Integer.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { IResource } from './ResourcesHolder';
|
|
2
|
-
import Runtime from './Runtime';
|
|
1
|
+
import { IResource } from './ResourcesHolder.js';
|
|
2
|
+
import Runtime from './Runtime.js';
|
|
3
3
|
export default class Integer implements IResource {
|
|
4
4
|
#private;
|
|
5
5
|
constructor(runtime: Runtime);
|
|
@@ -8,5 +8,6 @@ export default class Integer implements IResource {
|
|
|
8
8
|
size(): number;
|
|
9
9
|
offset(): number;
|
|
10
10
|
destroy(): void;
|
|
11
|
+
[Symbol.dispose](): void;
|
|
11
12
|
}
|
|
12
13
|
//# sourceMappingURL=Integer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Integer.d.ts","sourceRoot":"","sources":["../../runtime/Integer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"Integer.d.ts","sourceRoot":"","sources":["../../runtime/Integer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,OAAO,MAAM,cAAc,CAAC;AAEnC,MAAM,CAAC,OAAO,OAAO,OAAQ,YAAW,SAAS;;gBAG1B,OAAO,EAAE,OAAO;IAK5B,KAAK;IAOL,GAAG,CAAC,KAAK,EAAE,MAAM;IAIjB,IAAI;IAIJ,MAAM;IAIN,OAAO;IAKd,CAAC,MAAM,CAAC,OAAO,CAAC;CAGnB"}
|
package/es/runtime/Integer.js
CHANGED
|
@@ -3,10 +3,10 @@ export default class Integer {
|
|
|
3
3
|
#offset;
|
|
4
4
|
constructor(runtime) {
|
|
5
5
|
this.#runtime = runtime;
|
|
6
|
-
this.#offset = runtime.malloc(runtime.originalRuntime().
|
|
6
|
+
this.#offset = runtime.malloc(runtime.originalRuntime().size_of_int());
|
|
7
7
|
}
|
|
8
8
|
value() {
|
|
9
|
-
if (this.#runtime.originalRuntime().
|
|
9
|
+
if (this.#runtime.originalRuntime().size_of_int() !== 4) {
|
|
10
10
|
throw new Error('invalid integer byte size');
|
|
11
11
|
}
|
|
12
12
|
return this.#runtime.view().getInt32(this.#offset, true);
|
|
@@ -15,7 +15,7 @@ export default class Integer {
|
|
|
15
15
|
this.#runtime.view().setInt32(this.#offset, value, true);
|
|
16
16
|
}
|
|
17
17
|
size() {
|
|
18
|
-
return this.#runtime.originalRuntime().
|
|
18
|
+
return this.#runtime.originalRuntime().size_of_int();
|
|
19
19
|
}
|
|
20
20
|
offset() {
|
|
21
21
|
return this.#offset;
|
|
@@ -24,5 +24,8 @@ export default class Integer {
|
|
|
24
24
|
this.#runtime.free(this.#offset);
|
|
25
25
|
this.#offset = 0;
|
|
26
26
|
}
|
|
27
|
+
[Symbol.dispose]() {
|
|
28
|
+
this.destroy();
|
|
29
|
+
}
|
|
27
30
|
}
|
|
28
31
|
//# sourceMappingURL=Integer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Integer.js","sourceRoot":"","sources":["../../runtime/Integer.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,OAAO,OAAO,OAAO;IACf,QAAQ,CAAC;IAClB,OAAO,CAAC;IACR,YAAmB,OAAgB;QAC/B,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,eAAe,EAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"Integer.js","sourceRoot":"","sources":["../../runtime/Integer.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,OAAO,OAAO,OAAO;IACf,QAAQ,CAAC;IAClB,OAAO,CAAC;IACR,YAAmB,OAAgB;QAC/B,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,eAAe,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC;IAC3E,CAAC;IAEM,KAAK;QACR,IAAI,IAAI,CAAC,QAAQ,CAAC,eAAe,EAAE,CAAC,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC;YACtD,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;QACjD,CAAC;QACD,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IAC7D,CAAC;IAEM,GAAG,CAAC,KAAa;QACpB,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;IAC7D,CAAC;IAEM,IAAI;QACP,OAAO,IAAI,CAAC,QAAQ,CAAC,eAAe,EAAE,CAAC,WAAW,EAAE,CAAC;IACzD,CAAC;IAEM,MAAM;QACT,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IAEM,OAAO;QACV,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACjC,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC;IACrB,CAAC;IAED,CAAC,MAAM,CAAC,OAAO,CAAC;QACZ,IAAI,CAAC,OAAO,EAAE,CAAC;IACnB,CAAC;CACJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResourcesHolder.d.ts","sourceRoot":"","sources":["../../runtime/ResourcesHolder.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ResourcesHolder.d.ts","sourceRoot":"","sources":["../../runtime/ResourcesHolder.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,OAAO,eAAe;;;IAIzB,GAAG,CAAC,QAAQ,EAAE,SAAS;IAGvB,OAAO;IASd,CAAC,MAAM,CAAC,OAAO,CAAC;CAGnB;AAED,MAAM,WAAW,SAAS;IACtB,OAAO,IAAI,IAAI,CAAC;CACnB"}
|
|
@@ -1,14 +1,21 @@
|
|
|
1
1
|
export default class ResourcesHolder {
|
|
2
2
|
#resources = new Set();
|
|
3
|
-
|
|
4
|
-
}
|
|
3
|
+
#destroyed = false;
|
|
4
|
+
constructor() { }
|
|
5
5
|
add(resource) {
|
|
6
6
|
this.#resources.add(resource);
|
|
7
7
|
}
|
|
8
8
|
destroy() {
|
|
9
|
+
if (this.#destroyed) {
|
|
10
|
+
throw new Error('ResourcesHolder already destroyed');
|
|
11
|
+
}
|
|
12
|
+
this.#destroyed = true;
|
|
9
13
|
for (const r of this.#resources) {
|
|
10
14
|
r.destroy();
|
|
11
15
|
}
|
|
12
16
|
}
|
|
17
|
+
[Symbol.dispose]() {
|
|
18
|
+
this.destroy();
|
|
19
|
+
}
|
|
13
20
|
}
|
|
14
21
|
//# sourceMappingURL=ResourcesHolder.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResourcesHolder.js","sourceRoot":"","sources":["../../runtime/ResourcesHolder.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ResourcesHolder.js","sourceRoot":"","sources":["../../runtime/ResourcesHolder.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,OAAO,eAAe;IACvB,UAAU,GAAG,IAAI,GAAG,EAAa,CAAC;IAC3C,UAAU,GAAG,KAAK,CAAC;IACnB,gBAAsB,CAAC;IAChB,GAAG,CAAC,QAAmB;QAC1B,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAClC,CAAC;IACM,OAAO;QACV,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YAClB,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAC;QACzD,CAAC;QACD,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;QACvB,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YAC9B,CAAC,CAAC,OAAO,EAAE,CAAC;QAChB,CAAC;IACL,CAAC;IACD,CAAC,MAAM,CAAC,OAAO,CAAC;QACZ,IAAI,CAAC,OAAO,EAAE,CAAC;IACnB,CAAC;CACJ"}
|
package/es/runtime/Runtime.d.ts
CHANGED
|
@@ -1,24 +1,11 @@
|
|
|
1
|
-
import { EmscriptenRuntime } from '../native';
|
|
1
|
+
import { type EmscriptenRuntime } from '../native/index.js';
|
|
2
2
|
export default class Runtime {
|
|
3
3
|
#private;
|
|
4
|
-
|
|
5
|
-
decode(value: Uint8Array): string;
|
|
6
|
-
};
|
|
7
|
-
readonly TextEncoder: new () => {
|
|
8
|
-
encode(value: string): Uint8Array;
|
|
9
|
-
};
|
|
10
|
-
constructor(runtime: EmscriptenRuntime, { TextDecoder, TextEncoder, }: {
|
|
11
|
-
TextEncoder: new () => {
|
|
12
|
-
encode(value: string): Uint8Array;
|
|
13
|
-
};
|
|
14
|
-
TextDecoder: new () => {
|
|
15
|
-
decode(value: Uint8Array): string;
|
|
16
|
-
};
|
|
17
|
-
});
|
|
4
|
+
constructor(runtime: EmscriptenRuntime);
|
|
18
5
|
originalRuntime(): EmscriptenRuntime;
|
|
19
|
-
subarray(start: number, end: number): Uint8Array
|
|
6
|
+
subarray(start: number, end: number): Uint8Array<ArrayBuffer>;
|
|
20
7
|
free(offset: number): void;
|
|
21
|
-
view(): DataView
|
|
8
|
+
view(): DataView<ArrayBuffer>;
|
|
22
9
|
malloc(len: number): number;
|
|
23
10
|
}
|
|
24
11
|
//# sourceMappingURL=Runtime.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Runtime.d.ts","sourceRoot":"","sources":["../../runtime/Runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"Runtime.d.ts","sourceRoot":"","sources":["../../runtime/Runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAE5D,MAAM,CAAC,OAAO,OAAO,OAAO;;gBAEL,OAAO,EAAE,iBAAiB;IAGtC,eAAe;IAGf,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM;IAGnC,IAAI,CAAC,MAAM,EAAE,MAAM;IAGnB,IAAI;IAGJ,MAAM,CAAC,GAAG,EAAE,MAAM;CAO5B"}
|
package/es/runtime/Runtime.js
CHANGED
|
@@ -1,26 +1,22 @@
|
|
|
1
1
|
export default class Runtime {
|
|
2
2
|
#runtime;
|
|
3
|
-
|
|
4
|
-
TextEncoder;
|
|
5
|
-
constructor(runtime, { TextDecoder, TextEncoder, }) {
|
|
6
|
-
this.TextDecoder = TextDecoder;
|
|
7
|
-
this.TextEncoder = TextEncoder;
|
|
3
|
+
constructor(runtime) {
|
|
8
4
|
this.#runtime = runtime;
|
|
9
5
|
}
|
|
10
6
|
originalRuntime() {
|
|
11
7
|
return this.#runtime;
|
|
12
8
|
}
|
|
13
9
|
subarray(start, end) {
|
|
14
|
-
return this.#runtime.
|
|
10
|
+
return new Uint8Array(this.#runtime.memory.buffer, start, end - start);
|
|
15
11
|
}
|
|
16
12
|
free(offset) {
|
|
17
|
-
this.#runtime.
|
|
13
|
+
this.#runtime.free(offset);
|
|
18
14
|
}
|
|
19
15
|
view() {
|
|
20
|
-
return new DataView(this.#runtime.
|
|
16
|
+
return new DataView(this.#runtime.memory.buffer);
|
|
21
17
|
}
|
|
22
18
|
malloc(len) {
|
|
23
|
-
const offset = this.#runtime.
|
|
19
|
+
const offset = this.#runtime.malloc(len);
|
|
24
20
|
if (!offset) {
|
|
25
21
|
throw new Error(`failed to allocate ${len} bytes`);
|
|
26
22
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Runtime.js","sourceRoot":"","sources":["../../runtime/Runtime.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,OAAO,OAAO;IACf,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"Runtime.js","sourceRoot":"","sources":["../../runtime/Runtime.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,OAAO,OAAO;IACf,QAAQ,CAAC;IAClB,YAAmB,OAA0B;QACzC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;IAC5B,CAAC;IACM,eAAe;QAClB,OAAO,IAAI,CAAC,QAAQ,CAAC;IACzB,CAAC;IACM,QAAQ,CAAC,KAAa,EAAE,GAAW;QACtC,OAAO,IAAI,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,KAAK,CAAC,CAAC;IAC3E,CAAC;IACM,IAAI,CAAC,MAAc;QACtB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC/B,CAAC;IACM,IAAI;QACP,OAAO,IAAI,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACrD,CAAC;IACM,MAAM,CAAC,GAAW;QACrB,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACzC,IAAI,CAAC,MAAM,EAAE,CAAC;YACV,MAAM,IAAI,KAAK,CAAC,sBAAsB,GAAG,QAAQ,CAAC,CAAC;QACvD,CAAC;QACD,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ"}
|
package/es/runtime/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
export { default as Integer } from './Integer';
|
|
2
|
-
export { default as Runtime } from './Runtime';
|
|
3
|
-
export { default as Buffer } from './Buffer';
|
|
4
|
-
export { default as
|
|
5
|
-
export { default as ResourcesHolder, IResource } from './ResourcesHolder';
|
|
1
|
+
export { default as Integer } from './Integer.js';
|
|
2
|
+
export { default as Runtime } from './Runtime.js';
|
|
3
|
+
export { default as Buffer } from './Buffer.js';
|
|
4
|
+
export { default as ResourcesHolder, type IResource, } from './ResourcesHolder.js';
|
|
6
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../runtime/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../runtime/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EACH,OAAO,IAAI,eAAe,EAC1B,KAAK,SAAS,GACjB,MAAM,sBAAsB,CAAC"}
|
package/es/runtime/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
export { default as Integer } from './Integer';
|
|
2
|
-
export { default as Runtime } from './Runtime';
|
|
3
|
-
export { default as Buffer } from './Buffer';
|
|
4
|
-
export { default as
|
|
5
|
-
export { default as ResourcesHolder } from './ResourcesHolder';
|
|
1
|
+
export { default as Integer } from './Integer.js';
|
|
2
|
+
export { default as Runtime } from './Runtime.js';
|
|
3
|
+
export { default as Buffer } from './Buffer.js';
|
|
4
|
+
export { default as ResourcesHolder, } from './ResourcesHolder.js';
|
|
6
5
|
//# sourceMappingURL=index.js.map
|
package/es/runtime/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../runtime/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../runtime/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EACH,OAAO,IAAI,eAAe,GAE7B,MAAM,sBAAsB,CAAC"}
|
package/native/index.d.ts
CHANGED
|
@@ -1,53 +1,19 @@
|
|
|
1
1
|
type GeneratedOpusGettersAndSetters =
|
|
2
|
-
import('./opus-ts-getters-and-setters').GeneratedOpusGettersAndSetters;
|
|
2
|
+
import('./opus-ts-getters-and-setters.d.ts').GeneratedOpusGettersAndSetters;
|
|
3
3
|
|
|
4
|
-
interface
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
error: number
|
|
12
|
-
): number;
|
|
13
|
-
_ope_encoder_destroy(comments: number): void;
|
|
14
|
-
//OPE_EXPORT int ope_encoder_write_float(OggOpusEnc *enc, const float *pcm, int samples_per_channel);
|
|
15
|
-
_ope_encoder_write_float(
|
|
16
|
-
enc: number,
|
|
17
|
-
pcm: number,
|
|
18
|
-
samplesPerChannel: number
|
|
19
|
-
): number;
|
|
20
|
-
_ope_encoder_flush_header(enc: number): number;
|
|
21
|
-
_ope_encoder_drain(enc: number): number;
|
|
22
|
-
//OPE_EXPORT int ope_encoder_get_page(OggOpusEnc *enc, unsigned char **page, opus_int32 *len, int flush);
|
|
23
|
-
_ope_encoder_get_page(
|
|
24
|
-
enc: number,
|
|
25
|
-
page: number,
|
|
26
|
-
len: number,
|
|
27
|
-
flush: number
|
|
28
|
-
): number;
|
|
29
|
-
_ope_comments_create(): number;
|
|
30
|
-
_ope_comments_destroy(comments: number): void;
|
|
31
|
-
_ope_comments_add_string(comments: number, value: number): number;
|
|
32
|
-
_ope_comments_add(comments: number, tag: number, value: number): number;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export interface EmscriptenRuntime
|
|
36
|
-
extends GeneratedOpusGettersAndSetters,
|
|
37
|
-
IOpusEncFunctionMap {
|
|
38
|
-
HEAPU8: Uint8Array;
|
|
39
|
-
_malloc(n: number): number;
|
|
40
|
-
_size_of_int(): number;
|
|
41
|
-
_size_of_void_ptr(): number;
|
|
42
|
-
_size_of_size_t(): number;
|
|
43
|
-
_free(n: number): void;
|
|
44
|
-
_opus_decoder_create(
|
|
4
|
+
export interface EmscriptenRuntime extends GeneratedOpusGettersAndSetters {
|
|
5
|
+
memory: { buffer: ArrayBuffer };
|
|
6
|
+
malloc(n: number): number;
|
|
7
|
+
size_of_int(): number;
|
|
8
|
+
size_of_void_ptr(): number;
|
|
9
|
+
free(n: number): void;
|
|
10
|
+
opus_decoder_create(
|
|
45
11
|
sampleRate: number,
|
|
46
12
|
channels: number,
|
|
47
13
|
error: number
|
|
48
14
|
): number;
|
|
49
|
-
|
|
50
|
-
|
|
15
|
+
opus_decoder_destroy(dec: number): void;
|
|
16
|
+
opus_decode_float(
|
|
51
17
|
decoder: number, // OpusDecoder *st,
|
|
52
18
|
data: number, // const unsigned char *data,
|
|
53
19
|
dataLength: number, // opus_int32 len,
|
|
@@ -55,14 +21,14 @@ export interface EmscriptenRuntime
|
|
|
55
21
|
frameSize: number, // int frame_size,
|
|
56
22
|
decodeFec: number // int decode_fec
|
|
57
23
|
): number;
|
|
58
|
-
|
|
24
|
+
opus_encoder_create(
|
|
59
25
|
fs: number,
|
|
60
26
|
channels: number,
|
|
61
27
|
application: number,
|
|
62
28
|
err: number
|
|
63
29
|
): number;
|
|
64
|
-
|
|
65
|
-
|
|
30
|
+
opus_encoder_destroy(encoder: number): void;
|
|
31
|
+
opus_encode_float(
|
|
66
32
|
encoder: number, // OpusEncoder *st,
|
|
67
33
|
pcm: number, // const float *pcm,
|
|
68
34
|
frame_size: number, // int frame_size,
|
|
@@ -72,8 +38,7 @@ export interface EmscriptenRuntime
|
|
|
72
38
|
}
|
|
73
39
|
|
|
74
40
|
export interface IInitEmscriptenRuntimeOptions {
|
|
75
|
-
|
|
76
|
-
locateFile(path: string, scriptDirectory: string): string;
|
|
41
|
+
wasmFileHref: string;
|
|
77
42
|
}
|
|
78
43
|
|
|
79
44
|
declare const Module: (
|
package/native/index.js
CHANGED
|
@@ -1,21 +1,51 @@
|
|
|
1
|
+
async function createModule({ wasmFileHref } = {}) {
|
|
2
|
+
const memory = new WebAssembly.Memory({ initial: 2 });
|
|
3
|
+
const importObject = {
|
|
4
|
+
env: {
|
|
5
|
+
memory,
|
|
6
|
+
},
|
|
7
|
+
wasi_snapshot_preview1: {
|
|
8
|
+
args_get: () => 1,
|
|
9
|
+
args_sizes_get: () => 1,
|
|
10
|
+
fd_close: () => 1,
|
|
11
|
+
fd_seek: () => 1,
|
|
12
|
+
fd_write: () => 1,
|
|
13
|
+
proc_exit: () => 0,
|
|
14
|
+
},
|
|
15
|
+
};
|
|
1
16
|
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
17
|
+
let pendingWebAssemblyInstantiateSource;
|
|
18
|
+
if ('process' in globalThis) {
|
|
19
|
+
const fs = await import('fs');
|
|
20
|
+
const path = await import('path');
|
|
21
|
+
const wasmPath = path.resolve(import.meta.dirname, 'index.wasm');
|
|
22
|
+
const wasmBinary = await fs.promises.readFile(wasmPath);
|
|
23
|
+
pendingWebAssemblyInstantiateSource = WebAssembly.instantiate(
|
|
24
|
+
wasmBinary,
|
|
25
|
+
importObject
|
|
26
|
+
);
|
|
27
|
+
} else {
|
|
28
|
+
if (typeof wasmFileHref !== 'string') {
|
|
29
|
+
const wasmBinaryUrl = await import('./index.wasm');
|
|
30
|
+
wasmFileHref = wasmBinaryUrl.default;
|
|
31
|
+
}
|
|
7
32
|
|
|
8
|
-
var Module=typeof Module!="undefined"?Module:{};var readyPromiseResolve,readyPromiseReject;Module["ready"]=new Promise(function(resolve,reject){readyPromiseResolve=resolve;readyPromiseReject=reject});var moduleOverrides=Object.assign({},Module);var arguments_=[];var thisProgram="./this.program";var quit_=(status,toThrow)=>{throw toThrow};var ENVIRONMENT_IS_WEB=typeof window=="object";var ENVIRONMENT_IS_WORKER=typeof importScripts=="function";var ENVIRONMENT_IS_NODE=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string";var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;if(ENVIRONMENT_IS_NODE){var fs=require("fs");var nodePath=require("path");if(ENVIRONMENT_IS_WORKER){scriptDirectory=nodePath.dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=(filename,binary)=>{filename=isFileURI(filename)?new URL(filename):nodePath.normalize(filename);return fs.readFileSync(filename,binary?undefined:"utf8")};readBinary=filename=>{var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}return ret};readAsync=(filename,onload,onerror)=>{filename=isFileURI(filename)?new URL(filename):nodePath.normalize(filename);fs.readFile(filename,function(err,data){if(err)onerror(err);else onload(data.buffer)})};if(process.argv.length>1){thisProgram=process.argv[1].replace(/\\/g,"/")}arguments_=process.argv.slice(2);quit_=(status,toThrow)=>{process.exitCode=status;throw toThrow};Module["inspect"]=function(){return"[Emscripten Module object]"}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(_scriptDir){scriptDirectory=_scriptDir}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.replace(/[?#].*/,"").lastIndexOf("/")+1)}else{scriptDirectory=""}{read_=url=>{var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=url=>{var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=(url,onload,onerror)=>{var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=()=>{if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=title=>document.title=title}else{}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);Object.assign(Module,moduleOverrides);moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!="object"){abort("no native wasm support detected")}var wasmMemory;var ABORT=false;var EXITSTATUS;var UTF8Decoder=typeof TextDecoder!="undefined"?new TextDecoder("utf8"):undefined;function UTF8ArrayToString(heapOrArray,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var endPtr=idx;while(heapOrArray[endPtr]&&!(endPtr>=endIdx))++endPtr;if(endPtr-idx>16&&heapOrArray.buffer&&UTF8Decoder){return UTF8Decoder.decode(heapOrArray.subarray(idx,endPtr))}var str="";while(idx<endPtr){var u0=heapOrArray[idx++];if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heapOrArray[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heapOrArray[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heapOrArray[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}var HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateMemoryViews(){var b=wasmMemory.buffer;Module["HEAP8"]=HEAP8=new Int8Array(b);Module["HEAP16"]=HEAP16=new Int16Array(b);Module["HEAP32"]=HEAP32=new Int32Array(b);Module["HEAPU8"]=HEAPU8=new Uint8Array(b);Module["HEAPU16"]=HEAPU16=new Uint16Array(b);Module["HEAPU32"]=HEAPU32=new Uint32Array(b);Module["HEAPF32"]=HEAPF32=new Float32Array(b);Module["HEAPF64"]=HEAPF64=new Float64Array(b)}var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;function preRun(){if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;callRuntimeCallbacks(__ATINIT__)}function postRun(){if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function addRunDependency(id){runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}what="Aborted("+what+")";err(what);ABORT=true;EXITSTATUS=1;what+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(what);readyPromiseReject(e);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile;wasmBinaryFile="index.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}throw"both async and sync fetching of the wasm failed"}catch(err){abort(err)}}function getBinaryPromise(binaryFile){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch=="function"){return fetch(binaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+binaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(binaryFile)})}}return Promise.resolve().then(function(){return getBinary(binaryFile)})}function instantiateArrayBuffer(binaryFile,imports,receiver){return getBinaryPromise(binaryFile).then(function(binary){return WebAssembly.instantiate(binary,imports)}).then(function(instance){return instance}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(binary,binaryFile,imports,callback){if(!binary&&typeof WebAssembly.instantiateStreaming=="function"&&!isDataURI(binaryFile)&&!ENVIRONMENT_IS_NODE&&typeof fetch=="function"){return fetch(binaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,imports);return result.then(callback,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(binaryFile,imports,callback)})})}else{return instantiateArrayBuffer(binaryFile,imports,callback)}}function createWasm(){var info={"a":wasmImports};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmMemory=Module["asm"]["g"];updateMemoryViews();wasmTable=Module["asm"]["ta"];addOnInit(Module["asm"]["h"]);removeRunDependency("wasm-instantiate");return exports}addRunDependency("wasm-instantiate");function receiveInstantiationResult(result){receiveInstance(result["instance"])}if(Module["instantiateWasm"]){try{return Module["instantiateWasm"](info,receiveInstance)}catch(e){err("Module.instantiateWasm callback failed with error: "+e);readyPromiseReject(e)}}instantiateAsync(wasmBinary,wasmBinaryFile,info,receiveInstantiationResult).catch(readyPromiseReject);return{}}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){callbacks.shift()(Module)}}function _abort(){abort("")}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function abortOnCannotGrowMemory(requestedSize){abort("OOM")}function _emscripten_resize_heap(requestedSize){var oldSize=HEAPU8.length;requestedSize=requestedSize>>>0;abortOnCannotGrowMemory(requestedSize)}var SYSCALLS={varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret}};function _fd_close(fd){return 52}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){return 70}var printCharBuffers=[null,[],[]];function printChar(stream,curr){var buffer=printCharBuffers[stream];if(curr===0||curr===10){(stream===1?out:err)(UTF8ArrayToString(buffer,0));buffer.length=0}else{buffer.push(curr)}}function _fd_write(fd,iov,iovcnt,pnum){var num=0;for(var i=0;i<iovcnt;i++){var ptr=HEAPU32[iov>>2];var len=HEAPU32[iov+4>>2];iov+=8;for(var j=0;j<len;j++){printChar(fd,HEAPU8[ptr+j])}num+=len}HEAPU32[pnum>>2]=num;return 0}var wasmImports={"c":_abort,"e":_emscripten_memcpy_big,"f":_emscripten_resize_heap,"d":_fd_close,"b":_fd_seek,"a":_fd_write};var asm=createWasm();var ___wasm_call_ctors=function(){return(___wasm_call_ctors=Module["asm"]["h"]).apply(null,arguments)};var _opus_decoder_create=Module["_opus_decoder_create"]=function(){return(_opus_decoder_create=Module["_opus_decoder_create"]=Module["asm"]["i"]).apply(null,arguments)};var _opus_decode_float=Module["_opus_decode_float"]=function(){return(_opus_decode_float=Module["_opus_decode_float"]=Module["asm"]["j"]).apply(null,arguments)};var _opus_decoder_destroy=Module["_opus_decoder_destroy"]=function(){return(_opus_decoder_destroy=Module["_opus_decoder_destroy"]=Module["asm"]["k"]).apply(null,arguments)};var _opus_encoder_create=Module["_opus_encoder_create"]=function(){return(_opus_encoder_create=Module["_opus_encoder_create"]=Module["asm"]["l"]).apply(null,arguments)};var _opus_encode_float=Module["_opus_encode_float"]=function(){return(_opus_encode_float=Module["_opus_encode_float"]=Module["asm"]["m"]).apply(null,arguments)};var _opus_encoder_ctl=Module["_opus_encoder_ctl"]=function(){return(_opus_encoder_ctl=Module["_opus_encoder_ctl"]=Module["asm"]["n"]).apply(null,arguments)};var _opus_encoder_destroy=Module["_opus_encoder_destroy"]=function(){return(_opus_encoder_destroy=Module["_opus_encoder_destroy"]=Module["asm"]["o"]).apply(null,arguments)};var _ope_comments_create=Module["_ope_comments_create"]=function(){return(_ope_comments_create=Module["_ope_comments_create"]=Module["asm"]["p"]).apply(null,arguments)};var _ope_comments_copy=Module["_ope_comments_copy"]=function(){return(_ope_comments_copy=Module["_ope_comments_copy"]=Module["asm"]["q"]).apply(null,arguments)};var _ope_comments_destroy=Module["_ope_comments_destroy"]=function(){return(_ope_comments_destroy=Module["_ope_comments_destroy"]=Module["asm"]["r"]).apply(null,arguments)};var _ope_comments_add=Module["_ope_comments_add"]=function(){return(_ope_comments_add=Module["_ope_comments_add"]=Module["asm"]["s"]).apply(null,arguments)};var _ope_comments_add_string=Module["_ope_comments_add_string"]=function(){return(_ope_comments_add_string=Module["_ope_comments_add_string"]=Module["asm"]["t"]).apply(null,arguments)};var _ope_comments_add_picture_from_memory=Module["_ope_comments_add_picture_from_memory"]=function(){return(_ope_comments_add_picture_from_memory=Module["_ope_comments_add_picture_from_memory"]=Module["asm"]["u"]).apply(null,arguments)};var _ope_encoder_destroy=Module["_ope_encoder_destroy"]=function(){return(_ope_encoder_destroy=Module["_ope_encoder_destroy"]=Module["asm"]["v"]).apply(null,arguments)};var _ope_encoder_create_pull=Module["_ope_encoder_create_pull"]=function(){return(_ope_encoder_create_pull=Module["_ope_encoder_create_pull"]=Module["asm"]["w"]).apply(null,arguments)};var _ope_encoder_write_float=Module["_ope_encoder_write_float"]=function(){return(_ope_encoder_write_float=Module["_ope_encoder_write_float"]=Module["asm"]["x"]).apply(null,arguments)};var _ope_encoder_ctl=Module["_ope_encoder_ctl"]=function(){return(_ope_encoder_ctl=Module["_ope_encoder_ctl"]=Module["asm"]["y"]).apply(null,arguments)};var _ope_encoder_get_page=Module["_ope_encoder_get_page"]=function(){return(_ope_encoder_get_page=Module["_ope_encoder_get_page"]=Module["asm"]["z"]).apply(null,arguments)};var _ope_encoder_drain=Module["_ope_encoder_drain"]=function(){return(_ope_encoder_drain=Module["_ope_encoder_drain"]=Module["asm"]["A"]).apply(null,arguments)};var _ope_encoder_flush_header=Module["_ope_encoder_flush_header"]=function(){return(_ope_encoder_flush_header=Module["_ope_encoder_flush_header"]=Module["asm"]["B"]).apply(null,arguments)};var _ope_strerror=Module["_ope_strerror"]=function(){return(_ope_strerror=Module["_ope_strerror"]=Module["asm"]["C"]).apply(null,arguments)};var _size_of_int=Module["_size_of_int"]=function(){return(_size_of_int=Module["_size_of_int"]=Module["asm"]["D"]).apply(null,arguments)};var _size_of_size_t=Module["_size_of_size_t"]=function(){return(_size_of_size_t=Module["_size_of_size_t"]=Module["asm"]["E"]).apply(null,arguments)};var _size_of_void_ptr=Module["_size_of_void_ptr"]=function(){return(_size_of_void_ptr=Module["_size_of_void_ptr"]=Module["asm"]["F"]).apply(null,arguments)};var _opus_set_complexity=Module["_opus_set_complexity"]=function(){return(_opus_set_complexity=Module["_opus_set_complexity"]=Module["asm"]["G"]).apply(null,arguments)};var _opus_get_complexity=Module["_opus_get_complexity"]=function(){return(_opus_get_complexity=Module["_opus_get_complexity"]=Module["asm"]["H"]).apply(null,arguments)};var _opus_set_bitrate=Module["_opus_set_bitrate"]=function(){return(_opus_set_bitrate=Module["_opus_set_bitrate"]=Module["asm"]["I"]).apply(null,arguments)};var _opus_get_bitrate=Module["_opus_get_bitrate"]=function(){return(_opus_get_bitrate=Module["_opus_get_bitrate"]=Module["asm"]["J"]).apply(null,arguments)};var _opus_set_vbr=Module["_opus_set_vbr"]=function(){return(_opus_set_vbr=Module["_opus_set_vbr"]=Module["asm"]["K"]).apply(null,arguments)};var _opus_get_vbr=Module["_opus_get_vbr"]=function(){return(_opus_get_vbr=Module["_opus_get_vbr"]=Module["asm"]["L"]).apply(null,arguments)};var _opus_set_vbr_constraint=Module["_opus_set_vbr_constraint"]=function(){return(_opus_set_vbr_constraint=Module["_opus_set_vbr_constraint"]=Module["asm"]["M"]).apply(null,arguments)};var _opus_get_vbr_constraint=Module["_opus_get_vbr_constraint"]=function(){return(_opus_get_vbr_constraint=Module["_opus_get_vbr_constraint"]=Module["asm"]["N"]).apply(null,arguments)};var _opus_set_force_channels=Module["_opus_set_force_channels"]=function(){return(_opus_set_force_channels=Module["_opus_set_force_channels"]=Module["asm"]["O"]).apply(null,arguments)};var _opus_get_force_channels=Module["_opus_get_force_channels"]=function(){return(_opus_get_force_channels=Module["_opus_get_force_channels"]=Module["asm"]["P"]).apply(null,arguments)};var _opus_set_max_bandwidth=Module["_opus_set_max_bandwidth"]=function(){return(_opus_set_max_bandwidth=Module["_opus_set_max_bandwidth"]=Module["asm"]["Q"]).apply(null,arguments)};var _opus_get_max_bandwidth=Module["_opus_get_max_bandwidth"]=function(){return(_opus_get_max_bandwidth=Module["_opus_get_max_bandwidth"]=Module["asm"]["R"]).apply(null,arguments)};var _opus_set_bandwidth=Module["_opus_set_bandwidth"]=function(){return(_opus_set_bandwidth=Module["_opus_set_bandwidth"]=Module["asm"]["S"]).apply(null,arguments)};var _opus_set_signal=Module["_opus_set_signal"]=function(){return(_opus_set_signal=Module["_opus_set_signal"]=Module["asm"]["T"]).apply(null,arguments)};var _opus_get_signal=Module["_opus_get_signal"]=function(){return(_opus_get_signal=Module["_opus_get_signal"]=Module["asm"]["U"]).apply(null,arguments)};var _opus_set_application=Module["_opus_set_application"]=function(){return(_opus_set_application=Module["_opus_set_application"]=Module["asm"]["V"]).apply(null,arguments)};var _opus_get_application=Module["_opus_get_application"]=function(){return(_opus_get_application=Module["_opus_get_application"]=Module["asm"]["W"]).apply(null,arguments)};var _opus_get_lookahead=Module["_opus_get_lookahead"]=function(){return(_opus_get_lookahead=Module["_opus_get_lookahead"]=Module["asm"]["X"]).apply(null,arguments)};var _opus_set_inband_fec=Module["_opus_set_inband_fec"]=function(){return(_opus_set_inband_fec=Module["_opus_set_inband_fec"]=Module["asm"]["Y"]).apply(null,arguments)};var _opus_get_inband_fec=Module["_opus_get_inband_fec"]=function(){return(_opus_get_inband_fec=Module["_opus_get_inband_fec"]=Module["asm"]["Z"]).apply(null,arguments)};var _opus_set_packet_loss_perc=Module["_opus_set_packet_loss_perc"]=function(){return(_opus_set_packet_loss_perc=Module["_opus_set_packet_loss_perc"]=Module["asm"]["_"]).apply(null,arguments)};var _opus_get_packet_loss_perc=Module["_opus_get_packet_loss_perc"]=function(){return(_opus_get_packet_loss_perc=Module["_opus_get_packet_loss_perc"]=Module["asm"]["$"]).apply(null,arguments)};var _opus_set_dtx=Module["_opus_set_dtx"]=function(){return(_opus_set_dtx=Module["_opus_set_dtx"]=Module["asm"]["aa"]).apply(null,arguments)};var _opus_get_dtx=Module["_opus_get_dtx"]=function(){return(_opus_get_dtx=Module["_opus_get_dtx"]=Module["asm"]["ba"]).apply(null,arguments)};var _opus_set_lsb_depth=Module["_opus_set_lsb_depth"]=function(){return(_opus_set_lsb_depth=Module["_opus_set_lsb_depth"]=Module["asm"]["ca"]).apply(null,arguments)};var _opus_get_lsb_depth=Module["_opus_get_lsb_depth"]=function(){return(_opus_get_lsb_depth=Module["_opus_get_lsb_depth"]=Module["asm"]["da"]).apply(null,arguments)};var _opus_set_expert_frame_duration=Module["_opus_set_expert_frame_duration"]=function(){return(_opus_set_expert_frame_duration=Module["_opus_set_expert_frame_duration"]=Module["asm"]["ea"]).apply(null,arguments)};var _opus_get_expert_frame_duration=Module["_opus_get_expert_frame_duration"]=function(){return(_opus_get_expert_frame_duration=Module["_opus_get_expert_frame_duration"]=Module["asm"]["fa"]).apply(null,arguments)};var _opus_set_prediction_disabled=Module["_opus_set_prediction_disabled"]=function(){return(_opus_set_prediction_disabled=Module["_opus_set_prediction_disabled"]=Module["asm"]["ga"]).apply(null,arguments)};var _opus_get_prediction_disabled=Module["_opus_get_prediction_disabled"]=function(){return(_opus_get_prediction_disabled=Module["_opus_get_prediction_disabled"]=Module["asm"]["ha"]).apply(null,arguments)};var _opus_get_bandwidth=Module["_opus_get_bandwidth"]=function(){return(_opus_get_bandwidth=Module["_opus_get_bandwidth"]=Module["asm"]["ia"]).apply(null,arguments)};var _opus_get_sample_rate=Module["_opus_get_sample_rate"]=function(){return(_opus_get_sample_rate=Module["_opus_get_sample_rate"]=Module["asm"]["ja"]).apply(null,arguments)};var _opus_set_phase_inversion_disabled=Module["_opus_set_phase_inversion_disabled"]=function(){return(_opus_set_phase_inversion_disabled=Module["_opus_set_phase_inversion_disabled"]=Module["asm"]["ka"]).apply(null,arguments)};var _opus_get_phase_inversion_disabled=Module["_opus_get_phase_inversion_disabled"]=function(){return(_opus_get_phase_inversion_disabled=Module["_opus_get_phase_inversion_disabled"]=Module["asm"]["la"]).apply(null,arguments)};var _opus_get_in_dtx=Module["_opus_get_in_dtx"]=function(){return(_opus_get_in_dtx=Module["_opus_get_in_dtx"]=Module["asm"]["ma"]).apply(null,arguments)};var _opus_set_gain=Module["_opus_set_gain"]=function(){return(_opus_set_gain=Module["_opus_set_gain"]=Module["asm"]["na"]).apply(null,arguments)};var _opus_get_gain=Module["_opus_get_gain"]=function(){return(_opus_get_gain=Module["_opus_get_gain"]=Module["asm"]["oa"]).apply(null,arguments)};var _opus_get_last_packet_duration=Module["_opus_get_last_packet_duration"]=function(){return(_opus_get_last_packet_duration=Module["_opus_get_last_packet_duration"]=Module["asm"]["pa"]).apply(null,arguments)};var _opus_get_pitch=Module["_opus_get_pitch"]=function(){return(_opus_get_pitch=Module["_opus_get_pitch"]=Module["asm"]["qa"]).apply(null,arguments)};var ___errno_location=function(){return(___errno_location=Module["asm"]["__errno_location"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["ra"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["sa"]).apply(null,arguments)};var calledRun;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function run(){if(runDependencies>0){return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();readyPromiseResolve(Module);if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}run();
|
|
33
|
+
if (typeof wasmFileHref !== 'string') {
|
|
34
|
+
throw new Error('Invalid wasmFileHref');
|
|
35
|
+
}
|
|
9
36
|
|
|
37
|
+
const response = await fetch(wasmFileHref);
|
|
38
|
+
pendingWebAssemblyInstantiateSource =
|
|
39
|
+
await WebAssembly.instantiateStreaming(response, importObject);
|
|
40
|
+
}
|
|
10
41
|
|
|
11
|
-
|
|
42
|
+
const webAssemblyInstantiatedSource =
|
|
43
|
+
await pendingWebAssemblyInstantiateSource;
|
|
44
|
+
|
|
45
|
+
return {
|
|
46
|
+
...webAssemblyInstantiatedSource.instance.exports,
|
|
47
|
+
memory,
|
|
48
|
+
};
|
|
12
49
|
}
|
|
13
50
|
|
|
14
|
-
|
|
15
|
-
})();
|
|
16
|
-
if (typeof exports === 'object' && typeof module === 'object')
|
|
17
|
-
module.exports = Module;
|
|
18
|
-
else if (typeof define === 'function' && define['amd'])
|
|
19
|
-
define([], function() { return Module; });
|
|
20
|
-
else if (typeof exports === 'object')
|
|
21
|
-
exports["Module"] = Module;
|
|
51
|
+
export default createModule;
|
package/native/index.wasm
CHANGED
|
Binary file
|
package/opus/Decoder.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { Runtime } from '../runtime';
|
|
1
|
+
import { Runtime } from '../runtime/index.js';
|
|
2
2
|
export default class Decoder {
|
|
3
3
|
#private;
|
|
4
4
|
constructor(runtime: Runtime, sampleRate: number, channels: number, frameSize: number);
|
|
5
5
|
decodeFloat(value: Uint8Array, decodeFec?: number): number;
|
|
6
|
-
decoded(): Float32Array
|
|
6
|
+
decoded(): Float32Array<ArrayBuffer>;
|
|
7
7
|
destroy(): void;
|
|
8
|
+
[Symbol.dispose](): void;
|
|
8
9
|
}
|
|
9
10
|
//# sourceMappingURL=Decoder.d.ts.map
|
package/opus/Decoder.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Decoder.d.ts","sourceRoot":"","sources":["Decoder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAoC,MAAM,
|
|
1
|
+
{"version":3,"file":"Decoder.d.ts","sourceRoot":"","sources":["Decoder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAoC,MAAM,qBAAqB,CAAC;AAEhF,MAAM,CAAC,OAAO,OAAO,OAAO;;gBASpB,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM;IAwBd,WAAW,CAAC,KAAK,EAAE,UAAU,EAAE,SAAS,SAAI;IAwC5C,OAAO;IAQP,OAAO;IAKd,CAAC,MAAM,CAAC,OAAO,CAAC;CAGnB"}
|
package/opus/Decoder.js
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const runtime_1 = require("../runtime");
|
|
4
|
-
class Decoder {
|
|
1
|
+
import { Integer, ResourcesHolder, Buffer } from '../runtime/index.js';
|
|
2
|
+
export default class Decoder {
|
|
5
3
|
#error;
|
|
6
4
|
#decoder;
|
|
7
5
|
#holder;
|
|
8
6
|
#runtime;
|
|
9
7
|
#pcm;
|
|
10
8
|
#frameSize;
|
|
9
|
+
#data = null;
|
|
11
10
|
constructor(runtime, sampleRate, channels, frameSize) {
|
|
12
11
|
this.#frameSize = frameSize;
|
|
13
12
|
this.#runtime = runtime;
|
|
14
|
-
this.#holder = new
|
|
15
|
-
this.#error = new
|
|
13
|
+
this.#holder = new ResourcesHolder();
|
|
14
|
+
this.#error = new Integer(runtime);
|
|
16
15
|
/**
|
|
17
16
|
* holder
|
|
18
17
|
*/
|
|
@@ -22,17 +21,16 @@ class Decoder {
|
|
|
22
21
|
*/
|
|
23
22
|
this.#decoder = runtime
|
|
24
23
|
.originalRuntime()
|
|
25
|
-
.
|
|
24
|
+
.opus_decoder_create(sampleRate, channels, this.#error.offset());
|
|
26
25
|
if (!this.#decoder || this.#error.value() < 0) {
|
|
27
26
|
throw new Error('Failed to create decoder');
|
|
28
27
|
}
|
|
29
|
-
this.#pcm = new
|
|
28
|
+
this.#pcm = new Buffer(runtime, this.#frameSize * channels * Float32Array.BYTES_PER_ELEMENT);
|
|
30
29
|
}
|
|
31
|
-
#data = null;
|
|
32
30
|
decodeFloat(value, decodeFec = 0) {
|
|
33
31
|
let data = this.#data;
|
|
34
32
|
if (!data) {
|
|
35
|
-
data = new
|
|
33
|
+
data = new Buffer(this.#runtime, value.byteLength);
|
|
36
34
|
}
|
|
37
35
|
/**
|
|
38
36
|
* reallocate in case current allocated buffer is smaller than the actual
|
|
@@ -40,7 +38,7 @@ class Decoder {
|
|
|
40
38
|
*/
|
|
41
39
|
if (data.data().byteLength < value.byteLength) {
|
|
42
40
|
data.destroy();
|
|
43
|
-
data = new
|
|
41
|
+
data = new Buffer(this.#runtime, value.byteLength);
|
|
44
42
|
}
|
|
45
43
|
/**
|
|
46
44
|
* set data
|
|
@@ -56,7 +54,7 @@ class Decoder {
|
|
|
56
54
|
*/
|
|
57
55
|
const decodedSamples = this.#runtime
|
|
58
56
|
.originalRuntime()
|
|
59
|
-
.
|
|
57
|
+
.opus_decode_float(this.#decoder, data.offset(), value.byteLength, this.#pcm.offset(), this.#frameSize, decodeFec);
|
|
60
58
|
if (decodedSamples < 0) {
|
|
61
59
|
throw new Error('Failed to decode float');
|
|
62
60
|
}
|
|
@@ -67,10 +65,12 @@ class Decoder {
|
|
|
67
65
|
return new Float32Array(pcm.buffer, pcm.byteOffset, pcm.byteLength / Float32Array.BYTES_PER_ELEMENT);
|
|
68
66
|
}
|
|
69
67
|
destroy() {
|
|
70
|
-
this.#runtime.originalRuntime().
|
|
68
|
+
this.#runtime.originalRuntime().opus_decoder_destroy(this.#decoder);
|
|
71
69
|
this.#holder.destroy();
|
|
72
70
|
this.#data?.destroy();
|
|
73
71
|
}
|
|
72
|
+
[Symbol.dispose]() {
|
|
73
|
+
this.destroy();
|
|
74
|
+
}
|
|
74
75
|
}
|
|
75
|
-
exports.default = Decoder;
|
|
76
76
|
//# sourceMappingURL=Decoder.js.map
|
package/opus/Decoder.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Decoder.js","sourceRoot":"","sources":["Decoder.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Decoder.js","sourceRoot":"","sources":["Decoder.ts"],"names":[],"mappings":"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"}
|
package/opus/Encoder.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Runtime } from '../runtime';
|
|
2
|
-
import { OpusGettersAndSetters } from './OpusGettersAndSetters';
|
|
1
|
+
import { Runtime } from '../runtime/index.js';
|
|
2
|
+
import { OpusGettersAndSetters } from './OpusGettersAndSetters.js';
|
|
3
3
|
export default class Encoder extends OpusGettersAndSetters {
|
|
4
4
|
#private;
|
|
5
5
|
constructor(runtime: Runtime, sampleRate: number, channels: number, application: number,
|
|
@@ -11,7 +11,7 @@ export default class Encoder extends OpusGettersAndSetters {
|
|
|
11
11
|
* how many bytes will we be receiving through encodeFloat() function
|
|
12
12
|
*/
|
|
13
13
|
pcmBufferLength: number);
|
|
14
|
-
encoded(): Uint8Array
|
|
14
|
+
encoded(): Uint8Array<ArrayBuffer>;
|
|
15
15
|
/**
|
|
16
16
|
*
|
|
17
17
|
* @param value
|
|
@@ -21,5 +21,6 @@ export default class Encoder extends OpusGettersAndSetters {
|
|
|
21
21
|
*/
|
|
22
22
|
encodeFloat(value: Float32Array, frameSize: number, maxDataBytes: number): number;
|
|
23
23
|
destroy(): void;
|
|
24
|
+
[Symbol.dispose](): void;
|
|
24
25
|
}
|
|
25
26
|
//# sourceMappingURL=Encoder.d.ts.map
|
package/opus/Encoder.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Encoder.d.ts","sourceRoot":"","sources":["Encoder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAoC,MAAM,
|
|
1
|
+
{"version":3,"file":"Encoder.d.ts","sourceRoot":"","sources":["Encoder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAoC,MAAM,qBAAqB,CAAC;AAChF,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAEnE,MAAM,CAAC,OAAO,OAAO,OAAQ,SAAQ,qBAAqB;;gBAQlD,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM;IACnB;;OAEG;IACH,eAAe,EAAE,MAAM;IACvB;;OAEG;IACH,eAAe,EAAE,MAAM;IAyCpB,OAAO;IAGd;;;;;;OAMG;IACI,WAAW,CACd,KAAK,EAAE,YAAY,EACnB,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,MAAM;IA6BjB,OAAO;IAId,CAAC,MAAM,CAAC,OAAO,CAAC;CAGnB"}
|