lanczos-resampler 0.2.0 → 0.2.2
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/README.md +9 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
# Lanczos resampler
|
|
2
2
|
|
|
3
|
-
[](https://crates.io/crates/lanczos-resampler)
|
|
4
|
+
[](https://docs.rs/lanczos-resampler)
|
|
5
|
+
[](https://www.npmjs.com/package/lanczos-resampler)
|
|
6
|
+
[](https://igankevich.github.io/lanczos-resampler/)
|
|
7
|
+
|
|
6
8
|
|
|
7
9
|
An audio resampler that uses [Lanczos filter](https://en.wikipedia.org/wiki/Lanczos_resampling)
|
|
8
10
|
as an alternative to traditional windowed sinc filters.
|
|
@@ -109,8 +111,8 @@ const resampler = new ChunkedResampler(44100, 48000);
|
|
|
109
111
|
const input = new Float32Array(1024);
|
|
110
112
|
input.fill(0.1);
|
|
111
113
|
const output = new Float32Array(resampler.maxNumOutputFrames(input.length));
|
|
112
|
-
const
|
|
113
|
-
assert.equal(input.length,
|
|
114
|
+
const { numRead, numWritten } = resampler.resample(input, output);
|
|
115
|
+
assert.equal(input.length, numRead);
|
|
114
116
|
```
|
|
115
117
|
|
|
116
118
|
#### Resampling the whole audio track
|
|
@@ -123,8 +125,8 @@ input.fill(0.1);
|
|
|
123
125
|
const outputLen = numOutputFrames(1024, 44100, 48000);
|
|
124
126
|
const output = new Float32Array(outputLen);
|
|
125
127
|
const resampler = new WholeResampler();
|
|
126
|
-
const
|
|
127
|
-
assert.equal(input.length,
|
|
128
|
+
const { numRead, numWritten } = resampler.resampleInto(input, output);
|
|
129
|
+
assert.equal(input.length, numRead);
|
|
128
130
|
console.log(output)
|
|
129
131
|
```
|
|
130
132
|
|