opus-codec 0.0.68 → 0.0.70

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/es/actions/Client.d.ts +10 -0
  2. package/es/actions/Client.js +73 -0
  3. package/es/actions/actions.d.ts +112 -0
  4. package/es/actions/actions.js +79 -0
  5. package/es/actions/index.d.ts +1 -0
  6. package/es/actions/index.js +1 -0
  7. package/es/actions/opus.d.ts +255 -0
  8. package/es/actions/opus.js +293 -0
  9. package/es/opus/Decoder.d.ts +8 -0
  10. package/es/opus/Decoder.js +72 -0
  11. package/es/opus/Encoder.d.ts +24 -0
  12. package/es/opus/Encoder.js +81 -0
  13. package/es/opus/OpusGettersAndSetters.d.ts +44 -0
  14. package/es/opus/OpusGettersAndSetters.js +212 -0
  15. package/es/opus/RingBuffer.d.ts +6 -0
  16. package/es/opus/RingBuffer.js +46 -0
  17. package/es/opus/constants.d.ts +33 -0
  18. package/es/opus/constants.js +33 -0
  19. package/es/opus/index.d.ts +4 -0
  20. package/es/opus/index.js +4 -0
  21. package/es/runtime/Buffer.d.ts +10 -0
  22. package/es/runtime/Buffer.js +23 -0
  23. package/es/runtime/Integer.d.ts +11 -0
  24. package/es/runtime/Integer.js +27 -0
  25. package/es/runtime/ResourcesHolder.d.ts +9 -0
  26. package/es/runtime/ResourcesHolder.js +13 -0
  27. package/es/runtime/Runtime.d.ts +10 -0
  28. package/es/runtime/Runtime.js +25 -0
  29. package/es/runtime/index.d.ts +4 -0
  30. package/es/runtime/index.js +4 -0
  31. package/native/libopusenc-cmake/src/COPYING +29 -0
  32. package/native/libopusenc-cmake/src/README.md +11 -0
  33. package/native/opus/COPYING +44 -0
  34. package/native/opus/README +161 -0
  35. package/native/opus/README.draft +54 -0
  36. package/native/speexdsp-cmake/src/COPYING +35 -0
  37. package/native/speexdsp-cmake/src/README +3 -0
  38. package/native/speexdsp-cmake/src/README.Trimedia +103 -0
  39. package/native/speexdsp-cmake/src/README.blackfin +22 -0
  40. package/native/speexdsp-cmake/src/README.win32 +11 -0
  41. package/package.json +2 -2
