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
|
@@ -1,220 +1,219 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.OpusGettersAndSetters = void 0;
|
|
7
|
-
const runtime_1 = require("../runtime");
|
|
8
|
-
const constants_1 = __importDefault(require("./constants"));
|
|
9
|
-
class OpusGettersAndSetters {
|
|
1
|
+
import { Integer } from '../runtime/index.js';
|
|
2
|
+
import constants from './constants.js';
|
|
3
|
+
export class OpusGettersAndSetters {
|
|
10
4
|
#opusEncoderOffset;
|
|
11
5
|
#runtime;
|
|
12
6
|
#value;
|
|
13
7
|
constructor(runtime, opusEncoderOffset) {
|
|
14
8
|
this.#runtime = runtime;
|
|
15
|
-
this.#value = new
|
|
9
|
+
this.#value = new Integer(runtime);
|
|
16
10
|
this.#opusEncoderOffset = opusEncoderOffset;
|
|
17
11
|
}
|
|
18
12
|
setComplexity(x) {
|
|
19
|
-
const result = this.#runtime.originalRuntime().
|
|
20
|
-
return result ===
|
|
13
|
+
const result = this.#runtime.originalRuntime().opus_set_complexity(this.#opusEncoderOffset, x);
|
|
14
|
+
return result === constants.OPUS_OK;
|
|
21
15
|
}
|
|
22
16
|
getComplexity() {
|
|
23
|
-
const result = this.#runtime.originalRuntime().
|
|
24
|
-
if (result !=
|
|
17
|
+
const result = this.#runtime.originalRuntime().opus_get_complexity(this.#opusEncoderOffset, this.#value.offset());
|
|
18
|
+
if (result != constants.OPUS_OK)
|
|
25
19
|
throw new Error('Failed to set OPUS_GET_COMPLEXITY');
|
|
26
20
|
return this.#value.value();
|
|
27
21
|
}
|
|
28
22
|
setBitrate(x) {
|
|
29
|
-
const result = this.#runtime.originalRuntime().
|
|
30
|
-
return result ===
|
|
23
|
+
const result = this.#runtime.originalRuntime().opus_set_bitrate(this.#opusEncoderOffset, x);
|
|
24
|
+
return result === constants.OPUS_OK;
|
|
31
25
|
}
|
|
32
26
|
getBitrate() {
|
|
33
|
-
const result = this.#runtime.originalRuntime().
|
|
34
|
-
if (result !=
|
|
27
|
+
const result = this.#runtime.originalRuntime().opus_get_bitrate(this.#opusEncoderOffset, this.#value.offset());
|
|
28
|
+
if (result != constants.OPUS_OK)
|
|
35
29
|
throw new Error('Failed to set OPUS_GET_BITRATE');
|
|
36
30
|
return this.#value.value();
|
|
37
31
|
}
|
|
38
32
|
setVbr(x) {
|
|
39
|
-
const result = this.#runtime.originalRuntime().
|
|
40
|
-
return result ===
|
|
33
|
+
const result = this.#runtime.originalRuntime().opus_set_vbr(this.#opusEncoderOffset, x);
|
|
34
|
+
return result === constants.OPUS_OK;
|
|
41
35
|
}
|
|
42
36
|
getVbr() {
|
|
43
|
-
const result = this.#runtime.originalRuntime().
|
|
44
|
-
if (result !=
|
|
37
|
+
const result = this.#runtime.originalRuntime().opus_get_vbr(this.#opusEncoderOffset, this.#value.offset());
|
|
38
|
+
if (result != constants.OPUS_OK)
|
|
45
39
|
throw new Error('Failed to set OPUS_GET_VBR');
|
|
46
40
|
return this.#value.value();
|
|
47
41
|
}
|
|
48
42
|
setVbrConstraint(x) {
|
|
49
|
-
const result = this.#runtime.originalRuntime().
|
|
50
|
-
return result ===
|
|
43
|
+
const result = this.#runtime.originalRuntime().opus_set_vbr_constraint(this.#opusEncoderOffset, x);
|
|
44
|
+
return result === constants.OPUS_OK;
|
|
51
45
|
}
|
|
52
46
|
getVbrConstraint() {
|
|
53
|
-
const result = this.#runtime.originalRuntime().
|
|
54
|
-
if (result !=
|
|
47
|
+
const result = this.#runtime.originalRuntime().opus_get_vbr_constraint(this.#opusEncoderOffset, this.#value.offset());
|
|
48
|
+
if (result != constants.OPUS_OK)
|
|
55
49
|
throw new Error('Failed to set OPUS_GET_VBR_CONSTRAINT');
|
|
56
50
|
return this.#value.value();
|
|
57
51
|
}
|
|
58
52
|
setForceChannels(x) {
|
|
59
|
-
const result = this.#runtime.originalRuntime().
|
|
60
|
-
return result ===
|
|
53
|
+
const result = this.#runtime.originalRuntime().opus_set_force_channels(this.#opusEncoderOffset, x);
|
|
54
|
+
return result === constants.OPUS_OK;
|
|
61
55
|
}
|
|
62
56
|
getForceChannels() {
|
|
63
|
-
const result = this.#runtime.originalRuntime().
|
|
64
|
-
if (result !=
|
|
57
|
+
const result = this.#runtime.originalRuntime().opus_get_force_channels(this.#opusEncoderOffset, this.#value.offset());
|
|
58
|
+
if (result != constants.OPUS_OK)
|
|
65
59
|
throw new Error('Failed to set OPUS_GET_FORCE_CHANNELS');
|
|
66
60
|
return this.#value.value();
|
|
67
61
|
}
|
|
68
62
|
setMaxBandwidth(x) {
|
|
69
|
-
const result = this.#runtime.originalRuntime().
|
|
70
|
-
return result ===
|
|
63
|
+
const result = this.#runtime.originalRuntime().opus_set_max_bandwidth(this.#opusEncoderOffset, x);
|
|
64
|
+
return result === constants.OPUS_OK;
|
|
71
65
|
}
|
|
72
66
|
getMaxBandwidth() {
|
|
73
|
-
const result = this.#runtime.originalRuntime().
|
|
74
|
-
if (result !=
|
|
67
|
+
const result = this.#runtime.originalRuntime().opus_get_max_bandwidth(this.#opusEncoderOffset, this.#value.offset());
|
|
68
|
+
if (result != constants.OPUS_OK)
|
|
75
69
|
throw new Error('Failed to set OPUS_GET_MAX_BANDWIDTH');
|
|
76
70
|
return this.#value.value();
|
|
77
71
|
}
|
|
78
72
|
setBandwidth(x) {
|
|
79
|
-
const result = this.#runtime.originalRuntime().
|
|
80
|
-
return result ===
|
|
73
|
+
const result = this.#runtime.originalRuntime().opus_set_bandwidth(this.#opusEncoderOffset, x);
|
|
74
|
+
return result === constants.OPUS_OK;
|
|
81
75
|
}
|
|
82
76
|
setSignal(x) {
|
|
83
|
-
const result = this.#runtime.originalRuntime().
|
|
84
|
-
return result ===
|
|
77
|
+
const result = this.#runtime.originalRuntime().opus_set_signal(this.#opusEncoderOffset, x);
|
|
78
|
+
return result === constants.OPUS_OK;
|
|
85
79
|
}
|
|
86
80
|
getSignal() {
|
|
87
|
-
const result = this.#runtime.originalRuntime().
|
|
88
|
-
if (result !=
|
|
81
|
+
const result = this.#runtime.originalRuntime().opus_get_signal(this.#opusEncoderOffset, this.#value.offset());
|
|
82
|
+
if (result != constants.OPUS_OK)
|
|
89
83
|
throw new Error('Failed to set OPUS_GET_SIGNAL');
|
|
90
84
|
return this.#value.value();
|
|
91
85
|
}
|
|
92
86
|
setApplication(x) {
|
|
93
|
-
const result = this.#runtime.originalRuntime().
|
|
94
|
-
return result ===
|
|
87
|
+
const result = this.#runtime.originalRuntime().opus_set_application(this.#opusEncoderOffset, x);
|
|
88
|
+
return result === constants.OPUS_OK;
|
|
95
89
|
}
|
|
96
90
|
getApplication() {
|
|
97
|
-
const result = this.#runtime.originalRuntime().
|
|
98
|
-
if (result !=
|
|
91
|
+
const result = this.#runtime.originalRuntime().opus_get_application(this.#opusEncoderOffset, this.#value.offset());
|
|
92
|
+
if (result != constants.OPUS_OK)
|
|
99
93
|
throw new Error('Failed to set OPUS_GET_APPLICATION');
|
|
100
94
|
return this.#value.value();
|
|
101
95
|
}
|
|
102
96
|
getLookahead() {
|
|
103
|
-
const result = this.#runtime.originalRuntime().
|
|
104
|
-
if (result !=
|
|
97
|
+
const result = this.#runtime.originalRuntime().opus_get_lookahead(this.#opusEncoderOffset, this.#value.offset());
|
|
98
|
+
if (result != constants.OPUS_OK)
|
|
105
99
|
throw new Error('Failed to set OPUS_GET_LOOKAHEAD');
|
|
106
100
|
return this.#value.value();
|
|
107
101
|
}
|
|
108
102
|
setInbandFec(x) {
|
|
109
|
-
const result = this.#runtime.originalRuntime().
|
|
110
|
-
return result ===
|
|
103
|
+
const result = this.#runtime.originalRuntime().opus_set_inband_fec(this.#opusEncoderOffset, x);
|
|
104
|
+
return result === constants.OPUS_OK;
|
|
111
105
|
}
|
|
112
106
|
getInbandFec() {
|
|
113
|
-
const result = this.#runtime.originalRuntime().
|
|
114
|
-
if (result !=
|
|
107
|
+
const result = this.#runtime.originalRuntime().opus_get_inband_fec(this.#opusEncoderOffset, this.#value.offset());
|
|
108
|
+
if (result != constants.OPUS_OK)
|
|
115
109
|
throw new Error('Failed to set OPUS_GET_INBAND_FEC');
|
|
116
110
|
return this.#value.value();
|
|
117
111
|
}
|
|
118
112
|
setPacketLossperc(x) {
|
|
119
|
-
const result = this.#runtime.originalRuntime().
|
|
120
|
-
return result ===
|
|
113
|
+
const result = this.#runtime.originalRuntime().opus_set_packet_loss_perc(this.#opusEncoderOffset, x);
|
|
114
|
+
return result === constants.OPUS_OK;
|
|
121
115
|
}
|
|
122
116
|
getPacketLossperc() {
|
|
123
|
-
const result = this.#runtime.originalRuntime().
|
|
124
|
-
if (result !=
|
|
117
|
+
const result = this.#runtime.originalRuntime().opus_get_packet_loss_perc(this.#opusEncoderOffset, this.#value.offset());
|
|
118
|
+
if (result != constants.OPUS_OK)
|
|
125
119
|
throw new Error('Failed to set OPUS_GET_PACKET_LOSS_PERC');
|
|
126
120
|
return this.#value.value();
|
|
127
121
|
}
|
|
128
122
|
setDtx(x) {
|
|
129
|
-
const result = this.#runtime.originalRuntime().
|
|
130
|
-
return result ===
|
|
123
|
+
const result = this.#runtime.originalRuntime().opus_set_dtx(this.#opusEncoderOffset, x);
|
|
124
|
+
return result === constants.OPUS_OK;
|
|
131
125
|
}
|
|
132
126
|
getDtx() {
|
|
133
|
-
const result = this.#runtime.originalRuntime().
|
|
134
|
-
if (result !=
|
|
127
|
+
const result = this.#runtime.originalRuntime().opus_get_dtx(this.#opusEncoderOffset, this.#value.offset());
|
|
128
|
+
if (result != constants.OPUS_OK)
|
|
135
129
|
throw new Error('Failed to set OPUS_GET_DTX');
|
|
136
130
|
return this.#value.value();
|
|
137
131
|
}
|
|
138
132
|
setLsbDepth(x) {
|
|
139
|
-
const result = this.#runtime.originalRuntime().
|
|
140
|
-
return result ===
|
|
133
|
+
const result = this.#runtime.originalRuntime().opus_set_lsb_depth(this.#opusEncoderOffset, x);
|
|
134
|
+
return result === constants.OPUS_OK;
|
|
141
135
|
}
|
|
142
136
|
getLsbDepth() {
|
|
143
|
-
const result = this.#runtime.originalRuntime().
|
|
144
|
-
if (result !=
|
|
137
|
+
const result = this.#runtime.originalRuntime().opus_get_lsb_depth(this.#opusEncoderOffset, this.#value.offset());
|
|
138
|
+
if (result != constants.OPUS_OK)
|
|
145
139
|
throw new Error('Failed to set OPUS_GET_LSB_DEPTH');
|
|
146
140
|
return this.#value.value();
|
|
147
141
|
}
|
|
148
142
|
setExpertFrameduration(x) {
|
|
149
|
-
const result = this.#runtime.originalRuntime().
|
|
150
|
-
return result ===
|
|
143
|
+
const result = this.#runtime.originalRuntime().opus_set_expert_frame_duration(this.#opusEncoderOffset, x);
|
|
144
|
+
return result === constants.OPUS_OK;
|
|
151
145
|
}
|
|
152
146
|
getExpertFrameduration() {
|
|
153
|
-
const result = this.#runtime.originalRuntime().
|
|
154
|
-
if (result !=
|
|
147
|
+
const result = this.#runtime.originalRuntime().opus_get_expert_frame_duration(this.#opusEncoderOffset, this.#value.offset());
|
|
148
|
+
if (result != constants.OPUS_OK)
|
|
155
149
|
throw new Error('Failed to set OPUS_GET_EXPERT_FRAME_DURATION');
|
|
156
150
|
return this.#value.value();
|
|
157
151
|
}
|
|
158
152
|
setPredictionDisabled(x) {
|
|
159
|
-
const result = this.#runtime.originalRuntime().
|
|
160
|
-
return result ===
|
|
153
|
+
const result = this.#runtime.originalRuntime().opus_set_prediction_disabled(this.#opusEncoderOffset, x);
|
|
154
|
+
return result === constants.OPUS_OK;
|
|
161
155
|
}
|
|
162
156
|
getPredictionDisabled() {
|
|
163
|
-
const result = this.#runtime.originalRuntime().
|
|
164
|
-
if (result !=
|
|
157
|
+
const result = this.#runtime.originalRuntime().opus_get_prediction_disabled(this.#opusEncoderOffset, this.#value.offset());
|
|
158
|
+
if (result != constants.OPUS_OK)
|
|
165
159
|
throw new Error('Failed to set OPUS_GET_PREDICTION_DISABLED');
|
|
166
160
|
return this.#value.value();
|
|
167
161
|
}
|
|
168
162
|
getBandwidth() {
|
|
169
|
-
const result = this.#runtime.originalRuntime().
|
|
170
|
-
if (result !=
|
|
163
|
+
const result = this.#runtime.originalRuntime().opus_get_bandwidth(this.#opusEncoderOffset, this.#value.offset());
|
|
164
|
+
if (result != constants.OPUS_OK)
|
|
171
165
|
throw new Error('Failed to set OPUS_GET_BANDWIDTH');
|
|
172
166
|
return this.#value.value();
|
|
173
167
|
}
|
|
174
168
|
getSampleRate() {
|
|
175
|
-
const result = this.#runtime.originalRuntime().
|
|
176
|
-
if (result !=
|
|
169
|
+
const result = this.#runtime.originalRuntime().opus_get_sample_rate(this.#opusEncoderOffset, this.#value.offset());
|
|
170
|
+
if (result != constants.OPUS_OK)
|
|
177
171
|
throw new Error('Failed to set OPUS_GET_SAMPLE_RATE');
|
|
178
172
|
return this.#value.value();
|
|
179
173
|
}
|
|
180
174
|
setPhaseInversiondisabled(x) {
|
|
181
|
-
const result = this.#runtime.originalRuntime().
|
|
182
|
-
return result ===
|
|
175
|
+
const result = this.#runtime.originalRuntime().opus_set_phase_inversion_disabled(this.#opusEncoderOffset, x);
|
|
176
|
+
return result === constants.OPUS_OK;
|
|
183
177
|
}
|
|
184
178
|
getPhaseInversiondisabled() {
|
|
185
|
-
const result = this.#runtime.originalRuntime().
|
|
186
|
-
if (result !=
|
|
179
|
+
const result = this.#runtime.originalRuntime().opus_get_phase_inversion_disabled(this.#opusEncoderOffset, this.#value.offset());
|
|
180
|
+
if (result != constants.OPUS_OK)
|
|
187
181
|
throw new Error('Failed to set OPUS_GET_PHASE_INVERSION_DISABLED');
|
|
188
182
|
return this.#value.value();
|
|
189
183
|
}
|
|
190
184
|
getInDtx() {
|
|
191
|
-
const result = this.#runtime.originalRuntime().
|
|
192
|
-
if (result !=
|
|
185
|
+
const result = this.#runtime.originalRuntime().opus_get_in_dtx(this.#opusEncoderOffset, this.#value.offset());
|
|
186
|
+
if (result != constants.OPUS_OK)
|
|
193
187
|
throw new Error('Failed to set OPUS_GET_IN_DTX');
|
|
194
188
|
return this.#value.value();
|
|
195
189
|
}
|
|
196
190
|
setGain(x) {
|
|
197
|
-
const result = this.#runtime.originalRuntime().
|
|
198
|
-
return result ===
|
|
191
|
+
const result = this.#runtime.originalRuntime().opus_set_gain(this.#opusEncoderOffset, x);
|
|
192
|
+
return result === constants.OPUS_OK;
|
|
199
193
|
}
|
|
200
194
|
getGain() {
|
|
201
|
-
const result = this.#runtime.originalRuntime().
|
|
202
|
-
if (result !=
|
|
195
|
+
const result = this.#runtime.originalRuntime().opus_get_gain(this.#opusEncoderOffset, this.#value.offset());
|
|
196
|
+
if (result != constants.OPUS_OK)
|
|
203
197
|
throw new Error('Failed to set OPUS_GET_GAIN');
|
|
204
198
|
return this.#value.value();
|
|
205
199
|
}
|
|
206
200
|
getLastPacketduration() {
|
|
207
|
-
const result = this.#runtime.originalRuntime().
|
|
208
|
-
if (result !=
|
|
201
|
+
const result = this.#runtime.originalRuntime().opus_get_last_packet_duration(this.#opusEncoderOffset, this.#value.offset());
|
|
202
|
+
if (result != constants.OPUS_OK)
|
|
209
203
|
throw new Error('Failed to set OPUS_GET_LAST_PACKET_DURATION');
|
|
210
204
|
return this.#value.value();
|
|
211
205
|
}
|
|
212
206
|
getPitch() {
|
|
213
|
-
const result = this.#runtime.originalRuntime().
|
|
214
|
-
if (result !=
|
|
207
|
+
const result = this.#runtime.originalRuntime().opus_get_pitch(this.#opusEncoderOffset, this.#value.offset());
|
|
208
|
+
if (result != constants.OPUS_OK)
|
|
215
209
|
throw new Error('Failed to set OPUS_GET_PITCH');
|
|
216
210
|
return this.#value.value();
|
|
217
211
|
}
|
|
212
|
+
destroy() {
|
|
213
|
+
this.#value.destroy();
|
|
214
|
+
}
|
|
215
|
+
[Symbol.dispose]() {
|
|
216
|
+
this.destroy();
|
|
217
|
+
}
|
|
218
218
|
}
|
|
219
|
-
exports.OpusGettersAndSetters = OpusGettersAndSetters;
|
|
220
219
|
//# sourceMappingURL=OpusGettersAndSetters.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OpusGettersAndSetters.js","sourceRoot":"","sources":["OpusGettersAndSetters.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"OpusGettersAndSetters.js","sourceRoot":"","sources":["OpusGettersAndSetters.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,OAAO,EAAkB,MAAM,qBAAqB,CAAC;AACvE,OAAO,SAAS,MAAM,gBAAgB,CAAC;AACvC,MAAM,OAAO,qBAAqB;IACrB,kBAAkB,CAAC;IACn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;IAC1B,CAAC;IACD,CAAC,MAAM,CAAC,OAAO,CAAC;QACZ,IAAI,CAAC,OAAO,EAAE,CAAC;IACnB,CAAC;CACJ"}
|
package/opus/constants.d.ts
CHANGED
|
@@ -1,15 +1,4 @@
|
|
|
1
1
|
declare const constants: {
|
|
2
|
-
OPE_OK: number;
|
|
3
|
-
OPE_BAD_ARG: number;
|
|
4
|
-
OPE_INTERNAL_ERROR: number;
|
|
5
|
-
OPE_UNIMPLEMENTED: number;
|
|
6
|
-
OPE_ALLOC_FAIL: number;
|
|
7
|
-
OPE_CANNOT_OPEN: number;
|
|
8
|
-
OPE_TOO_LATE: number;
|
|
9
|
-
OPE_INVALID_PICTURE: number;
|
|
10
|
-
OPE_INVALID_ICON: number;
|
|
11
|
-
OPE_WRITE_FAIL: number;
|
|
12
|
-
OPE_CLOSE_FAIL: number;
|
|
13
2
|
OPUS_OK: number;
|
|
14
3
|
OPUS_BAD_ARG: number;
|
|
15
4
|
OPUS_BUFFER_TOO_SMALL: number;
|
package/opus/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["constants.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["constants.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+Bd,CAAC;AACF,eAAe,SAAS,CAAC"}
|
package/opus/constants.js
CHANGED
|
@@ -1,17 +1,4 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
1
|
const constants = {
|
|
4
|
-
'OPE_OK': 0,
|
|
5
|
-
'OPE_BAD_ARG': -11,
|
|
6
|
-
'OPE_INTERNAL_ERROR': -13,
|
|
7
|
-
'OPE_UNIMPLEMENTED': -15,
|
|
8
|
-
'OPE_ALLOC_FAIL': -17,
|
|
9
|
-
'OPE_CANNOT_OPEN': -30,
|
|
10
|
-
'OPE_TOO_LATE': -31,
|
|
11
|
-
'OPE_INVALID_PICTURE': -32,
|
|
12
|
-
'OPE_INVALID_ICON': -33,
|
|
13
|
-
'OPE_WRITE_FAIL': -34,
|
|
14
|
-
'OPE_CLOSE_FAIL': -35,
|
|
15
2
|
'OPUS_OK': 0,
|
|
16
3
|
'OPUS_BAD_ARG': -1,
|
|
17
4
|
'OPUS_BUFFER_TOO_SMALL': -2,
|
|
@@ -43,5 +30,5 @@ const constants = {
|
|
|
43
30
|
'OPUS_FRAMESIZE_100_MS': 5008,
|
|
44
31
|
'OPUS_FRAMESIZE_120_MS': 5009,
|
|
45
32
|
};
|
|
46
|
-
|
|
33
|
+
export default constants;
|
|
47
34
|
//# sourceMappingURL=constants.js.map
|
package/opus/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["constants.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["constants.ts"],"names":[],"mappings":"AAAA,MAAM,SAAS,GAAG;IACd,SAAS,EAAE,CAAC;IACZ,cAAc,EAAE,CAAC,CAAC;IAClB,uBAAuB,EAAE,CAAC,CAAC;IAC3B,qBAAqB,EAAE,CAAC,CAAC;IACzB,qBAAqB,EAAE,CAAC,CAAC;IACzB,oBAAoB,EAAE,CAAC,CAAC;IACxB,oBAAoB,EAAE,CAAC,CAAC;IACxB,iBAAiB,EAAE,CAAC,CAAC;IACrB,WAAW,EAAE,CAAC,IAAI;IAClB,kBAAkB,EAAE,CAAC,CAAC;IACtB,uBAAuB,EAAE,IAAI;IAC7B,wBAAwB,EAAE,IAAI;IAC9B,sCAAsC,EAAE,IAAI;IAC5C,mBAAmB,EAAE,IAAI;IACzB,mBAAmB,EAAE,IAAI;IACzB,2BAA2B,EAAE,IAAI;IACjC,2BAA2B,EAAE,IAAI;IACjC,yBAAyB,EAAE,IAAI;IAC/B,8BAA8B,EAAE,IAAI;IACpC,yBAAyB,EAAE,IAAI;IAC/B,oBAAoB,EAAE,IAAI;IAC1B,uBAAuB,EAAE,IAAI;IAC7B,qBAAqB,EAAE,IAAI;IAC3B,sBAAsB,EAAE,IAAI;IAC5B,sBAAsB,EAAE,IAAI;IAC5B,sBAAsB,EAAE,IAAI;IAC5B,sBAAsB,EAAE,IAAI;IAC5B,sBAAsB,EAAE,IAAI;IAC5B,uBAAuB,EAAE,IAAI;IAC7B,uBAAuB,EAAE,IAAI;CAChC,CAAC;AACF,eAAe,SAAS,CAAC"}
|
package/opus/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
export { default as Encoder } from './Encoder';
|
|
2
|
-
export { default as Decoder } from './Decoder';
|
|
3
|
-
export { default as
|
|
4
|
-
export { default as constants } from './constants';
|
|
1
|
+
export { default as Encoder } from './Encoder.js';
|
|
2
|
+
export { default as Decoder } from './Decoder.js';
|
|
3
|
+
export { default as constants } from './constants.js';
|
|
5
4
|
//# sourceMappingURL=index.d.ts.map
|
package/opus/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["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,SAAS,EAAE,MAAM,gBAAgB,CAAC"}
|
package/opus/index.js
CHANGED
|
@@ -1,15 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.constants = exports.RingBuffer = exports.Decoder = exports.Encoder = void 0;
|
|
7
|
-
var Encoder_1 = require("./Encoder");
|
|
8
|
-
Object.defineProperty(exports, "Encoder", { enumerable: true, get: function () { return __importDefault(Encoder_1).default; } });
|
|
9
|
-
var Decoder_1 = require("./Decoder");
|
|
10
|
-
Object.defineProperty(exports, "Decoder", { enumerable: true, get: function () { return __importDefault(Decoder_1).default; } });
|
|
11
|
-
var RingBuffer_1 = require("./RingBuffer");
|
|
12
|
-
Object.defineProperty(exports, "RingBuffer", { enumerable: true, get: function () { return __importDefault(RingBuffer_1).default; } });
|
|
13
|
-
var constants_1 = require("./constants");
|
|
14
|
-
Object.defineProperty(exports, "constants", { enumerable: true, get: function () { return __importDefault(constants_1).default; } });
|
|
1
|
+
export { default as Encoder } from './Encoder.js';
|
|
2
|
+
export { default as Decoder } from './Decoder.js';
|
|
3
|
+
export { default as constants } from './constants.js';
|
|
15
4
|
//# sourceMappingURL=index.js.map
|
package/opus/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["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,SAAS,EAAE,MAAM,gBAAgB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,54 +1,56 @@
|
|
|
1
1
|
{
|
|
2
2
|
"devDependencies": {
|
|
3
|
-
"@
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
3
|
+
"@high-nodejs/child_process": "^0.3.4",
|
|
4
|
+
"@textstream/core": "^0.3.1",
|
|
5
|
+
"@types/audioworklet": "^0.0.92",
|
|
6
|
+
"@types/node": "^24.10.8",
|
|
7
|
+
"c8": "^10.1.3",
|
|
8
|
+
"cli-argument-helper": "^2.3.0",
|
|
9
|
+
"eslint": "^8.57.1",
|
|
8
10
|
"package-utilities": "0.x",
|
|
9
|
-
"prettier": "
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"typescript": "5.
|
|
13
|
-
"webpack": "5.
|
|
14
|
-
"webpack-cli": "5.
|
|
11
|
+
"prettier": "^3.8.0",
|
|
12
|
+
"ringbud": "^1.0.23",
|
|
13
|
+
"tsx": "^4.21.0",
|
|
14
|
+
"typescript": "^5.9.3",
|
|
15
|
+
"webpack": "^5.104.1",
|
|
16
|
+
"webpack-cli": "^5.1.4"
|
|
15
17
|
},
|
|
18
|
+
"type": "module",
|
|
16
19
|
"name": "opus-codec",
|
|
17
|
-
"version": "
|
|
20
|
+
"version": "1.0.3",
|
|
18
21
|
"license": "MIT",
|
|
19
22
|
"files": [
|
|
20
23
|
"{native,runtime,opus,es}/**/*.{d.ts,js,map,wasm}"
|
|
21
24
|
],
|
|
22
25
|
"scripts": {
|
|
23
26
|
"build": "npx tsc -b test --force",
|
|
24
|
-
"build:es:opus": "npx tsc --project opus --module
|
|
25
|
-
"build:es:actions": "npx tsc --project actions --module
|
|
26
|
-
"build:es:runtime": "npx tsc --project runtime --module
|
|
27
|
-
"build:all": "
|
|
28
|
-
"prepublishOnly": "
|
|
27
|
+
"build:es:opus": "npx tsc --project opus --module NodeNext --outDir es",
|
|
28
|
+
"build:es:actions": "npx tsc --project actions --module NodeNext --outDir es",
|
|
29
|
+
"build:es:runtime": "npx tsc --project runtime --module NodeNext --outDir es",
|
|
30
|
+
"build:all": "npm run build && npm run build:es:opus && npm run build:es:runtime && npm run build:es:actions",
|
|
31
|
+
"prepublishOnly": "npm run build:all && npm run set-es-paths",
|
|
29
32
|
"set-es-paths": "npx package-utilities --set-es-paths --es-folder es --include \"{opus,runtime,actions}/**/*.js\"",
|
|
30
|
-
"test": "npx
|
|
33
|
+
"test": "npx tsx --test test",
|
|
34
|
+
"test:coverage": "npx c8 --reporter=text --reporter=html npm run test"
|
|
31
35
|
},
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
36
|
+
"repository": {
|
|
37
|
+
"type": "git",
|
|
38
|
+
"url": "git+https://github.com/VictorQueiroz/js-opus-codec"
|
|
35
39
|
},
|
|
36
40
|
"browser": {
|
|
37
|
-
"./actions/opus.js": "./es/actions/opus.js",
|
|
38
|
-
"./actions/index.js": "./es/actions/index.js",
|
|
39
|
-
"./actions/actions.js": "./es/actions/actions.js",
|
|
40
|
-
"./actions/Client.js": "./es/actions/Client.js",
|
|
41
41
|
"./opus/index.js": "./es/opus/index.js",
|
|
42
42
|
"./opus/constants.js": "./es/opus/constants.js",
|
|
43
|
-
"./opus/RingBuffer.js": "./es/opus/RingBuffer.js",
|
|
44
43
|
"./opus/OpusGettersAndSetters.js": "./es/opus/OpusGettersAndSetters.js",
|
|
45
44
|
"./opus/Encoder.js": "./es/opus/Encoder.js",
|
|
46
45
|
"./opus/Decoder.js": "./es/opus/Decoder.js",
|
|
47
46
|
"./runtime/index.js": "./es/runtime/index.js",
|
|
48
|
-
"./runtime/RuntimeString.js": "./es/runtime/RuntimeString.js",
|
|
49
47
|
"./runtime/Runtime.js": "./es/runtime/Runtime.js",
|
|
50
48
|
"./runtime/ResourcesHolder.js": "./es/runtime/ResourcesHolder.js",
|
|
51
49
|
"./runtime/Integer.js": "./es/runtime/Integer.js",
|
|
52
|
-
"./runtime/Buffer.js": "./es/runtime/Buffer.js"
|
|
50
|
+
"./runtime/Buffer.js": "./es/runtime/Buffer.js",
|
|
51
|
+
"./actions/opus.js": "./es/actions/opus.js",
|
|
52
|
+
"./actions/index.js": "./es/actions/index.js",
|
|
53
|
+
"./actions/actions.js": "./es/actions/actions.js",
|
|
54
|
+
"./actions/Client.js": "./es/actions/Client.js"
|
|
53
55
|
}
|
|
54
56
|
}
|
package/runtime/Buffer.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { IResource } from
|
|
2
|
-
import Runtime from
|
|
1
|
+
import { IResource } from './ResourcesHolder.js';
|
|
2
|
+
import Runtime from './Runtime.js';
|
|
3
3
|
export default class Buffer implements IResource {
|
|
4
4
|
#private;
|
|
5
5
|
constructor(runtime: Runtime, size: number);
|
|
6
6
|
offset(): number;
|
|
7
|
-
data(): Uint8Array
|
|
7
|
+
data(): Uint8Array<ArrayBuffer>;
|
|
8
8
|
size(): number;
|
|
9
9
|
destroy(): void;
|
|
10
|
+
[Symbol.dispose](): void;
|
|
10
11
|
}
|
|
11
12
|
//# sourceMappingURL=Buffer.d.ts.map
|
package/runtime/Buffer.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Buffer.d.ts","sourceRoot":"","sources":["Buffer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"Buffer.d.ts","sourceRoot":"","sources":["Buffer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,OAAO,MAAM,cAAc,CAAC;AAEnC,MAAM,CAAC,OAAO,OAAO,MAAO,YAAW,SAAS;;gBAIzB,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM;IAK1C,MAAM;IAGN,IAAI;IAGJ,IAAI;IAGJ,OAAO;IAId,CAAC,MAAM,CAAC,OAAO,CAAC;CAGnB"}
|
package/runtime/Buffer.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
class Buffer {
|
|
1
|
+
export default class Buffer {
|
|
4
2
|
#offset;
|
|
5
3
|
#size;
|
|
6
4
|
#runtime;
|
|
@@ -22,6 +20,8 @@ class Buffer {
|
|
|
22
20
|
this.#runtime.free(this.#offset);
|
|
23
21
|
this.#offset = 0;
|
|
24
22
|
}
|
|
23
|
+
[Symbol.dispose]() {
|
|
24
|
+
this.destroy();
|
|
25
|
+
}
|
|
25
26
|
}
|
|
26
|
-
exports.default = Buffer;
|
|
27
27
|
//# sourceMappingURL=Buffer.js.map
|
package/runtime/Buffer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Buffer.js","sourceRoot":"","sources":["Buffer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Buffer.js","sourceRoot":"","sources":["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;IACD,CAAC,MAAM,CAAC,OAAO,CAAC;QACZ,IAAI,CAAC,OAAO,EAAE,CAAC;IACnB,CAAC;CACJ"}
|
package/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
|
package/runtime/Integer.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Integer.d.ts","sourceRoot":"","sources":["Integer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"Integer.d.ts","sourceRoot":"","sources":["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;IAON,OAAO;IAKd,CAAC,MAAM,CAAC,OAAO,CAAC;CAGnB"}
|