@buffered-audio/nodes 0.21.0 → 0.23.0

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 (3) hide show
  1. package/README.md +13 -13
  2. package/dist/index.js +21 -24
  3. package/package.json +3 -3
package/README.md CHANGED
@@ -69,8 +69,8 @@ Remove a region of audio
69
69
  | Parameter | Type | Default | Description |
70
70
  | --- | --- | --- | --- |
71
71
  | `regions` | Object[] | `[]` | Regions |
72
- | `regions[].start` | number (min 0) | — | Start (seconds) |
73
- | `regions[].end` | number (min 0) | — | End (seconds) |
72
+ | `regions[].start` | number (0 to 86400) | — | Start (seconds) |
73
+ | `regions[].end` | number (0 to 86400) | — | End (seconds) |
74
74
 
75
75
  ### De-Bleed Adaptive
76
76
 
@@ -226,15 +226,15 @@ Peak-aware content-adaptive curve fitting (LUFS, true-peak, LRA) via a single co
226
226
  | Parameter | Type | Default | Description |
227
227
  | --- | --- | --- | --- |
228
228
  | `targetLufs` | number (-50 to 0, step 0.1) | `-16` | Target integrated loudness (LUFS) |
229
- | `pivot` | number (max 0), optional | — | Body anchor (dB). Default: median(considered LRA blocks) from BS.1770 LRA gating in pass 1. |
230
- | `floor` | number (max 0), optional | — | Silence threshold (dB). Default: min(considered LRA blocks); no floor when no blocks survive gating. |
229
+ | `pivot` | number (-80 to 0), optional | — | Body anchor (dB). Default: median(considered LRA blocks) from BS.1770 LRA gating in pass 1. |
230
+ | `floor` | number (-100 to 0), optional | — | Silence threshold (dB). Default: min(considered LRA blocks); no floor when no blocks survive gating. |
231
231
  | `limitPercentile` | number (0.5 to 1) | `0.995` | Top-1−p fraction of detection samples to brick-wall. Default 0.995 brick-walls the top 0.5%. |
232
- | `limitDb` | number (max 0), optional | — | Limit-anchor override (dB). Default: auto-derived from quantile(detection histogram, limitPercentile). Set explicitly to fix the limit anchor. |
232
+ | `limitDb` | number (-60 to 0), optional | — | Limit-anchor override (dB). Default: auto-derived from quantile(detection histogram, limitPercentile). Set explicitly to fix the limit anchor. |
233
233
  | `maxAttempts` | number (min 1) | `10` | Hard cap on iteration attempts. |
234
- | `targetTp` | number (max 0), optional | — | True-peak target (dBTP). Default: source true peak (peaks unchanged). |
234
+ | `targetTp` | number (-24 to 0), optional | — | True-peak target (dBTP). Default: source true peak (peaks unchanged). |
235
235
  | `smoothing` | number (0.01 to 200) | `1` | Peak-respecting envelope time constant (ms). |
236
- | `tolerance` | number (min 0) | `0.5` | Iteration exit threshold (LUFS dB). |
237
- | `peakTolerance` | number (min 0) | `0.1` | One-sided iteration exit threshold for output true-peak overshoot (dBTP; ceiling — undershoot ignored). |
236
+ | `tolerance` | number (0 to 6) | `0.5` | Iteration exit threshold (LUFS dB). |
237
+ | `peakTolerance` | number (0 to 6) | `0.1` | One-sided iteration exit threshold for output true-peak overshoot (dBTP; ceiling — undershoot ignored). |
238
238
 
239
239
  ### Normalize
240
240
 
@@ -254,8 +254,8 @@ Add silence to start or end of audio
254
254
 
255
255
  | Parameter | Type | Default | Description |
256
256
  | --- | --- | --- | --- |
257
- | `before` | number (min 0, step 0.001) | `0` | Before |
258
- | `after` | number (min 0, step 0.001) | `0` | After |
257
+ | `before` | number (0 to 300, step 0.001) | `0` | Before |
258
+ | `after` | number (0 to 300, step 0.001) | `0` | After |
259
259
 
260
260
  ### Pan
261
261
 
@@ -328,7 +328,7 @@ Replace a region of audio with processed content
328
328
  | Parameter | Type | Default | Description |
329
329
  | --- | --- | --- | --- |
330
330
  | `insertPath` | string | `""` | Insert File Path |
331
- | `insertAt` | number (min 0) | `0` | Insert At (frames) |
331
+ | `insertAt` | number (0 to 1000000000) | `0` | Insert At (frames) |
332
332
 