@@ -0,0 +1,10 @@
1
+ import { IWorkerRequest, RequestResponse, RequestResponseType } from './actions';
2
+ export default class Client {
3
+ #private;
4
+ constructor(worker: Worker);
5
+ close(): void;
6
+ sendMessage<T extends IWorkerRequest<unknown, unknown>>(data: T): Promise<RequestResponse<RequestResponseType<T>>>;
7
+ private onMessageError;
8
+ private onError;
9
+ private onMessage;
10
+ }
@@ -0,0 +1,73 @@
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
+ export default class Client {
9
+ #worker;
10
+ #pending = new Map();
11
+ constructor(worker) {
12
+ this.#worker = worker;
13
+ worker.addEventListener('message', this.onMessage);
14
+ worker.addEventListener('messageerror', this.onMessageError);
15
+ worker.addEventListener('error', this.onError);
16
+ }
17
+ close() {
18
+ this.#worker.terminate();
19
+ for (const p of this.#pending) {
20
+ this.#pending.delete(p[0]);
21
+ p[1]({
22
+ requestId: p[0],
23
+ failures: ['Worker destroyed'],
24
+ });
25
+ }
26
+ }
27
+ sendMessage(data) {
28
+ const waitTimeBeforeResolvingAutomaticallyInMilliseconds = 10000;
29
+ return new Promise((resolve, reject) => {
30
+ if (this.#pending.has(data.requestId)) {
31
+ reject(new Error(`Request already exists: ${data.requestId}`));
32
+ return;
33
+ }
34
+ const timeoutId = setTimeout(() => {
35
+ resolve({
36
+ requestId: data.requestId,
37
+ failures: [
38
+ `Timeout expired. It took more than ${waitTimeBeforeResolvingAutomaticallyInMilliseconds} to resolve this request.`,
39
+ ],
40
+ });
41
+ }, waitTimeBeforeResolvingAutomaticallyInMilliseconds);
42
+ this.#pending.set(data.requestId, (data) => {
43
+ clearTimeout(timeoutId);
44
+ resolve(data);
45
+ });
46
+ this.#worker.postMessage(data);
47
+ });
48
+ }
49
+ onMessageError(e) {
50
+ console.error(e);
51
+ }
52
+ onError(e) {
53
+ console.error(e);
54
+ }
55
+ onMessage(e) {
56
+ const data = e.data;
57
+ const request = this.#pending.get(data.requestId);
58
+ if (!request) {
59
+ console.error('failed to get pending request: %s', data.requestId);
60
+ return;
61
+ }
62
+ request(data);
63
+ }
64
+ }
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);
@@ -0,0 +1,112 @@
1
+ import { OpusGetRequest, OpusSetRequest } from './opus';
2
+ export interface IWorkerRequest<Data, Response> {
3
+ data: Data;
4
+ _response?: RequestResponse<Response>;
5
+ transfer?: ArrayBuffer[];
6
+ requestId: RequestId;
7
+ }
8
+ export type CodecId = string;
9
+ export type RequestResponse<T> = {
10
+ requestId: RequestId;
11
+ value: T;
12
+ } | {
13
+ requestId: RequestId;
14
+ failures: string[];
15
+ };
16
+ export type RequestId = ReturnType<typeof getRequestId>;
17
+ export interface ICreateEncoderOptions {
18
+ sampleRate: number;
19
+ channels: number;
20
+ application: number;
21
+ outBufferLength: number;
22
+ pcmBufferLength: number;
23
+ }
24
+ export interface IOpusGetRequest extends IWorkerRequest<OpusGetRequest, number> {
25
+ type: RequestType.OpusGetRequest;
26
+ }
27
+ export declare function getFromEncoder(data: OpusGetRequest): IOpusGetRequest;
28
+ export interface IOpusSetRequest extends IWorkerRequest<OpusSetRequest, boolean> {
29
+ type: RequestType.OpusSetRequest;
30
+ }
31
+ export declare function setToEncoder(data: OpusSetRequest): IOpusSetRequest;
32
+ export interface ICreateEncoder extends IWorkerRequest<ICreateEncoderOptions, CodecId> {
33
+ type: RequestType.CreateEncoder;
34
+ }
35
+ export interface ICreateDecoderOptions {
36
+ sampleRate: number;
37
+ channels: number;
38
+ frameSize: number;
39
+ }
40
+ export interface ICreateDecoder extends IWorkerRequest<ICreateDecoderOptions, CodecId> {
41
+ type: RequestType.CreateDecoder;
42
+ }
43
+ export declare function createDecoder(sampleRate: number, channels: number, frameSize: number): ICreateDecoder;
44
+ export interface IDestroyEncoderOptions {
45
+ encoderId: CodecId;
46
+ }
47
+ export interface IDestroyEncoder extends IWorkerRequest<CodecId, null> {
48
+ type: RequestType.DestroyEncoder;
49
+ }
50
+ export declare function destroyEncoder(encoderId: CodecId): IDestroyEncoder;
51
+ export interface IDrainRingBufferResult {
52
+ }
53
+ export declare enum RequestType {
54
+ CreateEncoder = 0,
55
+ CreateDecoder = 1,
56
+ EncodeFloat = 2,
57
+ DecodeFloat = 3,
58
+ DestroyEncoder = 4,
59
+ DestroyDecoder = 5,
60
+ OpusGetRequest = 6,
61
+ OpusSetRequest = 7
62
+ }
63
+ export interface IDestroyDecoder extends IWorkerRequest<{
64
+ decoderId: CodecId;
65
+ }, null> {
66
+ type: RequestType.DestroyDecoder;
67
+ }
68
+ export declare function destroyDecoder(decoderId: CodecId): IDestroyDecoder;
69
+ export interface IDecodeFloatOptions {
70
+ decoderId: CodecId;
71
+ decodeFec?: number;
72
+ encoded: ArrayBuffer;
73
+ }
74
+ export interface IDecodeFloatResult {
75
+ decoded: ArrayBuffer;
76
+ }
77
+ export interface IDecodeFloat extends IWorkerRequest<IDecodeFloatOptions, IDecodeFloatResult> {
78
+ type: RequestType.DecodeFloat;
79
+ }
80
+ export declare function decodeFloat(data: IDecodeFloatOptions): IDecodeFloat;
81
+ export interface IEncodeFloatResult {
82
+ /**
83
+ * if null, it means the data was written to the ring buffer, but not yet submitted
84
+ */
85
+ encoded: {
86
+ buffer: ArrayBuffer;
87
+ /**
88
+ * duration in milliseconds
89
+ */
90
+ duration: number;
91
+ } | null;
92
+ }
93
+ export interface IEncodeFloat extends IWorkerRequest<IEncodeFloatOptions, IEncodeFloatResult> {
94
+ type: RequestType.EncodeFloat;
95
+ }
96
+ export interface IEncodeFloatOptions {
97
+ encoderId: CodecId;
98
+ maxDataBytes: number;
99
+ /**
100
+ * if null, it will try to drain the ring buffer for the data
101
+ * that has been queued
102
+ */
103
+ input: {
104
+ pcm: Float32Array;
105
+ } | null;
106
+ }
107
+ export type RequestResponseType<T> = T extends IWorkerRequest<unknown, infer R> ? R : never;
108
+ export type WorkerRequest = IEncodeFloat | ICreateEncoder | ICreateDecoder | IDestroyDecoder | IDecodeFloat | IDestroyEncoder | IOpusGetRequest | IOpusSetRequest;
109
+ declare function getRequestId(): string;
110
+ export declare function createEncoder(data: ICreateEncoderOptions): ICreateEncoder;
111
+ export declare function encodeFloat(data: IEncodeFloatOptions): IEncodeFloat;
112
+ export {};
@@ -0,0 +1,79 @@
1
+ export function getFromEncoder(data) {
2
+ return {
3
+ type: RequestType.OpusGetRequest,
4
+ data,
5
+ requestId: getRequestId(),
6
+ };
7
+ }
8
+ export function setToEncoder(data) {
9
+ return {
10
+ type: RequestType.OpusSetRequest,
11
+ data,
12
+ requestId: getRequestId(),
13
+ };
14
+ }
15
+ export function createDecoder(sampleRate, channels, frameSize) {
16
+ return {
17
+ type: RequestType.CreateDecoder,
18
+ data: {
19
+ frameSize,
20
+ sampleRate,
21
+ channels,
22
+ },
23
+ requestId: getRequestId(),
24
+ };
25
+ }
26
+ export function destroyEncoder(encoderId) {
27
+ return {
28
+ type: RequestType.DestroyEncoder,
29
+ data: encoderId,
30
+ requestId: getRequestId(),
31
+ };
32
+ }
33
+ export var RequestType;
34
+ (function (RequestType) {
35
+ RequestType[RequestType["CreateEncoder"] = 0] = "CreateEncoder";
36
+ RequestType[RequestType["CreateDecoder"] = 1] = "CreateDecoder";
37
+ RequestType[RequestType["EncodeFloat"] = 2] = "EncodeFloat";
38
+ RequestType[RequestType["DecodeFloat"] = 3] = "DecodeFloat";
39
+ RequestType[RequestType["DestroyEncoder"] = 4] = "DestroyEncoder";
40
+ RequestType[RequestType["DestroyDecoder"] = 5] = "DestroyDecoder";
41
+ RequestType[RequestType["OpusGetRequest"] = 6] = "OpusGetRequest";
42
+ RequestType[RequestType["OpusSetRequest"] = 7] = "OpusSetRequest";
43
+ })(RequestType || (RequestType = {}));
44
+ export function destroyDecoder(decoderId) {
45
+ return {
46
+ type: RequestType.DestroyDecoder,
47
+ data: {
48
+ decoderId,
49
+ },
50
+ requestId: getRequestId(),
51
+ };
52
+ }
53
+ export function decodeFloat(data) {
54
+ return {
55
+ type: RequestType.DecodeFloat,
56
+ data,
57
+ requestId: getRequestId(),
58
+ transfer: [data.encoded],
59
+ };
60
+ }
61
+ function getRequestId() {
62
+ const ids = crypto.getRandomValues(new Int32Array(4));
63
+ return ids.join('-');
64
+ }
65
+ export function createEncoder(data) {
66
+ return {
67
+ data,
68
+ requestId: getRequestId(),
69
+ type: RequestType.CreateEncoder,
70
+ };
71
+ }
72
+ export function encodeFloat(data) {
73
+ return {
74
+ data,
75
+ requestId: getRequestId(),
76
+ type: RequestType.EncodeFloat,
77
+ transfer: data.input !== null ? [data.input.pcm] : [],
78
+ };
79
+ }
@@ -0,0 +1 @@
1
+ export * as default from './actions';
@@ -0,0 +1 @@
1
+ export * as default from './actions';
@@ -0,0 +1,255 @@
1
+ export declare enum OpusRequest {
2
+ SetComplexity = "OPUS_SET_COMPLEXITY",
3
+ GetComplexity = "OPUS_GET_COMPLEXITY",
4
+ SetBitrate = "OPUS_SET_BITRATE",
5
+ GetBitrate = "OPUS_GET_BITRATE",
6
+ SetVbr = "OPUS_SET_VBR",
7
+ GetVbr = "OPUS_GET_VBR",
8
+ SetVbrConstraint = "OPUS_SET_VBR_CONSTRAINT",
9
+ GetVbrConstraint = "OPUS_GET_VBR_CONSTRAINT",
10
+ SetForceChannels = "OPUS_SET_FORCE_CHANNELS",
11
+ GetForceChannels = "OPUS_GET_FORCE_CHANNELS",
12
+ SetMaxBandwidth = "OPUS_SET_MAX_BANDWIDTH",
13
+ GetMaxBandwidth = "OPUS_GET_MAX_BANDWIDTH",
14
+ SetBandwidth = "OPUS_SET_BANDWIDTH",
15
+ SetSignal = "OPUS_SET_SIGNAL",
16
+ GetSignal = "OPUS_GET_SIGNAL",
17
+ SetApplication = "OPUS_SET_APPLICATION",
18
+ GetApplication = "OPUS_GET_APPLICATION",
19
+ GetLookahead = "OPUS_GET_LOOKAHEAD",
20
+ SetInbandFec = "OPUS_SET_INBAND_FEC",
21
+ GetInbandFec = "OPUS_GET_INBAND_FEC",
22
+ SetPacketLossperc = "OPUS_SET_PACKET_LOSS_PERC",
23
+ GetPacketLossperc = "OPUS_GET_PACKET_LOSS_PERC",
24
+ SetDtx = "OPUS_SET_DTX",
25
+ GetDtx = "OPUS_GET_DTX",
26
+ SetLsbDepth = "OPUS_SET_LSB_DEPTH",
27
+ GetLsbDepth = "OPUS_GET_LSB_DEPTH",
28
+ SetExpertFrameduration = "OPUS_SET_EXPERT_FRAME_DURATION",
29
+ GetExpertFrameduration = "OPUS_GET_EXPERT_FRAME_DURATION",
30
+ SetPredictionDisabled = "OPUS_SET_PREDICTION_DISABLED",
31
+ GetPredictionDisabled = "OPUS_GET_PREDICTION_DISABLED",
32
+ GetBandwidth = "OPUS_GET_BANDWIDTH",
33
+ GetSampleRate = "OPUS_GET_SAMPLE_RATE",
34
+ SetPhaseInversiondisabled = "OPUS_SET_PHASE_INVERSION_DISABLED",
35
+ GetPhaseInversiondisabled = "OPUS_GET_PHASE_INVERSION_DISABLED",
36
+ GetInDtx = "OPUS_GET_IN_DTX",
37
+ SetGain = "OPUS_SET_GAIN",
38
+ GetGain = "OPUS_GET_GAIN",
39
+ GetLastPacketduration = "OPUS_GET_LAST_PACKET_DURATION",
40
+ GetPitch = "OPUS_GET_PITCH"
41
+ }
42
+ export interface IOpusSetComplexity {
43
+ type: OpusRequest.SetComplexity;
44
+ encoderId: string;
45
+ value: number;
46
+ }
47
+ export declare function OPUS_SET_COMPLEXITY(encoderId: string, x: number): IOpusSetComplexity;
48
+ export interface IOpusGetComplexity {
49
+ type: OpusRequest.GetComplexity;
50
+ encoderId: string;
51
+ }
52
+ export declare function OPUS_GET_COMPLEXITY(encoderId: string): IOpusGetComplexity;
53
+ export interface IOpusSetBitrate {
54
+ type: OpusRequest.SetBitrate;
55
+ encoderId: string;
56
+ value: number;
57
+ }
58
+ export declare function OPUS_SET_BITRATE(encoderId: string, x: number): IOpusSetBitrate;
59
+ export interface IOpusGetBitrate {
60
+ type: OpusRequest.GetBitrate;
61
+ encoderId: string;
62
+ }
63
+ export declare function OPUS_GET_BITRATE(encoderId: string): IOpusGetBitrate;
64
+ export interface IOpusSetVbr {
65
+ type: OpusRequest.SetVbr;
66
+ encoderId: string;
67
+ value: number;
68
+ }
69
+ export declare function OPUS_SET_VBR(encoderId: string, x: number): IOpusSetVbr;
70
+ export interface IOpusGetVbr {
71
+ type: OpusRequest.GetVbr;
72
+ encoderId: string;
73
+ }
74
+ export declare function OPUS_GET_VBR(encoderId: string): IOpusGetVbr;
75
+ export interface IOpusSetVbrconstraint {
76
+ type: OpusRequest.SetVbrConstraint;
77
+ encoderId: string;
78
+ value: number;
79
+ }
80
+ export declare function OPUS_SET_VBR_CONSTRAINT(encoderId: string, x: number): IOpusSetVbrconstraint;
81
+ export interface IOpusGetVbrconstraint {
82
+ type: OpusRequest.GetVbrConstraint;
83
+ encoderId: string;
84
+ }
85
+ export declare function OPUS_GET_VBR_CONSTRAINT(encoderId: string): IOpusGetVbrconstraint;
86
+ export interface IOpusSetForcechannels {
87
+ type: OpusRequest.SetForceChannels;
88
+ encoderId: string;
89
+ value: number;
90
+ }
91
+ export declare function OPUS_SET_FORCE_CHANNELS(encoderId: string, x: number): IOpusSetForcechannels;
92
+ export interface IOpusGetForcechannels {
93
+ type: OpusRequest.GetForceChannels;
94
+ encoderId: string;
95
+ }
96
+ export declare function OPUS_GET_FORCE_CHANNELS(encoderId: string): IOpusGetForcechannels;
97
+ export interface IOpusSetMaxbandwidth {
98
+ type: OpusRequest.SetMaxBandwidth;
99
+ encoderId: string;
100
+ value: number;
101
+ }
102
+ export declare function OPUS_SET_MAX_BANDWIDTH(encoderId: string, x: number): IOpusSetMaxbandwidth;
103
+ export interface IOpusGetMaxbandwidth {
104
+ type: OpusRequest.GetMaxBandwidth;
105
+ encoderId: string;
106
+ }
107
+ export declare function OPUS_GET_MAX_BANDWIDTH(encoderId: string): IOpusGetMaxbandwidth;
108
+ export interface IOpusSetBandwidth {
109
+ type: OpusRequest.SetBandwidth;
110
+ encoderId: string;
111
+ value: number;
112
+ }
113
+ export declare function OPUS_SET_BANDWIDTH(encoderId: string, x: number): IOpusSetBandwidth;
114
+ export interface IOpusSetSignal {
115
+ type: OpusRequest.SetSignal;
116
+ encoderId: string;
117
+ value: number;
118
+ }
119
+ export declare function OPUS_SET_SIGNAL(encoderId: string, x: number): IOpusSetSignal;
120
+ export interface IOpusGetSignal {
121
+ type: OpusRequest.GetSignal;
122
+ encoderId: string;
123
+ }
124
+ export declare function OPUS_GET_SIGNAL(encoderId: string): IOpusGetSignal;
125
+ export interface IOpusSetApplication {
126
+ type: OpusRequest.SetApplication;
127
+ encoderId: string;
128
+ value: number;
129
+ }
130
+ export declare function OPUS_SET_APPLICATION(encoderId: string, x: number): IOpusSetApplication;
131
+ export interface IOpusGetApplication {
132
+ type: OpusRequest.GetApplication;
133
+ encoderId: string;
134
+ }
135
+ export declare function OPUS_GET_APPLICATION(encoderId: string): IOpusGetApplication;
136
+ export interface IOpusGetLookahead {
137
+ type: OpusRequest.GetLookahead;
138
+ encoderId: string;
139
+ }
140
+ export declare function OPUS_GET_LOOKAHEAD(encoderId: string): IOpusGetLookahead;
141
+ export interface IOpusSetInbandfec {
142
+ type: OpusRequest.SetInbandFec;
143
+ encoderId: string;
144
+ value: number;
145
+ }
146
+ export declare function OPUS_SET_INBAND_FEC(encoderId: string, x: number): IOpusSetInbandfec;
147
+ export interface IOpusGetInbandfec {
148
+ type: OpusRequest.GetInbandFec;
149
+ encoderId: string;
150
+ }
151
+ export declare function OPUS_GET_INBAND_FEC(encoderId: string): IOpusGetInbandfec;
152
+ export interface IOpusSetPacketlossPerc {
153
+ type: OpusRequest.SetPacketLossperc;
154
+ encoderId: string;
155
+ value: number;
156
+ }
157
+ export declare function OPUS_SET_PACKET_LOSS_PERC(encoderId: string, x: number): IOpusSetPacketlossPerc;
158
+ export interface IOpusGetPacketlossPerc {
159
+ type: OpusRequest.GetPacketLossperc;
160
+ encoderId: string;
161
+ }
162
+ export declare function OPUS_GET_PACKET_LOSS_PERC(encoderId: string): IOpusGetPacketlossPerc;
163
+ export interface IOpusSetDtx {
164
+ type: OpusRequest.SetDtx;
165
+ encoderId: string;
166
+ value: number;
167
+ }
168
+ export declare function OPUS_SET_DTX(encoderId: string, x: number): IOpusSetDtx;
169
+ export interface IOpusGetDtx {
170
+ type: OpusRequest.GetDtx;
171
+ encoderId: string;
172
+ }
173
+ export declare function OPUS_GET_DTX(encoderId: string): IOpusGetDtx;
174
+ export interface IOpusSetLsbdepth {
175
+ type: OpusRequest.SetLsbDepth;
176
+ encoderId: string;
177
+ value: number;
178
+ }
179
+ export declare function OPUS_SET_LSB_DEPTH(encoderId: string, x: number): IOpusSetLsbdepth;
180
+ export interface IOpusGetLsbdepth {
181
+ type: OpusRequest.GetLsbDepth;
182
+ encoderId: string;
183
+ }
184
+ export declare function OPUS_GET_LSB_DEPTH(encoderId: string): IOpusGetLsbdepth;
185
+ export interface IOpusSetExpertframeDuration {
186
+ type: OpusRequest.SetExpertFrameduration;
187
+ encoderId: string;
188
+ value: number;
189
+ }
190
+ export declare function OPUS_SET_EXPERT_FRAME_DURATION(encoderId: string, x: number): IOpusSetExpertframeDuration;
191
+ export interface IOpusGetExpertframeDuration {
192
+ type: OpusRequest.GetExpertFrameduration;
193
+ encoderId: string;
194
+ }
195
+ export declare function OPUS_GET_EXPERT_FRAME_DURATION(encoderId: string): IOpusGetExpertframeDuration;
196
+ export interface IOpusSetPredictiondisabled {
197
+ type: OpusRequest.SetPredictionDisabled;
198
+ encoderId: string;
199
+ value: number;
200
+ }
201
+ export declare function OPUS_SET_PREDICTION_DISABLED(encoderId: string, x: number): IOpusSetPredictiondisabled;
202
+ export interface IOpusGetPredictiondisabled {
203
+ type: OpusRequest.GetPredictionDisabled;
204
+ encoderId: string;
205
+ }
206
+ export declare function OPUS_GET_PREDICTION_DISABLED(encoderId: string): IOpusGetPredictiondisabled;
207
+ export interface IOpusGetBandwidth {
208
+ type: OpusRequest.GetBandwidth;
209
+ encoderId: string;
210
+ }
211
+ export declare function OPUS_GET_BANDWIDTH(encoderId: string): IOpusGetBandwidth;
212
+ export interface IOpusGetSamplerate {
213
+ type: OpusRequest.GetSampleRate;
214
+ encoderId: string;
215
+ }
216
+ export declare function OPUS_GET_SAMPLE_RATE(encoderId: string): IOpusGetSamplerate;
217
+ export interface IOpusSetPhaseinversionDisabled {
218
+ type: OpusRequest.SetPhaseInversiondisabled;
219
+ encoderId: string;
220
+ value: number;
221
+ }
222
+ export declare function OPUS_SET_PHASE_INVERSION_DISABLED(encoderId: string, x: number): IOpusSetPhaseinversionDisabled;
223
+ export interface IOpusGetPhaseinversionDisabled {
224
+ type: OpusRequest.GetPhaseInversiondisabled;
225
+ encoderId: string;
226
+ }
227
+ export declare function OPUS_GET_PHASE_INVERSION_DISABLED(encoderId: string): IOpusGetPhaseinversionDisabled;
228
+ export interface IOpusGetIndtx {
229
+ type: OpusRequest.GetInDtx;
230
+ encoderId: string;
231
+ }
232
+ export declare function OPUS_GET_IN_DTX(encoderId: string): IOpusGetIndtx;
233
+ export interface IOpusSetGain {
234
+ type: OpusRequest.SetGain;
235
+ encoderId: string;
236
+ value: number;
237
+ }
238
+ export declare function OPUS_SET_GAIN(encoderId: string, x: number): IOpusSetGain;
239
+ export interface IOpusGetGain {
240
+ type: OpusRequest.GetGain;
241
+ encoderId: string;
242
+ }
243
+ export declare function OPUS_GET_GAIN(encoderId: string): IOpusGetGain;
244
+ export interface IOpusGetLastpacketDuration {
245
+ type: OpusRequest.GetLastPacketduration;
246
+ encoderId: string;
247
+ }
248
+ export declare function OPUS_GET_LAST_PACKET_DURATION(encoderId: string): IOpusGetLastpacketDuration;
249
+ export interface IOpusGetPitch {
250
+ type: OpusRequest.GetPitch;
251
+ encoderId: string;
252
+ }
253
+ export declare function OPUS_GET_PITCH(encoderId: string): IOpusGetPitch;
254
+ export type OpusGetRequest = IOpusGetComplexity | IOpusGetBitrate | IOpusGetVbr | IOpusGetVbrconstraint | IOpusGetForcechannels | IOpusGetMaxbandwidth | IOpusGetSignal | IOpusGetApplication | IOpusGetLookahead | IOpusGetInbandfec | IOpusGetPacketlossPerc | IOpusGetDtx | IOpusGetLsbdepth | IOpusGetExpertframeDuration | IOpusGetPredictiondisabled | IOpusGetBandwidth | IOpusGetSamplerate | IOpusGetPhaseinversionDisabled | IOpusGetIndtx | IOpusGetGain | IOpusGetLastpacketDuration | IOpusGetPitch;
255
+ export type OpusSetRequest = IOpusSetComplexity | IOpusSetBitrate | IOpusSetVbr | IOpusSetVbrconstraint | IOpusSetForcechannels | IOpusSetMaxbandwidth | IOpusSetBandwidth | IOpusSetSignal | IOpusSetApplication | IOpusSetInbandfec | IOpusSetPacketlossPerc | IOpusSetDtx | IOpusSetLsbdepth | IOpusSetExpertframeDuration | IOpusSetPredictiondisabled | IOpusSetPhaseinversionDisabled | IOpusSetGain;