opus-codec 0.0.86 → 1.0.3
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 +9 -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 +14 -9
- package/es/opus/Encoder.js.map +1 -1
- package/es/opus/OpusGettersAndSetters.d.ts +4 -2
- package/es/opus/OpusGettersAndSetters.d.ts.map +1 -1
- package/es/opus/OpusGettersAndSetters.js +47 -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 +0 -11
- package/es/opus/constants.js.map +1 -1
- package/es/opus/index.d.ts +3 -4
- package/es/opus/index.d.ts.map +1 -1
- package/es/opus/index.js +3 -4
- package/es/opus/index.js.map +1 -1
- package/es/runtime/Buffer.d.ts +4 -3
- package/es/runtime/Buffer.d.ts.map +1 -1
- package/es/runtime/Buffer.js +3 -0
- 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 +9 -3
- package/es/runtime/Integer.js.map +1 -1
- package/es/runtime/ResourcesHolder.d.ts +2 -0
- package/es/runtime/ResourcesHolder.d.ts.map +1 -1
- package/es/runtime/ResourcesHolder.js +10 -2
- package/es/runtime/ResourcesHolder.js.map +1 -1
- package/es/runtime/Runtime.d.ts +5 -17
- package/es/runtime/Runtime.d.ts.map +1 -1
- package/es/runtime/Runtime.js +15 -10
- 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 +17 -49
- package/native/index.js +75 -15
- package/native/index.wasm +0 -0
- package/native/opus-ts-getters-and-setters.d.ts +39 -39
- package/opus/Decoder.d.ts +3 -2
- package/opus/Decoder.d.ts.map +1 -1
- package/opus/Decoder.js +15 -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 +19 -17
- package/opus/Encoder.js.map +1 -1
- package/opus/OpusGettersAndSetters.d.ts +4 -2
- package/opus/OpusGettersAndSetters.d.ts.map +1 -1
- package/opus/OpusGettersAndSetters.js +88 -89
- package/opus/OpusGettersAndSetters.js.map +1 -1
- package/opus/constants.d.ts +0 -11
- package/opus/constants.d.ts.map +1 -1
- package/opus/constants.js +1 -14
- package/opus/constants.js.map +1 -1
- package/opus/index.d.ts +3 -4
- package/opus/index.d.ts.map +1 -1
- package/opus/index.js +3 -14
- package/opus/index.js.map +1 -1
- package/package.json +30 -28
- package/runtime/Buffer.d.ts +4 -3
- package/runtime/Buffer.d.ts.map +1 -1
- package/runtime/Buffer.js +4 -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 +10 -7
- package/runtime/Integer.js.map +1 -1
- package/runtime/ResourcesHolder.d.ts +2 -0
- package/runtime/ResourcesHolder.d.ts.map +1 -1
- package/runtime/ResourcesHolder.js +11 -6
- package/runtime/ResourcesHolder.js.map +1 -1
- package/runtime/Runtime.d.ts +5 -17
- package/runtime/Runtime.d.ts.map +1 -1
- package/runtime/Runtime.js +16 -14
- 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/opus/RingBuffer.d.ts +0 -8
- package/opus/RingBuffer.d.ts.map +0 -1
- package/opus/RingBuffer.js +0 -62
- package/opus/RingBuffer.js.map +0 -1
- 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/actions/Client.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Client.d.ts","sourceRoot":"","sources":["../../actions/Client.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Client.d.ts","sourceRoot":"","sources":["../../actions/Client.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,cAAc,EACd,eAAe,EACf,mBAAmB,EACtB,MAAM,cAAc,CAAC;AAEtB,MAAM,CAAC,OAAO,OAAO,MAAM;;gBAMJ,MAAM,EAAE,MAAM;IAM1B,KAAK;IAUL,WAAW,CAAC,CAAC,SAAS,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,EAAE,IAAI,EAAE,CAAC;IAuBtE,OAAO,CAAC,cAAc,CAEpB;IACF,OAAO,CAAC,OAAO,CAEb;IACF,OAAO,CAAC,SAAS,CAQf;CACL"}
|
package/es/actions/Client.js
CHANGED
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
import { boundMethod } from 'autobind-decorator';
|
|
8
1
|
export default class Client {
|
|
9
2
|
#worker;
|
|
10
3
|
#pending = new Map();
|
|
@@ -46,13 +39,13 @@ export default class Client {
|
|
|
46
39
|
this.#worker.postMessage(data);
|
|
47
40
|
});
|
|
48
41
|
}
|
|
49
|
-
onMessageError(e) {
|
|
42
|
+
onMessageError = (e) => {
|
|
50
43
|
console.error(e);
|
|
51
|
-
}
|
|
52
|
-
onError(e) {
|
|
44
|
+
};
|
|
45
|
+
onError = (e) => {
|
|
53
46
|
console.error(e);
|
|
54
|
-
}
|
|
55
|
-
onMessage(e) {
|
|
47
|
+
};
|
|
48
|
+
onMessage = (e) => {
|
|
56
49
|
const data = e.data;
|
|
57
50
|
const request = this.#pending.get(data.requestId);
|
|
58
51
|
if (!request) {
|
|
@@ -60,15 +53,6 @@ export default class Client {
|
|
|
60
53
|
return;
|
|
61
54
|
}
|
|
62
55
|
request(data);
|
|
63
|
-
}
|
|
56
|
+
};
|
|
64
57
|
}
|
|
65
|
-
__decorate([
|
|
66
|
-
boundMethod
|
|
67
|
-
], Client.prototype, "onMessageError", null);
|
|
68
|
-
__decorate([
|
|
69
|
-
boundMethod
|
|
70
|
-
], Client.prototype, "onError", null);
|
|
71
|
-
__decorate([
|
|
72
|
-
boundMethod
|
|
73
|
-
], Client.prototype, "onMessage", null);
|
|
74
58
|
//# sourceMappingURL=Client.js.map
|
package/es/actions/Client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Client.js","sourceRoot":"","sources":["../../actions/Client.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Client.js","sourceRoot":"","sources":["../../actions/Client.ts"],"names":[],"mappings":"AAMA,MAAM,CAAC,OAAO,OAAO,MAAM;IACd,OAAO,CAAC;IACR,QAAQ,GAAG,IAAI,GAAG,EAGxB,CAAC;IACJ,YAAmB,MAAc;QAC7B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;QACnD,MAAM,CAAC,gBAAgB,CAAC,cAAc,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;QAC7D,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IACnD,CAAC;IACM,KAAK;QACR,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC;QACzB,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAC5B,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAC3B,CAAC,CAAC,CAAC,CAAC,CAAC;gBACD,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC;gBACf,QAAQ,EAAE,CAAC,kBAAkB,CAAC;aAC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,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAClD,IAAI,CAAC,OAAO,EAAE,CAAC;YACX,OAAO,CAAC,KAAK,CAAC,mCAAmC,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;YACnE,OAAO;QACX,CAAC;QACD,OAAO,CAAC,IAAI,CAAC,CAAC;IAClB,CAAC,CAAC;CACL"}
|
package/es/actions/actions.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OpusGetRequest, OpusSetRequest } from './opus';
|
|
1
|
+
import { OpusGetRequest, OpusSetRequest } from './opus.js';
|
|
2
2
|
export interface IWorkerRequest<Data, Response> {
|
|
3
3
|
data: Data;
|
|
4
4
|
_response?: RequestResponse<Response>;
|
|
@@ -109,7 +109,7 @@ export interface IEncodeFloatOptions {
|
|
|
109
109
|
* that has been queued
|
|
110
110
|
*/
|
|
111
111
|
input: {
|
|
112
|
-
pcm: Float32Array
|
|
112
|
+
pcm: Float32Array<ArrayBuffer>;
|
|
113
113
|
} | null;
|
|
114
114
|
}
|
|
115
115
|
export type RequestResponseType<T> = T extends IWorkerRequest<unknown, infer R> ? R : never;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../actions/actions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../actions/actions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAE3D,MAAM,WAAW,cAAc,CAAC,IAAI,EAAE,QAAQ;IAC1C,IAAI,EAAE,IAAI,CAAC;IACX,SAAS,CAAC,EAAE,eAAe,CAAC,QAAQ,CAAC,CAAC;IACtC,QAAQ,CAAC,EAAE,WAAW,EAAE,CAAC;IACzB,SAAS,EAAE,SAAS,CAAC;CACxB;AAED,MAAM,MAAM,OAAO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,EAAE,WAAW,CAAC,WAAW,CAAC;CACjC;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,mBAAmB,GAAG,YAAY,CAOnE;AAED,MAAM,WAAW,kBAAkB;IAC/B;;OAEG;IACH,OAAO,EAAE;QACL,MAAM,EAAE,WAAW,CAAC;QACpB;;WAEG;QACH,QAAQ,EAAE,MAAM,CAAC;KACpB,GAAG,IAAI,CAAC;CACZ;AAED,MAAM,WAAW,YACb,SAAQ,cAAc,CAAC,mBAAmB,EAAE,kBAAkB,CAAC;IAC/D,IAAI,EAAE,WAAW,CAAC,WAAW,CAAC;CACjC;AAED,MAAM,WAAW,mBAAmB;IAChC,SAAS,EAAE,OAAO,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,KAAK,EAAE;QACH,GAAG,EAAE,YAAY,CAAC,WAAW,CAAC,CAAC;KAClC,GAAG,IAAI,CAAC;CACZ;AAED,MAAM,MAAM,mBAAmB,CAAC,CAAC,IAAI,CAAC,SAAS,cAAc,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,GACzE,CAAC,GACD,KAAK,CAAC;AAEZ,MAAM,MAAM,aAAa,GACnB,iBAAiB,GACjB,YAAY,GACZ,cAAc,GACd,cAAc,GACd,eAAe,GACf,YAAY,GACZ,eAAe,GACf,eAAe,GACf,eAAe,CAAC;AAEtB,iBAAS,YAAY,WAGpB;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,qBAAqB,GAAG,cAAc,CAMzE;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,mBAAmB,GAAG,YAAY,CAOnE"}
|
package/es/actions/actions.js
CHANGED
|
@@ -82,7 +82,7 @@ export function encodeFloat(data) {
|
|
|
82
82
|
data,
|
|
83
83
|
requestId: getRequestId(),
|
|
84
84
|
type: RequestType.EncodeFloat,
|
|
85
|
-
transfer: data.input !== null ? [data.input.pcm] : [],
|
|
85
|
+
transfer: data.input !== null ? [data.input.pcm.buffer] : [],
|
|
86
86
|
};
|
|
87
87
|
}
|
|
88
88
|
//# sourceMappingURL=actions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions.js","sourceRoot":"","sources":["../../actions/actions.ts"],"names":[],"mappings":"AAoCA,MAAM,UAAU,cAAc,CAAC,IAAoB;IAC/C,OAAO;QACH,IAAI,EAAE,WAAW,CAAC,cAAc;QAChC,IAAI;QACJ,SAAS,EAAE,YAAY,EAAE;KAC5B,CAAC;AACN,CAAC;AAOD,MAAM,UAAU,YAAY,CAAC,IAAoB;IAC7C,OAAO;QACH,IAAI,EAAE,WAAW,CAAC,cAAc;QAChC,IAAI;QACJ,SAAS,EAAE,YAAY,EAAE;KAC5B,CAAC;AACN,CAAC;AAkBD,MAAM,UAAU,aAAa,CACzB,UAAkB,EAClB,QAAgB,EAChB,SAAiB;IAEjB,OAAO;QACH,IAAI,EAAE,WAAW,CAAC,aAAa;QAC/B,IAAI,EAAE;YACF,SAAS;YACT,UAAU;YACV,QAAQ;SACX;QACD,SAAS,EAAE,YAAY,EAAE;KAC5B,CAAC;AACN,CAAC;AAUD,MAAM,UAAU,cAAc,CAAC,SAAkB;IAC7C,OAAO;QACH,IAAI,EAAE,WAAW,CAAC,cAAc;QAChC,IAAI,EAAE,SAAS;QACf,SAAS,EAAE,YAAY,EAAE;KAC5B,CAAC;AACN,CAAC;AAID,MAAM,CAAN,IAAY,WAUX;AAVD,WAAY,WAAW;IACnB,+DAAa,CAAA;IACb,+DAAa,CAAA;IACb,2DAAW,CAAA;IACX,2DAAW,CAAA;IACX,iEAAc,CAAA;IACd,qEAAgB,CAAA;IAChB,iEAAc,CAAA;IACd,iEAAc,CAAA;IACd,iEAAc,CAAA;AAClB,CAAC,EAVW,WAAW,KAAX,WAAW,QAUtB;AAWD,MAAM,UAAU,gBAAgB,CAC5B,IAA8B;IAE9B,OAAO;QACH,SAAS,EAAE,YAAY,EAAE;QACzB,IAAI;QACJ,IAAI,EAAE,WAAW,CAAC,gBAAgB;KACr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QAAQ,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC;KAC3B,CAAC;AACN,CAAC;AA+CD,SAAS,YAAY;IACjB,MAAM,GAAG,GAAG,MAAM,CAAC,eAAe,CAAC,IAAI,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;IACtD,OAAO,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACzB,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,IAA2B;IACrD,OAAO;QACH,IAAI;QACJ,SAAS,EAAE,YAAY,EAAE;QACzB,IAAI,EAAE,WAAW,CAAC,aAAa;KAClC,CAAC;AACN,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,IAAyB;IACjD,OAAO;QACH,IAAI;QACJ,SAAS,EAAE,YAAY,EAAE;QACzB,IAAI,EAAE,WAAW,CAAC,WAAW;QAC7B,QAAQ,EAAE,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE;KAC/D,CAAC;AACN,CAAC"}
|
package/es/actions/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * as default from './actions';
|
|
1
|
+
export * as default from './actions.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../actions/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../actions/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC"}
|
package/es/actions/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * as default from './actions';
|
|
1
|
+
export * as default from './actions.js';
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/es/actions/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../actions/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../actions/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC"}
|
package/es/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/es/opus/Decoder.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Decoder.d.ts","sourceRoot":"","sources":["../../opus/Decoder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAoC,MAAM,
|
|
1
|
+
{"version":3,"file":"Decoder.d.ts","sourceRoot":"","sources":["../../opus/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;IAyBd,WAAW,CAAC,KAAK,EAAE,UAAU,EAAE,SAAS,SAAI;IAwC5C,OAAO;IAQP,OAAO;IAKd,CAAC,MAAM,CAAC,OAAO,CAAC;CAGnB"}
|
package/es/opus/Decoder.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Integer, ResourcesHolder, Buffer } from '../runtime';
|
|
1
|
+
import { Integer, ResourcesHolder, Buffer } from '../runtime/index.js';
|
|
2
2
|
export default class Decoder {
|
|
3
3
|
#error;
|
|
4
4
|
#decoder;
|
|
@@ -6,6 +6,7 @@ export default class Decoder {
|
|
|
6
6
|
#runtime;
|
|
7
7
|
#pcm;
|
|
8
8
|
#frameSize;
|
|
9
|
+
#data = null;
|
|
9
10
|
constructor(runtime, sampleRate, channels, frameSize) {
|
|
10
11
|
this.#frameSize = frameSize;
|
|
11
12
|
this.#runtime = runtime;
|
|
@@ -20,13 +21,13 @@ export default class Decoder {
|
|
|
20
21
|
*/
|
|
21
22
|
this.#decoder = runtime
|
|
22
23
|
.originalRuntime()
|
|
23
|
-
.
|
|
24
|
+
.opus_decoder_create(sampleRate, channels, this.#error.offset());
|
|
24
25
|
if (!this.#decoder || this.#error.value() < 0) {
|
|
25
26
|
throw new Error('Failed to create decoder');
|
|
26
27
|
}
|
|
27
28
|
this.#pcm = new Buffer(runtime, this.#frameSize * channels * Float32Array.BYTES_PER_ELEMENT);
|
|
29
|
+
this.#holder.add(this.#pcm);
|
|
28
30
|
}
|
|
29
|
-
#data = null;
|
|
30
31
|
decodeFloat(value, decodeFec = 0) {
|
|
31
32
|
let data = this.#data;
|
|
32
33
|
if (!data) {
|
|
@@ -54,7 +55,7 @@ export default class Decoder {
|
|
|
54
55
|
*/
|
|
55
56
|
const decodedSamples = this.#runtime
|
|
56
57
|
.originalRuntime()
|
|
57
|
-
.
|
|
58
|
+
.opus_decode_float(this.#decoder, data.offset(), value.byteLength, this.#pcm.offset(), this.#frameSize, decodeFec);
|
|
58
59
|
if (decodedSamples < 0) {
|
|
59
60
|
throw new Error('Failed to decode float');
|
|
60
61
|
}
|
|
@@ -65,9 +66,12 @@ export default class Decoder {
|
|
|
65
66
|
return new Float32Array(pcm.buffer, pcm.byteOffset, pcm.byteLength / Float32Array.BYTES_PER_ELEMENT);
|
|
66
67
|
}
|
|
67
68
|
destroy() {
|
|
68
|
-
this.#runtime.originalRuntime().
|
|
69
|
+
this.#runtime.originalRuntime().opus_decoder_destroy(this.#decoder);
|
|
69
70
|
this.#holder.destroy();
|
|
70
71
|
this.#data?.destroy();
|
|
71
72
|
}
|
|
73
|
+
[Symbol.dispose]() {
|
|
74
|
+
this.destroy();
|
|
75
|
+
}
|
|
72
76
|
}
|
|
73
77
|
//# sourceMappingURL=Decoder.js.map
|
package/es/opus/Decoder.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Decoder.js","sourceRoot":"","sources":["../../opus/Decoder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"Decoder.js","sourceRoot":"","sources":["../../opus/Decoder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAEhF,MAAM,CAAC,OAAO,OAAO,OAAO;IACf,MAAM,CAAC;IACP,QAAQ,CAAC;IACT,OAAO,CAAC;IACR,QAAQ,CAAC;IACT,IAAI,CAAC;IACL,UAAU,CAAC;IACpB,KAAK,GAAkB,IAAI,CAAC;IAC5B,YACI,OAAgB,EAChB,UAAkB,EAClB,QAAgB,EAChB,SAAiB;QAEjB,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC5B,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,IAAI,CAAC,OAAO,GAAG,IAAI,eAAe,EAAE,CAAC;QACrC,IAAI,CAAC,MAAM,GAAG,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;QACnC;;WAEG;QACH,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC9B;;WAEG;QACH,IAAI,CAAC,QAAQ,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AAC,MAAM,EAAE,EACb,KAAK,CAAC,UAAU,EAChB,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,EAClB,IAAI,CAAC,UAAU,EACf,SAAS,CACZ,CAAC;QACN,IAAI,cAAc,GAAG,CAAC,EAAE,CAAC;YACrB,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC;QAC9C,CAAC;QACD,OAAO,cAAc,CAAC;IAC1B,CAAC;IACM,OAAO;QACV,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;QAC7B,OAAO,IAAI,YAAY,CACnB,GAAG,CAAC,MAAM,EACV,GAAG,CAAC,UAAU,EACd,GAAG,CAAC,UAAU,GAAG,YAAY,CAAC,iBAAiB,CAClD,CAAC;IACN,CAAC;IACM,OAAO;QACV,IAAI,CAAC,QAAQ,CAAC,eAAe,EAAE,CAAC,oBAAoB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACpE,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;QACvB,IAAI,CAAC,KAAK,EAAE,OAAO,EAAE,CAAC;IAC1B,CAAC;IACD,CAAC,MAAM,CAAC,OAAO,CAAC;QACZ,IAAI,CAAC,OAAO,EAAE,CAAC;IACnB,CAAC;CACJ"}
|
package/es/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/es/opus/Encoder.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Encoder.d.ts","sourceRoot":"","sources":["../../opus/Encoder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAoC,MAAM,
|
|
1
|
+
{"version":3,"file":"Encoder.d.ts","sourceRoot":"","sources":["../../opus/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;IA2CpB,OAAO;IAGd;;;;;;OAMG;IACI,WAAW,CACd,KAAK,EAAE,YAAY,EACnB,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,MAAM;IA6BR,OAAO;IAKP,CAAC,MAAM,CAAC,OAAO,CAAC;CAGnC"}
|
package/es/opus/Encoder.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Integer, ResourcesHolder, Buffer } from '../runtime';
|
|
2
|
-
import { OpusGettersAndSetters } from './OpusGettersAndSetters';
|
|
1
|
+
import { Integer, ResourcesHolder, Buffer } from '../runtime/index.js';
|
|
2
|
+
import { OpusGettersAndSetters } from './OpusGettersAndSetters.js';
|
|
3
3
|
export default class Encoder extends OpusGettersAndSetters {
|
|
4
4
|
#error;
|
|
5
5
|
#runtime;
|
|
@@ -16,10 +16,13 @@ export default class Encoder extends OpusGettersAndSetters {
|
|
|
16
16
|
* how many bytes will we be receiving through encodeFloat() function
|
|
17
17
|
*/
|
|
18
18
|
pcmBufferLength) {
|
|
19
|
+
if (!outBufferLength) {
|
|
20
|
+
throw new Error('Output buffer length must be more than 0');
|
|
21
|
+
}
|
|
19
22
|
const error = new Integer(runtime);
|
|
20
23
|
const encoderId = runtime
|
|
21
24
|
.originalRuntime()
|
|
22
|
-
.
|
|
25
|
+
.opus_encoder_create(sampleRate, channels, application, error.offset());
|
|
23
26
|
super(runtime, encoderId);
|
|
24
27
|
this.#holder = new ResourcesHolder();
|
|
25
28
|
this.#error = error;
|
|
@@ -43,11 +46,9 @@ export default class Encoder extends OpusGettersAndSetters {
|
|
|
43
46
|
*/
|
|
44
47
|
this.#encoder = encoderId;
|
|
45
48
|
if (error.value() < 0) {
|
|
49
|
+
this.destroy();
|
|
46
50
|
throw new Error('Failed to create encoder');
|
|
47
51
|
}
|
|
48
|
-
if (!outBufferLength) {
|
|
49
|
-
throw new Error('outBufferLength must be more than 0');
|
|
50
|
-
}
|
|
51
52
|
}
|
|
52
53
|
encoded() {
|
|
53
54
|
return this.#encoded.data();
|
|
@@ -68,15 +69,19 @@ export default class Encoder extends OpusGettersAndSetters {
|
|
|
68
69
|
.set(new Uint8Array(value.buffer, value.byteOffset, value.byteLength));
|
|
69
70
|
const result = this.#runtime
|
|
70
71
|
.originalRuntime()
|
|
71
|
-
.
|
|
72
|
+
.opus_encode_float(this.#encoder, this.#pcm.offset(), frameSize, this.#encoded.offset(), maxDataBytes);
|
|
72
73
|
if (result < 0) {
|
|
73
|
-
throw new Error(`Failed to encode float`);
|
|
74
|
+
throw new Error(`Failed to encode float: ${result}`);
|
|
74
75
|
}
|
|
75
76
|
return result;
|
|
76
77
|
}
|
|
77
78
|
destroy() {
|
|
79
|
+
super.destroy();
|
|
78
80
|
this.#holder.destroy();
|
|
79
|
-
this.#runtime.originalRuntime().
|
|
81
|
+
this.#runtime.originalRuntime().opus_encoder_destroy(this.#encoder);
|
|
82
|
+
}
|
|
83
|
+
[Symbol.dispose]() {
|
|
84
|
+
this.destroy();
|
|
80
85
|
}
|
|
81
86
|
}
|
|
82
87
|
//# sourceMappingURL=Encoder.js.map
|
package/es/opus/Encoder.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Encoder.js","sourceRoot":"","sources":["../../opus/Encoder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"Encoder.js","sourceRoot":"","sources":["../../opus/Encoder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAChF,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAEnE,MAAM,CAAC,OAAO,OAAO,OAAQ,SAAQ,qBAAqB;IAC7C,MAAM,CAAC;IACP,QAAQ,CAAC;IACT,QAAQ,CAAC;IACT,QAAQ,CAAC;IACT,IAAI,CAAC;IACL,OAAO,CAAC;IACjB,YACI,OAAgB,EAChB,UAAkB,EAClB,QAAgB,EAChB,WAAmB;IACnB;;OAEG;IACH,eAAuB;IACvB;;OAEG;IACH,eAAuB;QAEvB,IAAI,CAAC,eAAe,EAAE,CAAC;YACnB,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAC;QAChE,CAAC;QACD,MAAM,KAAK,GAAG,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;QACnC,MAAM,SAAS,GAAG,OAAO;aACpB,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AAY,EAAE,CAC1F,CAAC;QACN,CAAC;QAED,IAAI,CAAC,IAAI;aACJ,IAAI,EAAE;aACN,GAAG,CACA,IAAI,UAAU,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,UAAU,EAAE,KAAK,CAAC,UAAU,CAAC,CACnE,CAAC;QACN,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ;aACvB,eAAe,EAAE;aACjB,iBAAiB,CACd,IAAI,CAAC,QAAQ,EACb,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,EAClB,SAAS,EACT,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,EACtB,YAAY,CACf,CAAC;QAEN,IAAI,MAAM,GAAG,CAAC,EAAE,CAAC;YACb,MAAM,IAAI,KAAK,CAAC,2BAA2B,MAAM,EAAE,CAAC,CAAC;QACzD,CAAC;QAED,OAAO,MAAM,CAAC;IAClB,CAAC;IACe,OAAO;QACnB,KAAK,CAAC,OAAO,EAAE,CAAC;QAChB,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;QACvB,IAAI,CAAC,QAAQ,CAAC,eAAe,EAAE,CAAC,oBAAoB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACxE,CAAC;IACe,CAAC,MAAM,CAAC,OAAO,CAAC;QAC5B,IAAI,CAAC,OAAO,EAAE,CAAC;IACnB,CAAC;CACJ"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Runtime } from '../runtime';
|
|
2
|
-
export declare class OpusGettersAndSetters {
|
|
1
|
+
import { Runtime, type IResource } from '../runtime/index.js';
|
|
2
|
+
export declare class OpusGettersAndSetters implements IResource {
|
|
3
3
|
#private;
|
|
4
4
|
constructor(runtime: Runtime, opusEncoderOffset: number);
|
|
5
5
|
setComplexity(x: number): boolean;
|
|
@@ -41,5 +41,7 @@ export declare class OpusGettersAndSetters {
|
|
|
41
41
|
getGain(): number;
|
|
42
42
|
getLastPacketduration(): number;
|
|
43
43
|
getPitch(): number;
|
|
44
|
+
destroy(): void;
|
|
45
|
+
[Symbol.dispose](): void;
|
|
44
46
|
}
|
|
45
47
|
//# sourceMappingURL=OpusGettersAndSetters.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OpusGettersAndSetters.d.ts","sourceRoot":"","sources":["../../opus/OpusGettersAndSetters.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAW,MAAM,
|
|
1
|
+
{"version":3,"file":"OpusGettersAndSetters.d.ts","sourceRoot":"","sources":["../../opus/OpusGettersAndSetters.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAW,KAAK,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEvE,qBAAa,qBAAsB,YAAW,SAAS;;gBAIhC,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM;IAKvD,aAAa,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO;IAIjC,aAAa,IAAI,MAAM;IAKvB,UAAU,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO;IAI9B,UAAU,IAAI,MAAM;IAKpB,MAAM,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO;IAI1B,MAAM,IAAI,MAAM;IAKhB,gBAAgB,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO;IAIpC,gBAAgB,IAAI,MAAM;IAK1B,gBAAgB,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO;IAIpC,gBAAgB,IAAI,MAAM;IAK1B,eAAe,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO;IAInC,eAAe,IAAI,MAAM;IAKzB,YAAY,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO;IAIhC,SAAS,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO;IAI7B,SAAS,IAAI,MAAM;IAKnB,cAAc,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO;IAIlC,cAAc,IAAI,MAAM;IAKxB,YAAY,IAAI,MAAM;IAKtB,YAAY,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO;IAIhC,YAAY,IAAI,MAAM;IAKtB,iBAAiB,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO;IAIrC,iBAAiB,IAAI,MAAM;IAK3B,MAAM,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO;IAI1B,MAAM,IAAI,MAAM;IAKhB,WAAW,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO;IAI/B,WAAW,IAAI,MAAM;IAKrB,sBAAsB,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO;IAI1C,sBAAsB,IAAI,MAAM;IAKhC,qBAAqB,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO;IAIzC,qBAAqB,IAAI,MAAM;IAK/B,YAAY,IAAI,MAAM;IAKtB,aAAa,IAAI,MAAM;IAKvB,yBAAyB,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO;IAI7C,yBAAyB,IAAI,MAAM;IAKnC,QAAQ,IAAI,MAAM;IAKlB,OAAO,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO;IAI3B,OAAO,IAAI,MAAM;IAKjB,qBAAqB,IAAI,MAAM;IAK/B,QAAQ,IAAI,MAAM;IAKlB,OAAO;IAGd,CAAC,MAAM,CAAC,OAAO,CAAC;CAGnB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Integer } from '../runtime';
|
|
2
|
-
import constants from './constants';
|
|
1
|
+
import { Integer } from '../runtime/index.js';
|
|
2
|
+
import constants from './constants.js';
|
|
3
3
|
export class OpusGettersAndSetters {
|
|
4
4
|
#opusEncoderOffset;
|
|
5
5
|
#runtime;
|
|
@@ -10,204 +10,210 @@ export class OpusGettersAndSetters {
|
|
|
10
10
|
this.#opusEncoderOffset = opusEncoderOffset;
|
|
11
11
|
}
|
|
12
12
|
setComplexity(x) {
|
|
13
|
-
const result = this.#runtime.originalRuntime().
|
|
13
|
+
const result = this.#runtime.originalRuntime().opus_set_complexity(this.#opusEncoderOffset, x);
|
|
14
14
|
return result === constants.OPUS_OK;
|
|
15
15
|
}
|
|
16
16
|
getComplexity() {
|
|
17
|
-
const result = this.#runtime.originalRuntime().
|
|
17
|
+
const result = this.#runtime.originalRuntime().opus_get_complexity(this.#opusEncoderOffset, this.#value.offset());
|
|
18
18
|
if (result != constants.OPUS_OK)
|
|
19
19
|
throw new Error('Failed to set OPUS_GET_COMPLEXITY');
|
|
20
20
|
return this.#value.value();
|
|
21
21
|
}
|
|
22
22
|
setBitrate(x) {
|
|
23
|
-
const result = this.#runtime.originalRuntime().
|
|
23
|
+
const result = this.#runtime.originalRuntime().opus_set_bitrate(this.#opusEncoderOffset, x);
|
|
24
24
|
return result === constants.OPUS_OK;
|
|
25
25
|
}
|
|
26
26
|
getBitrate() {
|
|
27
|
-
const result = this.#runtime.originalRuntime().
|
|
27
|
+
const result = this.#runtime.originalRuntime().opus_get_bitrate(this.#opusEncoderOffset, this.#value.offset());
|
|
28
28
|
if (result != constants.OPUS_OK)
|
|
29
29
|
throw new Error('Failed to set OPUS_GET_BITRATE');
|
|
30
30
|
return this.#value.value();
|
|
31
31
|
}
|
|
32
32
|
setVbr(x) {
|
|
33
|
-
const result = this.#runtime.originalRuntime().
|
|
33
|
+
const result = this.#runtime.originalRuntime().opus_set_vbr(this.#opusEncoderOffset, x);
|
|
34
34
|
return result === constants.OPUS_OK;
|
|
35
35
|
}
|
|
36
36
|
getVbr() {
|
|
37
|
-
const result = this.#runtime.originalRuntime().
|
|
37
|
+
const result = this.#runtime.originalRuntime().opus_get_vbr(this.#opusEncoderOffset, this.#value.offset());
|
|
38
38
|
if (result != constants.OPUS_OK)
|
|
39
39
|
throw new Error('Failed to set OPUS_GET_VBR');
|
|
40
40
|
return this.#value.value();
|
|
41
41
|
}
|
|
42
42
|
setVbrConstraint(x) {
|
|
43
|
-
const result = this.#runtime.originalRuntime().
|
|
43
|
+
const result = this.#runtime.originalRuntime().opus_set_vbr_constraint(this.#opusEncoderOffset, x);
|
|
44
44
|
return result === constants.OPUS_OK;
|
|
45
45
|
}
|
|
46
46
|
getVbrConstraint() {
|
|
47
|
-
const result = this.#runtime.originalRuntime().
|
|
47
|
+
const result = this.#runtime.originalRuntime().opus_get_vbr_constraint(this.#opusEncoderOffset, this.#value.offset());
|
|
48
48
|
if (result != constants.OPUS_OK)
|
|
49
49
|
throw new Error('Failed to set OPUS_GET_VBR_CONSTRAINT');
|
|
50
50
|
return this.#value.value();
|
|
51
51
|
}
|
|
52
52
|
setForceChannels(x) {
|
|
53
|
-
const result = this.#runtime.originalRuntime().
|
|
53
|
+
const result = this.#runtime.originalRuntime().opus_set_force_channels(this.#opusEncoderOffset, x);
|
|
54
54
|
return result === constants.OPUS_OK;
|
|
55
55
|
}
|
|
56
56
|
getForceChannels() {
|
|
57
|
-
const result = this.#runtime.originalRuntime().
|
|
57
|
+
const result = this.#runtime.originalRuntime().opus_get_force_channels(this.#opusEncoderOffset, this.#value.offset());
|
|
58
58
|
if (result != constants.OPUS_OK)
|
|
59
59
|
throw new Error('Failed to set OPUS_GET_FORCE_CHANNELS');
|
|
60
60
|
return this.#value.value();
|
|
61
61
|
}
|
|
62
62
|
setMaxBandwidth(x) {
|
|
63
|
-
const result = this.#runtime.originalRuntime().
|
|
63
|
+
const result = this.#runtime.originalRuntime().opus_set_max_bandwidth(this.#opusEncoderOffset, x);
|
|
64
64
|
return result === constants.OPUS_OK;
|
|
65
65
|
}
|
|
66
66
|
getMaxBandwidth() {
|
|
67
|
-
const result = this.#runtime.originalRuntime().
|
|
67
|
+
const result = this.#runtime.originalRuntime().opus_get_max_bandwidth(this.#opusEncoderOffset, this.#value.offset());
|
|
68
68
|
if (result != constants.OPUS_OK)
|
|
69
69
|
throw new Error('Failed to set OPUS_GET_MAX_BANDWIDTH');
|
|
70
70
|
return this.#value.value();
|
|
71
71
|
}
|
|
72
72
|
setBandwidth(x) {
|
|
73
|
-
const result = this.#runtime.originalRuntime().
|
|
73
|
+
const result = this.#runtime.originalRuntime().opus_set_bandwidth(this.#opusEncoderOffset, x);
|
|
74
74
|
return result === constants.OPUS_OK;
|
|
75
75
|
}
|
|
76
76
|
setSignal(x) {
|
|
77
|
-
const result = this.#runtime.originalRuntime().
|
|
77
|
+
const result = this.#runtime.originalRuntime().opus_set_signal(this.#opusEncoderOffset, x);
|
|
78
78
|
return result === constants.OPUS_OK;
|
|
79
79
|
}
|
|
80
80
|
getSignal() {
|
|
81
|
-
const result = this.#runtime.originalRuntime().
|
|
81
|
+
const result = this.#runtime.originalRuntime().opus_get_signal(this.#opusEncoderOffset, this.#value.offset());
|
|
82
82
|
if (result != constants.OPUS_OK)
|
|
83
83
|
throw new Error('Failed to set OPUS_GET_SIGNAL');
|
|
84
84
|
return this.#value.value();
|
|
85
85
|
}
|
|
86
86
|
setApplication(x) {
|
|
87
|
-
const result = this.#runtime.originalRuntime().
|
|
87
|
+
const result = this.#runtime.originalRuntime().opus_set_application(this.#opusEncoderOffset, x);
|
|
88
88
|
return result === constants.OPUS_OK;
|
|
89
89
|
}
|
|
90
90
|
getApplication() {
|
|
91
|
-
const result = this.#runtime.originalRuntime().
|
|
91
|
+
const result = this.#runtime.originalRuntime().opus_get_application(this.#opusEncoderOffset, this.#value.offset());
|
|
92
92
|
if (result != constants.OPUS_OK)
|
|
93
93
|
throw new Error('Failed to set OPUS_GET_APPLICATION');
|
|
94
94
|
return this.#value.value();
|
|
95
95
|
}
|
|
96
96
|
getLookahead() {
|
|
97
|
-
const result = this.#runtime.originalRuntime().
|
|
97
|
+
const result = this.#runtime.originalRuntime().opus_get_lookahead(this.#opusEncoderOffset, this.#value.offset());
|
|
98
98
|
if (result != constants.OPUS_OK)
|
|
99
99
|
throw new Error('Failed to set OPUS_GET_LOOKAHEAD');
|
|
100
100
|
return this.#value.value();
|
|
101
101
|
}
|
|
102
102
|
setInbandFec(x) {
|
|
103
|
-
const result = this.#runtime.originalRuntime().
|
|
103
|
+
const result = this.#runtime.originalRuntime().opus_set_inband_fec(this.#opusEncoderOffset, x);
|
|
104
104
|
return result === constants.OPUS_OK;
|
|
105
105
|
}
|
|
106
106
|
getInbandFec() {
|
|
107
|
-
const result = this.#runtime.originalRuntime().
|
|
107
|
+
const result = this.#runtime.originalRuntime().opus_get_inband_fec(this.#opusEncoderOffset, this.#value.offset());
|
|
108
108
|
if (result != constants.OPUS_OK)
|
|
109
109
|
throw new Error('Failed to set OPUS_GET_INBAND_FEC');
|
|
110
110
|
return this.#value.value();
|
|
111
111
|
}
|
|
112
112
|
setPacketLossperc(x) {
|
|
113
|
-
const result = this.#runtime.originalRuntime().
|
|
113
|
+
const result = this.#runtime.originalRuntime().opus_set_packet_loss_perc(this.#opusEncoderOffset, x);
|
|
114
114
|
return result === constants.OPUS_OK;
|
|
115
115
|
}
|
|
116
116
|
getPacketLossperc() {
|
|
117
|
-
const result = this.#runtime.originalRuntime().
|
|
117
|
+
const result = this.#runtime.originalRuntime().opus_get_packet_loss_perc(this.#opusEncoderOffset, this.#value.offset());
|
|
118
118
|
if (result != constants.OPUS_OK)
|
|
119
119
|
throw new Error('Failed to set OPUS_GET_PACKET_LOSS_PERC');
|
|
120
120
|
return this.#value.value();
|
|
121
121
|
}
|
|
122
122
|
setDtx(x) {
|
|
123
|
-
const result = this.#runtime.originalRuntime().
|
|
123
|
+
const result = this.#runtime.originalRuntime().opus_set_dtx(this.#opusEncoderOffset, x);
|
|
124
124
|
return result === constants.OPUS_OK;
|
|
125
125
|
}
|
|
126
126
|
getDtx() {
|
|
127
|
-
const result = this.#runtime.originalRuntime().
|
|
127
|
+
const result = this.#runtime.originalRuntime().opus_get_dtx(this.#opusEncoderOffset, this.#value.offset());
|
|
128
128
|
if (result != constants.OPUS_OK)
|
|
129
129
|
throw new Error('Failed to set OPUS_GET_DTX');
|
|
130
130
|
return this.#value.value();
|
|
131
131
|
}
|
|
132
132
|
setLsbDepth(x) {
|
|
133
|
-
const result = this.#runtime.originalRuntime().
|
|
133
|
+
const result = this.#runtime.originalRuntime().opus_set_lsb_depth(this.#opusEncoderOffset, x);
|
|
134
134
|
return result === constants.OPUS_OK;
|
|
135
135
|
}
|
|
136
136
|
getLsbDepth() {
|
|
137
|
-
const result = this.#runtime.originalRuntime().
|
|
137
|
+
const result = this.#runtime.originalRuntime().opus_get_lsb_depth(this.#opusEncoderOffset, this.#value.offset());
|
|
138
138
|
if (result != constants.OPUS_OK)
|
|
139
139
|
throw new Error('Failed to set OPUS_GET_LSB_DEPTH');
|
|
140
140
|
return this.#value.value();
|
|
141
141
|
}
|
|
142
142
|
setExpertFrameduration(x) {
|
|
143
|
-
const result = this.#runtime.originalRuntime().
|
|
143
|
+
const result = this.#runtime.originalRuntime().opus_set_expert_frame_duration(this.#opusEncoderOffset, x);
|
|
144
144
|
return result === constants.OPUS_OK;
|
|
145
145
|
}
|
|
146
146
|
getExpertFrameduration() {
|
|
147
|
-
const result = this.#runtime.originalRuntime().
|
|
147
|
+
const result = this.#runtime.originalRuntime().opus_get_expert_frame_duration(this.#opusEncoderOffset, this.#value.offset());
|
|
148
148
|
if (result != constants.OPUS_OK)
|
|
149
149
|
throw new Error('Failed to set OPUS_GET_EXPERT_FRAME_DURATION');
|
|
150
150
|
return this.#value.value();
|
|
151
151
|
}
|
|
152
152
|
setPredictionDisabled(x) {
|
|
153
|
-
const result = this.#runtime.originalRuntime().
|
|
153
|
+
const result = this.#runtime.originalRuntime().opus_set_prediction_disabled(this.#opusEncoderOffset, x);
|
|
154
154
|
return result === constants.OPUS_OK;
|
|
155
155
|
}
|
|
156
156
|
getPredictionDisabled() {
|
|
157
|
-
const result = this.#runtime.originalRuntime().
|
|
157
|
+
const result = this.#runtime.originalRuntime().opus_get_prediction_disabled(this.#opusEncoderOffset, this.#value.offset());
|
|
158
158
|
if (result != constants.OPUS_OK)
|
|
159
159
|
throw new Error('Failed to set OPUS_GET_PREDICTION_DISABLED');
|
|
160
160
|
return this.#value.value();
|
|
161
161
|
}
|
|
162
162
|
getBandwidth() {
|
|
163
|
-
const result = this.#runtime.originalRuntime().
|
|
163
|
+
const result = this.#runtime.originalRuntime().opus_get_bandwidth(this.#opusEncoderOffset, this.#value.offset());
|
|
164
164
|
if (result != constants.OPUS_OK)
|
|
165
165
|
throw new Error('Failed to set OPUS_GET_BANDWIDTH');
|
|
166
166
|
return this.#value.value();
|
|
167
167
|
}
|
|
168
168
|
getSampleRate() {
|
|
169
|
-
const result = this.#runtime.originalRuntime().
|
|
169
|
+
const result = this.#runtime.originalRuntime().opus_get_sample_rate(this.#opusEncoderOffset, this.#value.offset());
|
|
170
170
|
if (result != constants.OPUS_OK)
|
|
171
171
|
throw new Error('Failed to set OPUS_GET_SAMPLE_RATE');
|
|
172
172
|
return this.#value.value();
|
|
173
173
|
}
|
|
174
174
|
setPhaseInversiondisabled(x) {
|
|
175
|
-
const result = this.#runtime.originalRuntime().
|
|
175
|
+
const result = this.#runtime.originalRuntime().opus_set_phase_inversion_disabled(this.#opusEncoderOffset, x);
|
|
176
176
|
return result === constants.OPUS_OK;
|
|
177
177
|
}
|
|
178
178
|
getPhaseInversiondisabled() {
|
|
179
|
-
const result = this.#runtime.originalRuntime().
|
|
179
|
+
const result = this.#runtime.originalRuntime().opus_get_phase_inversion_disabled(this.#opusEncoderOffset, this.#value.offset());
|
|
180
180
|
if (result != constants.OPUS_OK)
|
|
181
181
|
throw new Error('Failed to set OPUS_GET_PHASE_INVERSION_DISABLED');
|
|
182
182
|
return this.#value.value();
|
|
183
183
|
}
|
|
184
184
|
getInDtx() {
|
|
185
|
-
const result = this.#runtime.originalRuntime().
|
|
185
|
+
const result = this.#runtime.originalRuntime().opus_get_in_dtx(this.#opusEncoderOffset, this.#value.offset());
|
|
186
186
|
if (result != constants.OPUS_OK)
|
|
187
187
|
throw new Error('Failed to set OPUS_GET_IN_DTX');
|
|
188
188
|
return this.#value.value();
|
|
189
189
|
}
|
|
190
190
|
setGain(x) {
|
|
191
|
-
const result = this.#runtime.originalRuntime().
|
|
191
|
+
const result = this.#runtime.originalRuntime().opus_set_gain(this.#opusEncoderOffset, x);
|
|
192
192
|
return result === constants.OPUS_OK;
|
|
193
193
|
}
|
|
194
194
|
getGain() {
|
|
195
|
-
const result = this.#runtime.originalRuntime().
|
|
195
|
+
const result = this.#runtime.originalRuntime().opus_get_gain(this.#opusEncoderOffset, this.#value.offset());
|
|
196
196
|
if (result != constants.OPUS_OK)
|
|
197
197
|
throw new Error('Failed to set OPUS_GET_GAIN');
|
|
198
198
|
return this.#value.value();
|
|
199
199
|
}
|
|
200
200
|
getLastPacketduration() {
|
|
201
|
-
const result = this.#runtime.originalRuntime().
|
|
201
|
+
const result = this.#runtime.originalRuntime().opus_get_last_packet_duration(this.#opusEncoderOffset, this.#value.offset());
|
|
202
202
|
if (result != constants.OPUS_OK)
|
|
203
203
|
throw new Error('Failed to set OPUS_GET_LAST_PACKET_DURATION');
|
|
204
204
|
return this.#value.value();
|
|
205
205
|
}
|
|
206
206
|
getPitch() {
|
|
207
|
-
const result = this.#runtime.originalRuntime().
|
|
207
|
+
const result = this.#runtime.originalRuntime().opus_get_pitch(this.#opusEncoderOffset, this.#value.offset());
|
|
208
208
|
if (result != constants.OPUS_OK)
|
|
209
209
|
throw new Error('Failed to set OPUS_GET_PITCH');
|
|
210
210
|
return this.#value.value();
|
|
211
211
|
}
|
|
212
|
+
destroy() {
|
|
213
|
+
this.#value.destroy();
|
|
214
|
+
}
|
|
215
|
+
[Symbol.dispose]() {
|
|
216
|
+
this.destroy();
|
|
217
|
+
}
|
|
212
218
|
}
|
|
213
219
|
//# sourceMappingURL=OpusGettersAndSetters.js.map
|