333
333
  ### Trim
334
334
 
@@ -351,7 +351,7 @@ Measure source true peak (4× upsampled, BS.1770-4 style) and apply a single lin
351
351
 
352
352
  | Parameter | Type | Default | Description |
353
353
  | --- | --- | --- | --- |
354
- | `target` | number (max 0) | `-1` | Target true peak (dBTP). Must be < 0. |
354
+ | `target` | number (-24 to 0) | `-1` | Target true peak (dBTP). Must be < 0. |
355
355
 
356
356
  ### VST3
357
357
 
@@ -393,7 +393,7 @@ Write audio to a file
393
393
  | `encoding` | Object, optional | — | Encode through ffmpeg to a non-WAV format. Requires `ffmpegPath`. |
394
394
  | `encoding.format` | "wav" \| "flac" \| "mp3" \| "aac" | — | |
395
395
  | `encoding.bitrate` | string, optional | — | |
396
- | `encoding.vbr` | number, optional | — | |
396
+ | `encoding.vbr` | number (0 to 9), optional | — | |
397
397
  | `encoding.sampleRate` | number (min 0), optional | — | Output sample rate (Hz). When set, ffmpeg resamples on encode. |
398
398
 
399
399
  ## Creating Nodes
package/dist/index.js CHANGED
@@ -29843,6 +29843,9 @@ var BufferedAudioNode = class {
29843
29843
  get id() {
29844
29844
  return this.properties.id;
29845
29845
  }
29846
+ get packageVersion() {
29847
+ return this.properties.packageVersion;
29848
+ }
29846
29849
  get isBypassed() {
29847
29850
  return this.properties.bypass === true;
29848
29851
  }
@@ -30118,6 +30121,7 @@ var TransformNode = class extends BufferedAudioNode {
30118
30121
  var graphNodeSchema = external_exports2.object({
30119
30122
  id: external_exports2.string().min(1),
30120
30123
  packageName: external_exports2.string().min(1),
30124
+ packageVersion: external_exports2.string().min(1),
30121
30125
  nodeName: external_exports2.string().min(1),
30122
30126
  parameters: external_exports2.record(external_exports2.string(), external_exports2.unknown()).optional(),
30123
30127
  options: external_exports2.object({
@@ -30132,15 +30136,8 @@ external_exports2.object({
30132
30136
  id: external_exports2.uuid(),
30133
30137
  name: external_exports2.string().default("Untitled"),
30134
30138
  apiVersion: external_exports2.number().int().min(1),
30135
- packages: external_exports2.record(external_exports2.string(), external_exports2.string().min(1)),
30136
30139
  nodes: external_exports2.array(graphNodeSchema),
30137
30140
  edges: external_exports2.array(graphEdgeSchema)
30138
- }).superRefine((definition, context) => {
30139
- for (const node of definition.nodes) {
30140
- if (!Object.prototype.hasOwnProperty.call(definition.packages, node.packageName)) {
30141
- context.addIssue(`Node "${node.id}" references package "${node.packageName}" which has no entry in the graph packages map`);
30142
- }
30143
- }
30144
30141
  });
30145
30142
 
30146
30143
  // package.json
@@ -30542,7 +30539,7 @@ function amplitudePercentile(buckets, bucketMax, totalSamples, percent) {
30542
30539
  // src/targets/loudness-stats/index.ts
30543
30540
  var schema = external_exports.object({
30544
30541
  bucketCount: external_exports.number().int().positive().default(1024).describe("Amplitude histogram bucket count"),
30545
- outputPath: external_exports.string().default("").meta({ input: "file", mode: "save" }).describe("Output Path (JSON sidecar). Empty string disables file output.")
30542
+ outputPath: external_exports.string().default("").meta({ input: "file", mode: "save", accept: ".json" }).describe("Output Path (JSON sidecar). Empty string disables file output.")
30546
30543
  });
30547
30544
  var LoudnessStatsStream = class extends BufferedTargetStream {
30548
30545
  constructor() {
@@ -30770,7 +30767,7 @@ function computeLogBandMappings(numBands, minFreq, maxFreq, sampleRate, fftSize)
30770
30767
 
30771
30768
  // src/targets/spectrogram/index.ts
30772
30769
  var schema2 = external_exports.object({
30773
- outputPath: external_exports.string().default("").meta({ input: "file", mode: "save" }).describe("Output Path"),
30770
+ outputPath: external_exports.string().default("").meta({ input: "file", mode: "save", accept: ".bin" }).describe("Output Path"),
30774
30771
  fftSize: external_exports.number().min(256).max(8192).multipleOf(256).default(2048).describe("FFT Size"),
30775
30772
  hopSize: external_exports.number().min(64).max(8192).multipleOf(64).default(512).describe("Hop Size"),
30776
30773
  fftwAddonPath: external_exports.string().default("").meta({ input: "file", mode: "open", binary: "fftw-addon" }).describe("FFTW Addon")
@@ -30980,7 +30977,7 @@ function writeMinMaxPoint(min, max, channels, target, offset) {
30980
30977
 
30981
30978
  // src/targets/waveform/index.ts
30982
30979
  var schema3 = external_exports.object({
30983
- outputPath: external_exports.string().default("").meta({ input: "file", mode: "save" }).describe("Output Path"),
30980
+ outputPath: external_exports.string().default("").meta({ input: "file", mode: "save", accept: ".bin" }).describe("Output Path"),
30984
30981
  resolution: external_exports.number().min(100).max(1e4).multipleOf(100).default(1e3).describe("Resolution")
30985
30982
  });
30986
30983
  var HEADER_SIZE2 = 16;
@@ -31222,11 +31219,11 @@ function bitDepthToPcmFormat(bitDepth) {
31222
31219
  var encodingSchema = external_exports.object({
31223
31220
  format: external_exports.enum(["wav", "flac", "mp3", "aac"]),
31224
31221
  bitrate: external_exports.string().optional(),
31225
- vbr: external_exports.number().optional(),
31222
+ vbr: external_exports.number().min(0).max(9).optional(),
31226
31223
  sampleRate: external_exports.number().int().positive().optional().describe("Output sample rate (Hz). When set, ffmpeg resamples on encode.")
31227
31224
  });
31228
31225
  var schema4 = external_exports.object({
31229
- path: external_exports.string().default("").meta({ input: "file", mode: "save" }),
31226
+ path: external_exports.string().default("").meta({ input: "file", mode: "save", accept: ".wav,.flac,.mp3,.aac" }),
31230
31227
  ffmpegPath: external_exports.string().default("").meta({ input: "file", mode: "open", binary: "ffmpeg", download: "https://ffmpeg.org/download.html" }).describe("FFmpeg \u2014 audio/video processing tool"),
31231
31228
  bitDepth: external_exports.enum(["16", "24", "32", "32f"]).default("16"),
31232
31229
  encoding: encodingSchema.optional().describe("Encode through ffmpeg to a non-WAV format. Requires `ffmpegPath`.")
@@ -31416,8 +31413,8 @@ function computeKeepRanges(sortedRegions, chunkStartSec, sampleRate, chunkFrames
31416
31413
 
31417
31414
  // src/transforms/cut/index.ts
31418
31415
  var cutRegionSchema = external_exports.object({
31419
- start: external_exports.number().min(0).describe("Start (seconds)"),
31420
- end: external_exports.number().min(0).describe("End (seconds)")
31416
+ start: external_exports.number().min(0).max(86400).describe("Start (seconds)"),
31417
+ end: external_exports.number().min(0).max(86400).describe("End (seconds)")
31421
31418
  });
31422
31419
  var schema5 = external_exports.object({
31423
31420
  regions: external_exports.array(cutRegionSchema).default([]).describe("Regions")
@@ -31602,8 +31599,8 @@ function silenceChunkSizes(total, chunkFrames) {
31602
31599
 
31603
31600
  // src/transforms/pad/index.ts
31604
31601
  var schema8 = external_exports.object({
31605
- before: external_exports.number().min(0).multipleOf(1e-3).default(0).describe("Before"),
31606
- after: external_exports.number().min(0).multipleOf(1e-3).default(0).describe("After")
31602
+ before: external_exports.number().min(0).max(300).multipleOf(1e-3).default(0).describe("Before"),
31603
+ after: external_exports.number().min(0).max(300).multipleOf(1e-3).default(0).describe("After")
31607
31604
  });
31608
31605
  var PadStream = class extends UnbufferedTransformStream {
31609
31606
  constructor() {
@@ -31819,7 +31816,7 @@ function applyInsert(destChannel, insertChannel, overlap) {
31819
31816
  // src/transforms/splice/index.ts
31820
31817
  var schema11 = external_exports.object({
31821
31818
  insertPath: external_exports.string().default("").meta({ input: "file", mode: "open", accept: ".wav" }).describe("Insert File Path"),
31822
- insertAt: external_exports.number().min(0).default(0).describe("Insert At (frames)")
31819
+ insertAt: external_exports.number().min(0).max(1e9).default(0).describe("Insert At (frames)")
31823
31820
  });
31824
31821
  var SpliceStream = class extends UnbufferedTransformStream {
31825
31822
  constructor() {
@@ -33181,15 +33178,15 @@ function predictInitialB(args) {
33181
33178
  var FLOOR_PIVOT_EPSILON_DB = 0.01;
33182
33179
  var schema18 = external_exports.object({
33183
33180
  targetLufs: external_exports.number().min(-50).max(0).multipleOf(0.1).default(-16).describe("Target integrated loudness (LUFS)"),
33184
- pivot: external_exports.number().lt(0).optional().describe("Body anchor (dB). Default: median(considered LRA blocks) from BS.1770 LRA gating in pass 1."),
33185
- floor: external_exports.number().lt(0).optional().describe("Silence threshold (dB). Default: min(considered LRA blocks); no floor when no blocks survive gating."),
33181
+ pivot: external_exports.number().min(-80).lt(0).optional().describe("Body anchor (dB). Default: median(considered LRA blocks) from BS.1770 LRA gating in pass 1."),
33182
+ floor: external_exports.number().min(-100).lt(0).optional().describe("Silence threshold (dB). Default: min(considered LRA blocks); no floor when no blocks survive gating."),
33186
33183
  limitPercentile: external_exports.number().min(0.5).max(1).default(0.995).describe("Top-1\u2212p fraction of detection samples to brick-wall. Default 0.995 brick-walls the top 0.5%."),
33187
- limitDb: external_exports.number().lt(0).optional().describe("Limit-anchor override (dB). Default: auto-derived from quantile(detection histogram, limitPercentile). Set explicitly to fix the limit anchor."),
33184
+ limitDb: external_exports.number().min(-60).lt(0).optional().describe("Limit-anchor override (dB). Default: auto-derived from quantile(detection histogram, limitPercentile). Set explicitly to fix the limit anchor."),
33188
33185
  maxAttempts: external_exports.number().int().min(1).default(10).describe("Hard cap on iteration attempts."),
33189
- targetTp: external_exports.number().lt(0).optional().describe("True-peak target (dBTP). Default: source true peak (peaks unchanged)."),
33186
+ targetTp: external_exports.number().min(-24).lt(0).optional().describe("True-peak target (dBTP). Default: source true peak (peaks unchanged)."),
33190
33187
  smoothing: external_exports.number().min(0.01).max(200).default(1).describe("Peak-respecting envelope time constant (ms)."),
33191
- tolerance: external_exports.number().gt(0).default(0.5).describe("Iteration exit threshold (LUFS dB)."),
33192
- peakTolerance: external_exports.number().gt(0).default(0.1).describe("One-sided iteration exit threshold for output true-peak overshoot (dBTP; ceiling \u2014 undershoot ignored).")
33188
+ tolerance: external_exports.number().gt(0).max(6).default(0.5).describe("Iteration exit threshold (LUFS dB)."),
33189
+ peakTolerance: external_exports.number().gt(0).max(6).default(0.1).describe("One-sided iteration exit threshold for output true-peak overshoot (dBTP; ceiling \u2014 undershoot ignored).")
33193
33190
  }).refine(
33194
33191
  ({ floor, pivot }) => floor === void 0 || pivot === void 0 || floor < pivot,
33195
33192
  { message: "loudnessTarget requires floor < pivot when floor is set" }
@@ -33536,7 +33533,7 @@ function resolveTruePeakGain(sourcePeakLinear, target) {
33536
33533
 
33537
33534
  // src/transforms/true-peak-normalize/index.ts
33538
33535
  var schema20 = external_exports.object({
33539
- target: external_exports.number().lt(0).default(-1).describe("Target true peak (dBTP). Must be < 0.")
33536
+ target: external_exports.number().min(-24).lt(0).default(-1).describe("Target true peak (dBTP). Must be < 0.")
33540
33537
  });
33541
33538
  var TruePeakNormalizeStream = class extends BufferedTransformStream {
33542
33539
  constructor() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@buffered-audio/nodes",
3
- "version": "0.21.0",
3
+ "version": "0.23.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -44,8 +44,8 @@
44
44
  "vitest": "^3.0.0"
45
45
  },
46
46
  "dependencies": {
47
- "@buffered-audio/core": "0.10.0",
48
- "@buffered-audio/utils": "0.6.5",
47
+ "@buffered-audio/core": "0.11.0",
48
+ "@buffered-audio/utils": "0.6.6",
49
49
  "bufferfy": "^4.0.3",
50
50
  "wavefile": "^11.0.0",
51
51
  "zod": "^4.3.6"