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/native/opus/README.draft
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
To build this source code, simply type:
|
|
2
|
-
|
|
3
|
-
% make
|
|
4
|
-
|
|
5
|
-
If this does not work, or if you want to change the default configuration
|
|
6
|
-
(e.g., to compile for a fixed-point architecture), simply edit the options
|
|
7
|
-
in the Makefile.
|
|
8
|
-
|
|
9
|
-
An up-to-date implementation conforming to this standard is available in a
|
|
10
|
-
Git repository at https://gitlab.xiph.org/xiph/opus.git or on a website at:
|
|
11
|
-
https://opus-codec.org/
|
|
12
|
-
However, although that implementation is expected to remain conformant
|
|
13
|
-
with the standard, it is the code in this RFC that shall remain normative.
|
|
14
|
-
To build from the git repository instead of using this RFC, follow these
|
|
15
|
-
steps:
|
|
16
|
-
|
|
17
|
-
1) Clone the repository (latest implementation of this standard at the time
|
|
18
|
-
of publication)
|
|
19
|
-
|
|
20
|
-
% git clone https://gitlab.xiph.org/xiph/opus.git
|
|
21
|
-
% cd opus
|
|
22
|
-
|
|
23
|
-
2) Compile
|
|
24
|
-
|
|
25
|
-
% ./autogen.sh
|
|
26
|
-
% ./configure
|
|
27
|
-
% make
|
|
28
|
-
|
|
29
|
-
Once you have compiled the codec, there will be a opus_demo executable in
|
|
30
|
-
the top directory.
|
|
31
|
-
|
|
32
|
-
Usage: opus_demo [-e] <application> <sampling rate (Hz)> <channels (1/2)>
|
|
33
|
-
<bits per second> [options] <input> <output>
|
|
34
|
-
opus_demo -d <sampling rate (Hz)> <channels (1/2)> [options]
|
|
35
|
-
<input> <output>
|
|
36
|
-
|
|
37
|
-
mode: voip | audio | restricted-lowdelay
|
|
38
|
-
options:
|
|
39
|
-
-e : only runs the encoder (output the bit-stream)
|
|
40
|
-
-d : only runs the decoder (reads the bit-stream as input)
|
|
41
|
-
-cbr : enable constant bitrate; default: variable bitrate
|
|
42
|
-
-cvbr : enable constrained variable bitrate; default: unconstrained
|
|
43
|
-
-bandwidth <NB|MB|WB|SWB|FB> : audio bandwidth (from narrowband to fullband);
|
|
44
|
-
default: sampling rate
|
|
45
|
-
-framesize <2.5|5|10|20|40|60> : frame size in ms; default: 20
|
|
46
|
-
-max_payload <bytes> : maximum payload size in bytes, default: 1024
|
|
47
|
-
-complexity <comp> : complexity, 0 (lowest) ... 10 (highest); default: 10
|
|
48
|
-
-inbandfec : enable SILK inband FEC
|
|
49
|
-
-forcemono : force mono encoding, even for stereo input
|
|
50
|
-
-dtx : enable SILK DTX
|
|
51
|
-
-loss <perc> : simulate packet loss, in percent (0-100); default: 0
|
|
52
|
-
|
|
53
|
-
input and output are little endian signed 16-bit PCM files or opus bitstreams
|
|
54
|
-
with simple opus_demo proprietary framing.
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
Copyright 2002-2008 Xiph.org Foundation
|
|
2
|
-
Copyright 2002-2008 Jean-Marc Valin
|
|
3
|
-
Copyright 2005-2007 Analog Devices Inc.
|
|
4
|
-
Copyright 2005-2008 Commonwealth Scientific and Industrial Research
|
|
5
|
-
Organisation (CSIRO)
|
|
6
|
-
Copyright 1993, 2002, 2006 David Rowe
|
|
7
|
-
Copyright 2003 EpicGames
|
|
8
|
-
Copyright 1992-1994 Jutta Degener, Carsten Bormann
|
|
9
|
-
|
|
10
|
-
Redistribution and use in source and binary forms, with or without
|
|
11
|
-
modification, are permitted provided that the following conditions
|
|
12
|
-
are met:
|
|
13
|
-
|
|
14
|
-
- Redistributions of source code must retain the above copyright
|
|
15
|
-
notice, this list of conditions and the following disclaimer.
|
|
16
|
-
|
|
17
|
-
- Redistributions in binary form must reproduce the above copyright
|
|
18
|
-
notice, this list of conditions and the following disclaimer in the
|
|
19
|
-
documentation and/or other materials provided with the distribution.
|
|
20
|
-
|
|
21
|
-
- Neither the name of the Xiph.org Foundation nor the names of its
|
|
22
|
-
contributors may be used to endorse or promote products derived from
|
|
23
|
-
this software without specific prior written permission.
|
|
24
|
-
|
|
25
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
26
|
-
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
27
|
-
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
28
|
-
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
|
|
29
|
-
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
30
|
-
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
31
|
-
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
|
32
|
-
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
|
33
|
-
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
|
34
|
-
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
35
|
-
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
################# REMOVE warnings on trimedia compiler ##############################
|
|
2
|
-
################# Not critical to compilation ##############################
|
|
3
|
-
|
|
4
|
-
1. Change the following statements to remove warning for constant expression
|
|
5
|
-
(i) mdf.c [if(0) --> #if 0]
|
|
6
|
-
(ii) preprocess.c [if(1) --> #if 1]
|
|
7
|
-
|
|
8
|
-
2. add REMARK_ON macro to remove warning on not reference variable
|
|
9
|
-
-- uses (void)<variable> to remove warning on not referenced variable
|
|
10
|
-
-- #define REMARK_ON
|
|
11
|
-
-- (void)<variable>
|
|
12
|
-
-- #endif
|
|
13
|
-
-- search for REMARK_ON on the following files
|
|
14
|
-
(i) jitter.c
|
|
15
|
-
(ii) mdf.c
|
|
16
|
-
(iii) filterbank.c
|
|
17
|
-
(iv) preprocess.c
|
|
18
|
-
|
|
19
|
-
3. commented out the following in pseudofloat.h for unused variable
|
|
20
|
-
//static const spx_float_t FLOAT_HALF = {16384,-15};
|
|
21
|
-
|
|
22
|
-
################# Patches for trimedia compiler ##############################
|
|
23
|
-
################# Critical to compilation ##############################
|
|
24
|
-
|
|
25
|
-
-- added the #elif defined (TM_ASM) to the following files for optimized codes
|
|
26
|
-
(1) arch.h
|
|
27
|
-
(2) fftwrap.c
|
|
28
|
-
(3) filterbank.c
|
|
29
|
-
(4) kiss_fft.c
|
|
30
|
-
(5) kiss_fftr.c
|
|
31
|
-
(6) mdf.c
|
|
32
|
-
(7) preprocess.c
|
|
33
|
-
|
|
34
|
-
-- added macro PREPROCESS_MDF_FLOAT to allow using of floating point
|
|
35
|
-
-- in mdf and preprocess while keeping fixed point in encoder/decoder
|
|
36
|
-
-- This is due to the fact that preprocess/mdf run faster on floating
|
|
37
|
-
-- point on trimedia
|
|
38
|
-
-- added the following 3 lines to the files below
|
|
39
|
-
#ifdef PREPROCESS_MDF_FLOAT
|
|
40
|
-
#undef FIXED_POINT
|
|
41
|
-
#endif
|
|
42
|
-
(1) mdf.c
|
|
43
|
-
(2) preprocess.c
|
|
44
|
-
(3) filterbank.c
|
|
45
|
-
(4) fftwrap.c
|
|
46
|
-
(5) kiss_fft.c
|
|
47
|
-
(6) kiss_fftr.c
|
|
48
|
-
|
|
49
|
-
-- created a new USE_COMPACT_KISS_FFT for fftwrap.c and shifted defination
|
|
50
|
-
-- to config file so that user configure the usage of fft on config.h
|
|
51
|
-
-- TOEXPLORE:is it possible to share table between mdf/preprocess?
|
|
52
|
-
-- Introducing this macro made the following changes in C code
|
|
53
|
-
-- New macro to facilitate integration
|
|
54
|
-
(grouping real/complex for dc and nyquist frequency seems to require a large
|
|
55
|
-
amount of memory for mdf, therefore did not made the changes for that)
|
|
56
|
-
(1) modify preprocess.c on init and destroy
|
|
57
|
-
(2) modify mdf.c on init and destroy
|
|
58
|
-
(3) shifted power_spectrum to fftwrap.c to share optimised code between
|
|
59
|
-
preprocess.c and mdf.c
|
|
60
|
-
|
|
61
|
-
################# NOTES ##############################
|
|
62
|
-
(1) fixed point encoding/decoding is tested on narrowband
|
|
63
|
-
- some of the QX fractions are packed together to
|
|
64
|
-
(frac1 * a + frac2 * a) >> X (should be more accurate in rounding)
|
|
65
|
-
instead of
|
|
66
|
-
((frac1 * a) >> X) + ((frac2 * a) >> X)
|
|
67
|
-
will cause some different between optimized and unoptimized code.
|
|
68
|
-
tried decoding/encoding optimized code on some audio files retains
|
|
69
|
-
the clearity of the word
|
|
70
|
-
|
|
71
|
-
- wideband/ultrawideband is not heavily tested yet
|
|
72
|
-
|
|
73
|
-
(2) optimized fixed point code requires memory alignment
|
|
74
|
-
- used config to debug on functions where memory is not align
|
|
75
|
-
|
|
76
|
-
(3) floating point optimization for preprocess/mdf is tested
|
|
77
|
-
fixed point is not tested yet (except fft/filterbank)
|
|
78
|
-
Note (1) also applies to sround in fft for fixed point
|
|
79
|
-
some optimization is provided for fixed point as it requires lesser
|
|
80
|
-
memory compared to floating point.
|
|
81
|
-
|
|
82
|
-
(4) unroll configurations provided to reduce code size if required
|
|
83
|
-
|
|
84
|
-
(5) use profile options only if compiler profiling fails to work
|
|
85
|
-
|
|
86
|
-
(6) can't include the makefile as it is close proprietary
|
|
87
|
-
|
|
88
|
-
################# TODO:For Trimedia ##############################
|
|
89
|
-
(1) Optimizations for fixed point in mdf/preprocess
|
|
90
|
-
|
|
91
|
-
################# Added Files ##############################
|
|
92
|
-
- _kiss_fft_guts_tm.h
|
|
93
|
-
- fftwrap_tm.h
|
|
94
|
-
- filterbank_tm.h
|
|
95
|
-
- filters_tm.h
|
|
96
|
-
- fixed_tm.h
|
|
97
|
-
- kiss_fft_tm.h
|
|
98
|
-
- kiss_fftr_tm.h
|
|
99
|
-
- mdf_tm.h
|
|
100
|
-
- misc_tm.h
|
|
101
|
-
- preprocess_tm.h
|
|
102
|
-
- config.h
|
|
103
|
-
- speex_config_types.h
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
SpeexDSP has been ported to the Blackfin DSP, for the STAMP development board.
|
|
2
|
-
|
|
3
|
-
This port has been tested on the STAMP development board and requires the
|
|
4
|
-
toolchain available at http://blackfin.uclinux.org/
|
|
5
|
-
|
|
6
|
-
1/ In order to cross-compile for uClinux from the SpeexDSP tarball:
|
|
7
|
-
|
|
8
|
-
./configure --enable-blackfin-asm --enable-fixed-point --host=bfin-uclinux
|
|
9
|
-
cd libspeexdsp
|
|
10
|
-
make
|
|
11
|
-
|
|
12
|
-
The --enable-blackfin-asm option is not required, but it speeds up Speex by
|
|
13
|
-
approximately a factor of two.
|
|
14
|
-
|
|
15
|
-
2/ In order to cross-compile for uClinux from the SpeexDSP git:
|
|
16
|
-
|
|
17
|
-
git clone git://git.xiph.org/speexdsp.git
|
|
18
|
-
cd speexdsp
|
|
19
|
-
./autogen.sh
|
|
20
|
-
./configure --enable-blackfin-asm --enable-fixed-point --host=bfin-uclinux
|
|
21
|
-
cd libspeexdsp
|
|
22
|
-
make
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
Win32 Specific options
|
|
2
|
-
|
|
3
|
-
In order to enable the following options within SpeexDSP, you will need to manually edit the project options for the appropriate VC configuration. These macros can be specified by adding them as "Preprocessor Definitions" under the appropriate Configuration's project options. If you don't know how to do this, please check your Visual C documentation.
|
|
4
|
-
|
|
5
|
-
Feature:
|
|
6
|
-
|
|
7
|
-
Intel Streaming SIMD Extensions - SSE - macro: USE_SSE
|
|
8
|
-
Fixed point - macro: FIXED_POINT
|
|
9
|
-
Epic 48 - macro: EPIC_48K
|
|
10
|
-
|
|
11
|
-
Note: USE_SSE and FIXED_POINT are mutually exclusive.
|
package/opus/RingBuffer.d.ts
DELETED
package/opus/RingBuffer.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RingBuffer.d.ts","sourceRoot":"","sources":["RingBuffer.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,OAAO,UAAU;;gBAKR,SAAS,EAAE,MAAM;IAS7B,KAAK,CAAC,KAAK,EAAE,YAAY;IAKzB,KAAK;IAQL,IAAI,IAAI,YAAY,GAAG,IAAI;CAqCrC"}
|
package/opus/RingBuffer.js
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
class RingBuffer {
|
|
4
|
-
#arrayBuffer;
|
|
5
|
-
#readOffset;
|
|
6
|
-
#writeOffset;
|
|
7
|
-
#frameSize;
|
|
8
|
-
constructor(frameSize) {
|
|
9
|
-
this.#readOffset = 0;
|
|
10
|
-
this.#writeOffset = 0;
|
|
11
|
-
this.#arrayBuffer = new ArrayBuffer(this.#initialSize());
|
|
12
|
-
this.#frameSize = frameSize;
|
|
13
|
-
}
|
|
14
|
-
#view() {
|
|
15
|
-
return new Float32Array(this.#arrayBuffer);
|
|
16
|
-
}
|
|
17
|
-
write(value) {
|
|
18
|
-
this.#maybeReallocate(value.length);
|
|
19
|
-
this.#view().set(value, this.#writeOffset);
|
|
20
|
-
this.#writeOffset += value.length;
|
|
21
|
-
}
|
|
22
|
-
drain() {
|
|
23
|
-
const remainingSampleCount = this.#writeOffset - this.#readOffset;
|
|
24
|
-
return this.#read(remainingSampleCount >= this.#frameSize
|
|
25
|
-
? this.#frameSize
|
|
26
|
-
: remainingSampleCount);
|
|
27
|
-
}
|
|
28
|
-
read() {
|
|
29
|
-
return this.#read(this.#frameSize);
|
|
30
|
-
}
|
|
31
|
-
#read(sampleCount) {
|
|
32
|
-
if (!sampleCount) {
|
|
33
|
-
return null;
|
|
34
|
-
}
|
|
35
|
-
const remainingBytes = this.#writeOffset - this.#readOffset;
|
|
36
|
-
if (remainingBytes >= sampleCount) {
|
|
37
|
-
const view = this.#view().subarray(this.#readOffset, this.#readOffset + sampleCount);
|
|
38
|
-
this.#readOffset += sampleCount;
|
|
39
|
-
if (this.#readOffset >= this.#writeOffset) {
|
|
40
|
-
this.#writeOffset = 0;
|
|
41
|
-
this.#readOffset = 0;
|
|
42
|
-
}
|
|
43
|
-
return view;
|
|
44
|
-
}
|
|
45
|
-
return null;
|
|
46
|
-
}
|
|
47
|
-
#maybeReallocate(samples) {
|
|
48
|
-
const sampleCountInBytes = samples * Float32Array.BYTES_PER_ELEMENT;
|
|
49
|
-
if (this.#view().length - this.#writeOffset <= samples) {
|
|
50
|
-
const oldArrayBuffer = this.#arrayBuffer;
|
|
51
|
-
this.#arrayBuffer = new ArrayBuffer(oldArrayBuffer.byteLength +
|
|
52
|
-
sampleCountInBytes +
|
|
53
|
-
this.#initialSize());
|
|
54
|
-
this.#view().set(new Float32Array(oldArrayBuffer));
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
#initialSize() {
|
|
58
|
-
return this.#frameSize * Float32Array.BYTES_PER_ELEMENT * 2;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
exports.default = RingBuffer;
|
|
62
|
-
//# sourceMappingURL=RingBuffer.js.map
|
package/opus/RingBuffer.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RingBuffer.js","sourceRoot":"","sources":["RingBuffer.ts"],"names":[],"mappings":";;AAAA,MAAqB,UAAU;IAC3B,YAAY,CAAC;IACb,WAAW,CAAC;IACZ,YAAY,CAAC;IACb,UAAU,CAAC;IACX,YAAmB,SAAiB;QAChC,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC;QACrB,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC;QACtB,IAAI,CAAC,YAAY,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC;QACzD,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;IAChC,CAAC;IACD,KAAK;QACD,OAAO,IAAI,YAAY,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAC/C,CAAC;IACM,KAAK,CAAC,KAAmB;QAC5B,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QACpC,IAAI,CAAC,KAAK,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;QAC3C,IAAI,CAAC,YAAY,IAAI,KAAK,CAAC,MAAM,CAAC;IACtC,CAAC;IACM,KAAK;QACR,MAAM,oBAAoB,GAAG,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,WAAW,CAAC;QAClE,OAAO,IAAI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Ac,CAAC,CAAC,CAAC;SACtD;IACL,CAAC;IACD,YAAY;QACR,OAAO,IAAI,CAAC,UAAU,GAAG,YAAY,CAAC,iBAAiB,GAAG,CAAC,CAAC;IAChE,CAAC;CACJ;AAhED,6BAgEC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RuntimeString.d.ts","sourceRoot":"","sources":["RuntimeString.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,WAAW,CAAC;AAEhC,MAAM,CAAC,OAAO,OAAO,aAAa;;gBAMX,OAAO,EAAE,OAAO;IAI5B,GAAG,CAAC,KAAK,EAAE,UAAU;IAqBrB,MAAM;IAGN,IAAI,IAAI,UAAU,GAAG,IAAI;CAWnC"}
|
package/runtime/RuntimeString.js
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
class RuntimeString {
|
|
4
|
-
#runtime;
|
|
5
|
-
#value;
|
|
6
|
-
constructor(runtime) {
|
|
7
|
-
this.#runtime = runtime;
|
|
8
|
-
this.#value = null;
|
|
9
|
-
}
|
|
10
|
-
set(value) {
|
|
11
|
-
if (this.#value === null || this.#value.size - 1 < value.byteLength) {
|
|
12
|
-
if (this.#value !== null) {
|
|
13
|
-
this.#runtime.free(this.#value.offset);
|
|
14
|
-
this.#value = null;
|
|
15
|
-
}
|
|
16
|
-
this.#value = {
|
|
17
|
-
offset: this.#runtime.malloc(value.byteLength),
|
|
18
|
-
size: (value.byteLength + 1) * 2,
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
const view = this.#runtime
|
|
22
|
-
.originalRuntime()
|
|
23
|
-
.HEAPU8.subarray(this.#value.offset, this.#value.offset + value.byteLength + 1);
|
|
24
|
-
view.set(value);
|
|
25
|
-
view[view.byteLength - 1] = 0;
|
|
26
|
-
return this.#value.offset;
|
|
27
|
-
}
|
|
28
|
-
offset() {
|
|
29
|
-
return this.#value?.offset ?? null;
|
|
30
|
-
}
|
|
31
|
-
read() {
|
|
32
|
-
if (this.#value === null)
|
|
33
|
-
return null;
|
|
34
|
-
const view = this.#runtime
|
|
35
|
-
.originalRuntime()
|
|
36
|
-
.HEAPU8.subarray(this.#value.offset);
|
|
37
|
-
let i = 0;
|
|
38
|
-
while (i < view.byteLength && view[i] !== 0) {
|
|
39
|
-
i++;
|
|
40
|
-
}
|
|
41
|
-
return view.subarray(0, i);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
exports.default = RuntimeString;
|
|
45
|
-
//# sourceMappingURL=RuntimeString.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RuntimeString.js","sourceRoot":"","sources":["RuntimeString.ts"],"names":[],"mappings":";;AAEA,MAAqB,aAAa;IACrB,QAAQ,CAAU;IAC3B,MAAM,CAGG;IACT,YAAmB,OAAgB;QAC/B,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;IACvB,CAAC;IACM,GAAG,CAAC,KAAiB;QACxB,IAAI,IAAI,CAAC,MAAM,KAAK,IAAI,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,GAAG,CAAC,GAAG,KAAK,CAAC,UAAU,EAAE;YACjE,IAAI,IAAI,CAAC,MAAM,KAAK,IAAI,EAAE;gBACtB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;gBACvC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;aACtB;YACD,IAAI,CAAC,MAAM,GAAG;gBACV,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC;gBAC9C,IAAI,EAAE,CAAC,KAAK,CAAC,UAAU,GAAG,CAAC,CAAC,GAAG,CAAC;aACnC,CAAC;SACL;QACD,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ;aAC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