@buffered-audio/nodes 0.18.0 → 0.18.1
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/dist/index.js +13 -3
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -29822,6 +29822,7 @@ var BufferedSourceStream = class extends BufferedStream {
|
|
|
29822
29822
|
constructor() {
|
|
29823
29823
|
super(...arguments);
|
|
29824
29824
|
this.framesRead = 0;
|
|
29825
|
+
this.processingMs = 0;
|
|
29825
29826
|
this.hasStarted = false;
|
|
29826
29827
|
}
|
|
29827
29828
|
setup(context) {
|
|
@@ -29831,6 +29832,7 @@ var BufferedSourceStream = class extends BufferedStream {
|
|
|
29831
29832
|
async _setup(context) {
|
|
29832
29833
|
let done = false;
|
|
29833
29834
|
this.framesRead = 0;
|
|
29835
|
+
this.processingMs = 0;
|
|
29834
29836
|
this.hasStarted = false;
|
|
29835
29837
|
const { signal, durationFrames: sourceTotalFrames, highWaterMark } = context;
|
|
29836
29838
|
return new ReadableStream(
|
|
@@ -29848,11 +29850,13 @@ var BufferedSourceStream = class extends BufferedStream {
|
|
|
29848
29850
|
this.hasStarted = true;
|
|
29849
29851
|
this.emitStarted();
|
|
29850
29852
|
}
|
|
29853
|
+
const start = performance.now();
|
|
29851
29854
|
const chunk = await this._read();
|
|
29855
|
+
this.processingMs += performance.now() - start;
|
|
29852
29856
|
if (!chunk) {
|
|
29853
29857
|
done = true;
|
|
29854
29858
|
this.emitProgress("read", this.framesRead, sourceTotalFrames, { force: true });
|
|
29855
|
-
this.emitFinished({ framesDone: this.framesRead });
|
|
29859
|
+
this.emitFinished({ framesDone: this.framesRead, processingMs: this.processingMs });
|
|
29856
29860
|
await this.destroy();
|
|
29857
29861
|
controller.close();
|
|
29858
29862
|
return;
|
|
@@ -29892,6 +29896,7 @@ var BufferedTargetStream = class extends BufferedStream {
|
|
|
29892
29896
|
super(...arguments);
|
|
29893
29897
|
this.hasStarted = false;
|
|
29894
29898
|
this.framesWritten = 0;
|
|
29899
|
+
this.processingMs = 0;
|
|
29895
29900
|
}
|
|
29896
29901
|
setup(readable, context) {
|
|
29897
29902
|
this.sourceTotalFrames = context.durationFrames;
|
|
@@ -29903,20 +29908,25 @@ var BufferedTargetStream = class extends BufferedStream {
|
|
|
29903
29908
|
createWritableStream() {
|
|
29904
29909
|
this.hasStarted = false;
|
|
29905
29910
|
this.framesWritten = 0;
|
|
29911
|
+
this.processingMs = 0;
|
|
29906
29912
|
return new WritableStream({
|
|
29907
29913
|
write: async (chunk) => {
|
|
29908
29914
|
if (!this.hasStarted) {
|
|
29909
29915
|
this.hasStarted = true;
|
|
29910
29916
|
this.emitStarted();
|
|
29911
29917
|
}
|
|
29918
|
+
const start = performance.now();
|
|
29912
29919
|
await this._write(chunk);
|
|
29920
|
+
this.processingMs += performance.now() - start;
|
|
29913
29921
|
this.framesWritten += chunk.samples[0]?.length ?? 0;
|
|
29914
29922
|
this.emitProgress("write", this.framesWritten, this.sourceTotalFrames);
|
|
29915
29923
|
},
|
|
29916
29924
|
close: async () => {
|
|
29925
|
+
const start = performance.now();
|
|
29917
29926
|
await this._close();
|
|
29927
|
+
this.processingMs += performance.now() - start;
|
|
29918
29928
|
this.emitProgress("write", this.framesWritten, this.sourceTotalFrames, { force: true });
|
|
29919
|
-
this.emitFinished({ framesDone: this.framesWritten });
|
|
29929
|
+
this.emitFinished({ framesDone: this.framesWritten, processingMs: this.processingMs });
|
|
29920
29930
|
await this.destroy();
|
|
29921
29931
|
},
|
|
29922
29932
|
abort: async () => {
|
|
@@ -32172,7 +32182,7 @@ function applyNlmSmoothing(mask, numFrames, numBins, nlmOptions, output) {
|
|
|
32172
32182
|
// package.json
|
|
32173
32183
|
var package_default = {
|
|
32174
32184
|
name: "@buffered-audio/nodes",
|
|
32175
|
-
version: "0.18.
|
|
32185
|
+
version: "0.18.1"};
|
|
32176
32186
|
|
|
32177
32187
|
// src/package-metadata.ts
|
|
32178
32188
|
var PACKAGE_NAME = package_default.name;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@buffered-audio/nodes",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
"vitest": "^3.0.0"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@buffered-audio/core": "0.7.
|
|
49
|
-
"@buffered-audio/utils": "0.6.
|
|
48
|
+
"@buffered-audio/core": "0.7.1",
|
|
49
|
+
"@buffered-audio/utils": "0.6.1",
|
|
50
50
|
"bufferfy": "^4.0.3",
|
|
51
51
|
"commander": "^14.0.3",
|
|
52
52
|
"tsx": "^4.21.0",
|