@libraz/libsonare 1.0.4 → 1.1.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.
package/dist/index.d.ts CHANGED
@@ -1,32 +1,7 @@
1
- /**
2
- * sonare - Audio Analysis Library
3
- *
4
- * @example
5
- * ```typescript
6
- * import { init, detectBpm, detectKey, analyze } from '@libraz/sonare';
7
- *
8
- * await init();
9
- *
10
- * // Detect BPM from audio samples
11
- * const bpm = detectBpm(samples, sampleRate);
12
- *
13
- * // Detect musical key
14
- * const key = detectKey(samples, sampleRate);
15
- *
16
- * // Full analysis
17
- * const result = analyze(samples, sampleRate);
18
- * ```
19
- */
20
- /**
21
- * Progress callback for analysis progress reporting.
22
- * @param progress - Progress value (0.0 to 1.0)
23
- * @param stage - Current analysis stage name
24
- */
25
- export type ProgressCallback = (progress: number, stage: string) => void;
26
1
  /**
27
2
  * Pitch class enum (C=0, C#=1, ..., B=11)
28
3
  */
29
- export declare const PitchClass: {
4
+ declare const PitchClass: {
30
5
  readonly C: 0;
31
6
  readonly Cs: 1;
32
7
  readonly D: 2;
@@ -40,19 +15,19 @@ export declare const PitchClass: {
40
15
  readonly As: 10;
41
16
  readonly B: 11;
42
17
  };
43
- export type PitchClass = (typeof PitchClass)[keyof typeof PitchClass];
18
+ type PitchClass = (typeof PitchClass)[keyof typeof PitchClass];
44
19
  /**
45
20
  * Musical mode
46
21
  */
47
- export declare const Mode: {
22
+ declare const Mode: {
48
23
  readonly Major: 0;
49
24
  readonly Minor: 1;
50
25
  };
51
- export type Mode = (typeof Mode)[keyof typeof Mode];
26
+ type Mode = (typeof Mode)[keyof typeof Mode];
52
27
  /**
53
28
  * Chord quality
54
29
  */
55
- export declare const ChordQuality: {
30
+ declare const ChordQuality: {
56
31
  readonly Major: 0;
57
32
  readonly Minor: 1;
58
33
  readonly Diminished: 2;
@@ -63,11 +38,11 @@ export declare const ChordQuality: {
63
38
  readonly Sus2: 7;
64
39
  readonly Sus4: 8;
65
40
  };
66
- export type ChordQuality = (typeof ChordQuality)[keyof typeof ChordQuality];
41
+ type ChordQuality = (typeof ChordQuality)[keyof typeof ChordQuality];
67
42
  /**
68
43
  * Section type
69
44
  */
70
- export declare const SectionType: {
45
+ declare const SectionType: {
71
46
  readonly Intro: 0;
72
47
  readonly Verse: 1;
73
48
  readonly PreChorus: 2;
@@ -76,11 +51,11 @@ export declare const SectionType: {
76
51
  readonly Instrumental: 5;
77
52
  readonly Outro: 6;
78
53
  };
79
- export type SectionType = (typeof SectionType)[keyof typeof SectionType];
54
+ type SectionType = (typeof SectionType)[keyof typeof SectionType];
80
55
  /**
81
56
  * Detected musical key
82
57
  */
83
- export interface Key {
58
+ interface Key {
84
59
  root: PitchClass;
85
60
  mode: Mode;
86
61
  confidence: number;
@@ -90,14 +65,14 @@ export interface Key {
90
65
  /**
91
66
  * Detected beat
92
67
  */
93
- export interface Beat {
68
+ interface Beat {
94
69
  time: number;
95
70
  strength: number;
96
71
  }
97
72
  /**
98
73
  * Detected chord
99
74
  */
100
- export interface Chord {
75
+ interface Chord {
101
76
  root: PitchClass;
102
77
  quality: ChordQuality;
103
78
  start: number;
@@ -108,7 +83,7 @@ export interface Chord {
108
83
  /**
109
84
  * Detected section
110
85
  */
111
- export interface Section {
86
+ interface Section {
112
87
  type: SectionType;
113
88
  start: number;
114
89
  end: number;
@@ -119,7 +94,7 @@ export interface Section {
119
94
  /**
120
95
  * Timbre characteristics
121
96
  */
122
- export interface Timbre {
97
+ interface Timbre {
123
98
  brightness: number;
124
99
  warmth: number;
125
100
  density: number;
@@ -129,7 +104,7 @@ export interface Timbre {
129
104
  /**
130
105
  * Dynamics characteristics
131
106
  */
132
- export interface Dynamics {
107
+ interface Dynamics {
133
108
  dynamicRangeDb: number;
134
109
  loudnessRangeDb: number;
135
110
  crestFactor: number;
@@ -138,7 +113,7 @@ export interface Dynamics {
138
113
  /**
139
114
  * Time signature
140
115
  */
141
- export interface TimeSignature {
116
+ interface TimeSignature {
142
117
  numerator: number;
143
118
  denominator: number;
144
119
  confidence: number;
@@ -146,7 +121,7 @@ export interface TimeSignature {
146
121
  /**
147
122
  * Rhythm features
148
123
  */
149
- export interface RhythmFeatures {
124
+ interface RhythmFeatures {
150
125
  syncopation: number;
151
126
  grooveType: string;
152
127
  patternRegularity: number;
@@ -154,7 +129,7 @@ export interface RhythmFeatures {
154
129
  /**
155
130
  * Complete analysis result
156
131
  */
157
- export interface AnalysisResult {
132
+ interface AnalysisResult {
158
133
  bpm: number;
159
134
  bpmConfidence: number;
160
135
  key: Key;
@@ -171,15 +146,182 @@ export interface AnalysisResult {
171
146
  /**
172
147
  * HPSS (Harmonic-Percussive Source Separation) result
173
148
  */
174
- export interface HpssResult {
149
+ interface HpssResult {
175
150
  harmonic: Float32Array;
176
151
  percussive: Float32Array;
177
152
  sampleRate: number;
178
153
  }
154
+ /**
155
+ * Mastering loudness/true-peak processing result
156
+ */
157
+ interface MasteringResult {
158
+ samples: Float32Array;
159
+ sampleRate: number;
160
+ inputLufs: number;
161
+ outputLufs: number;
162
+ appliedGainDb: number;
163
+ latencySamples?: number;
164
+ }
165
+ type MasteringProcessorParams = Record<string, number | boolean>;
166
+ interface MasteringChainConfig {
167
+ repair?: {
168
+ denoise?: boolean;
169
+ nFft?: number;
170
+ hopLength?: number;
171
+ ddAlpha?: number;
172
+ gainFloor?: number;
173
+ declick?: {
174
+ threshold?: number;
175
+ neighborRatio?: number;
176
+ maxClickSamples?: number;
177
+ lpcOrder?: number;
178
+ residualRatio?: number;
179
+ };
180
+ dereverb?: {
181
+ threshold?: number;
182
+ attenuation?: number;
183
+ nFft?: number;
184
+ hopLength?: number;
185
+ t60Sec?: number;
186
+ lateDelayMs?: number;
187
+ overSubtraction?: number;
188
+ spectralFloor?: number;
189
+ wpeEnabled?: boolean;
190
+ wpeIterations?: number;
191
+ wpeTaps?: number;
192
+ wpeStrength?: number;
193
+ };
194
+ };
195
+ eq?: {
196
+ tiltDb?: number;
197
+ pivotHz?: number;
198
+ };
199
+ dynamics?: {
200
+ compressor?: {
201
+ thresholdDb?: number;
202
+ ratio?: number;
203
+ attackMs?: number;
204
+ releaseMs?: number;
205
+ kneeDb?: number;
206
+ makeupGainDb?: number;
207
+ autoMakeup?: boolean;
208
+ };
209
+ deesser?: {
210
+ frequencyHz?: number;
211
+ thresholdDb?: number;
212
+ ratio?: number;
213
+ attackMs?: number;
214
+ releaseMs?: number;
215
+ rangeDb?: number;
216
+ };
217
+ transientShaper?: {
218
+ attackGainDb?: number;
219
+ sustainGainDb?: number;
220
+ fastAttackMs?: number;
221
+ fastReleaseMs?: number;
222
+ slowAttackMs?: number;
223
+ slowReleaseMs?: number;
224
+ sensitivity?: number;
225
+ maxGainDb?: number;
226
+ gainSmoothingMs?: number;
227
+ lookaheadMs?: number;
228
+ };
229
+ multibandComp?: {
230
+ lowCutoffHz?: number;
231
+ highCutoffHz?: number;
232
+ lowThresholdDb?: number;
233
+ lowRatio?: number;
234
+ lowAttackMs?: number;
235
+ lowReleaseMs?: number;
236
+ midThresholdDb?: number;
237
+ midRatio?: number;
238
+ midAttackMs?: number;
239
+ midReleaseMs?: number;
240
+ highThresholdDb?: number;
241
+ highRatio?: number;
242
+ highAttackMs?: number;
243
+ highReleaseMs?: number;
244
+ };
245
+ };
246
+ saturation?: {
247
+ tape?: {
248
+ driveDb?: number;
249
+ saturation?: number;
250
+ hysteresis?: number;
251
+ outputGainDb?: number;
252
+ speedIps?: number;
253
+ headBumpDb?: number;
254
+ bias?: number;
255
+ gapLoss?: number;
256
+ };
257
+ exciter?: {
258
+ frequencyHz?: number;
259
+ driveDb?: number;
260
+ amount?: number;
261
+ q?: number;
262
+ evenOddMix?: number;
263
+ };
264
+ };
265
+ spectral?: {
266
+ airBand?: {
267
+ amount?: number;
268
+ shelfFrequencyHz?: number;
269
+ dynamicThresholdDb?: number;
270
+ dynamicRangeDb?: number;
271
+ };
272
+ };
273
+ stereo?: {
274
+ imager?: {
275
+ width?: number;
276
+ outputGainDb?: number;
277
+ decorrelationAmount?: number;
278
+ preserveEnergy?: boolean;
279
+ };
280
+ monoMaker?: {
281
+ amount?: number;
282
+ };
283
+ };
284
+ maximizer?: {
285
+ truePeakLimiter?: {
286
+ ceilingDb?: number;
287
+ lookaheadMs?: number;
288
+ releaseMs?: number;
289
+ oversampleFactor?: number;
290
+ applyGainAtInputRate?: boolean;
291
+ };
292
+ };
293
+ loudness?: {
294
+ targetLufs?: number;
295
+ ceilingDb?: number;
296
+ truePeakOversample?: number;
297
+ };
298
+ }
299
+ interface MasteringChainResult extends MasteringResult {
300
+ stages: string[];
301
+ }
302
+ interface MasteringStereoChainResult {
303
+ left: Float32Array;
304
+ right: Float32Array;
305
+ sampleRate: number;
306
+ inputLufs: number;
307
+ outputLufs: number;
308
+ appliedGainDb: number;
309
+ stages: string[];
310
+ latencySamples?: number;
311
+ }
312
+ interface MasteringStereoResult {
313
+ left: Float32Array;
314
+ right: Float32Array;
315
+ sampleRate: number;
316
+ inputLufs: number;
317
+ outputLufs: number;
318
+ appliedGainDb: number;
319
+ latencySamples: number;
320
+ }
179
321
  /**
180
322
  * STFT (Short-Time Fourier Transform) result
181
323
  */
182
- export interface StftResult {
324
+ interface StftResult {
183
325
  nBins: number;
184
326
  nFrames: number;
185
327
  nFft: number;
@@ -191,7 +333,7 @@ export interface StftResult {
191
333
  /**
192
334
  * Mel spectrogram result
193
335
  */
194
- export interface MelSpectrogramResult {
336
+ interface MelSpectrogramResult {
195
337
  nMels: number;
196
338
  nFrames: number;
197
339
  sampleRate: number;
@@ -202,7 +344,7 @@ export interface MelSpectrogramResult {
202
344
  /**
203
345
  * MFCC result
204
346
  */
205
- export interface MfccResult {
347
+ interface MfccResult {
206
348
  nMfcc: number;
207
349
  nFrames: number;
208
350
  coefficients: Float32Array;
@@ -210,7 +352,7 @@ export interface MfccResult {
210
352
  /**
211
353
  * Chroma features result
212
354
  */
213
- export interface ChromaResult {
355
+ interface ChromaResult {
214
356
  nChroma: number;
215
357
  nFrames: number;
216
358
  sampleRate: number;
@@ -221,7 +363,7 @@ export interface ChromaResult {
221
363
  /**
222
364
  * Pitch detection result
223
365
  */
224
- export interface PitchResult {
366
+ interface PitchResult {
225
367
  f0: Float32Array;
226
368
  voicedProb: Float32Array;
227
369
  voicedFlag: boolean[];
@@ -229,6 +371,134 @@ export interface PitchResult {
229
371
  medianF0: number;
230
372
  meanF0: number;
231
373
  }
374
+
375
+ /**
376
+ * A detected chord change in the progression
377
+ */
378
+ interface ChordChange {
379
+ root: PitchClass;
380
+ quality: ChordQuality;
381
+ startTime: number;
382
+ confidence: number;
383
+ }
384
+ /**
385
+ * A chord detected at bar boundary (beat-synchronized)
386
+ */
387
+ interface BarChord {
388
+ barIndex: number;
389
+ root: PitchClass;
390
+ quality: ChordQuality;
391
+ startTime: number;
392
+ confidence: number;
393
+ }
394
+ /**
395
+ * Pattern score for known chord progressions
396
+ */
397
+ interface PatternScore {
398
+ name: string;
399
+ score: number;
400
+ }
401
+ /**
402
+ * Progressive estimation results for BPM, Key, and Chord
403
+ */
404
+ interface ProgressiveEstimate {
405
+ bpm: number;
406
+ bpmConfidence: number;
407
+ bpmCandidateCount: number;
408
+ key: PitchClass;
409
+ keyMinor: boolean;
410
+ keyConfidence: number;
411
+ chordRoot: PitchClass;
412
+ chordQuality: ChordQuality;
413
+ chordConfidence: number;
414
+ chordProgression: ChordChange[];
415
+ barChordProgression: BarChord[];
416
+ currentBar: number;
417
+ barDuration: number;
418
+ votedPattern: BarChord[];
419
+ patternLength: number;
420
+ detectedPatternName: string;
421
+ detectedPatternScore: number;
422
+ allPatternScores: PatternScore[];
423
+ accumulatedSeconds: number;
424
+ usedFrames: number;
425
+ updated: boolean;
426
+ }
427
+ /**
428
+ * Statistics and current state of the analyzer
429
+ */
430
+ interface AnalyzerStats {
431
+ totalFrames: number;
432
+ totalSamples: number;
433
+ durationSeconds: number;
434
+ estimate: ProgressiveEstimate;
435
+ }
436
+ /**
437
+ * Frame buffer with analysis results
438
+ */
439
+ interface FrameBuffer {
440
+ nFrames: number;
441
+ timestamps: Float32Array;
442
+ mel: Float32Array;
443
+ chroma: Float32Array;
444
+ onsetStrength: Float32Array;
445
+ rmsEnergy: Float32Array;
446
+ spectralCentroid: Float32Array;
447
+ spectralFlatness: Float32Array;
448
+ chordRoot: Int32Array;
449
+ chordQuality: Int32Array;
450
+ chordConfidence: Float32Array;
451
+ }
452
+ /**
453
+ * Configuration for StreamAnalyzer
454
+ */
455
+ interface StreamConfig {
456
+ sampleRate: number;
457
+ nFft?: number;
458
+ hopLength?: number;
459
+ nMels?: number;
460
+ computeMel?: boolean;
461
+ computeChroma?: boolean;
462
+ computeOnset?: boolean;
463
+ emitEveryNFrames?: number;
464
+ }
465
+
466
+ type ProgressCallback = (progress: number, stage: string) => void;
467
+ interface WasmTrimResult {
468
+ audio: Float32Array;
469
+ startSample: number;
470
+ endSample: number;
471
+ }
472
+ interface WasmFrameResult {
473
+ nFrames: number;
474
+ frames: Float32Array;
475
+ }
476
+ interface WasmTempogramResult {
477
+ nFrames: number;
478
+ winLength: number;
479
+ data: Float32Array;
480
+ }
481
+
482
+ /**
483
+ * sonare - Audio Analysis Library
484
+ *
485
+ * @example
486
+ * ```typescript
487
+ * import { init, detectBpm, detectKey, analyze } from '@libraz/sonare';
488
+ *
489
+ * await init();
490
+ *
491
+ * // Detect BPM from audio samples
492
+ * const bpm = detectBpm(samples, sampleRate);
493
+ *
494
+ * // Detect musical key
495
+ * const key = detectKey(samples, sampleRate);
496
+ *
497
+ * // Full analysis
498
+ * const result = analyze(samples, sampleRate);
499
+ * ```
500
+ */
501
+
232
502
  /**
233
503
  * Initialize the WASM module.
234
504
  * Must be called before using any analysis functions.
@@ -236,17 +506,17 @@ export interface PitchResult {
236
506
  * @param options - Optional module configuration
237
507
  * @returns Promise that resolves when initialization is complete
238
508
  */
239
- export declare function init(options?: {
509
+ declare function init(options?: {
240
510
  locateFile?: (path: string, prefix: string) => string;
241
511
  }): Promise<void>;
242
512
  /**
243
513
  * Check if the module is initialized.
244
514
  */
245
- export declare function isInitialized(): boolean;
515
+ declare function isInitialized(): boolean;
246
516
  /**
247
517
  * Get the library version.
248
518
  */
249
- export declare function version(): string;
519
+ declare function version(): string;
250
520
  /**
251
521
  * Detect BPM from audio samples.
252
522
  *
@@ -254,7 +524,7 @@ export declare function version(): string;
254
524
  * @param sampleRate - Sample rate in Hz
255
525
  * @returns Detected BPM
256
526
  */
257
- export declare function detectBpm(samples: Float32Array, sampleRate: number): number;
527
+ declare function detectBpm(samples: Float32Array, sampleRate: number): number;
258
528
  /**
259
529
  * Detect musical key from audio samples.
260
530
  *
@@ -262,7 +532,7 @@ export declare function detectBpm(samples: Float32Array, sampleRate: number): nu
262
532
  * @param sampleRate - Sample rate in Hz
263
533
  * @returns Detected key
264
534
  */
265
- export declare function detectKey(samples: Float32Array, sampleRate: number): Key;
535
+ declare function detectKey(samples: Float32Array, sampleRate: number): Key;
266
536
  /**
267
537
  * Detect onset times from audio samples.
268
538
  *
@@ -270,7 +540,7 @@ export declare function detectKey(samples: Float32Array, sampleRate: number): Ke
270
540
  * @param sampleRate - Sample rate in Hz
271
541
  * @returns Array of onset times in seconds
272
542
  */
273
- export declare function detectOnsets(samples: Float32Array, sampleRate: number): Float32Array;
543
+ declare function detectOnsets(samples: Float32Array, sampleRate: number): Float32Array;
274
544
  /**
275
545
  * Detect beat times from audio samples.
276
546
  *
@@ -278,7 +548,7 @@ export declare function detectOnsets(samples: Float32Array, sampleRate: number):
278
548
  * @param sampleRate - Sample rate in Hz
279
549
  * @returns Array of beat times in seconds
280
550
  */
281
- export declare function detectBeats(samples: Float32Array, sampleRate: number): Float32Array;
551
+ declare function detectBeats(samples: Float32Array, sampleRate: number): Float32Array;
282
552
  /**
283
553
  * Perform complete music analysis.
284
554
  *
@@ -286,7 +556,7 @@ export declare function detectBeats(samples: Float32Array, sampleRate: number):
286
556
  * @param sampleRate - Sample rate in Hz
287
557
  * @returns Complete analysis result
288
558
  */
289
- export declare function analyze(samples: Float32Array, sampleRate: number): AnalysisResult;
559
+ declare function analyze(samples: Float32Array, sampleRate: number): AnalysisResult;
290
560
  /**
291
561
  * Perform complete music analysis with progress reporting.
292
562
  *
@@ -295,7 +565,7 @@ export declare function analyze(samples: Float32Array, sampleRate: number): Anal
295
565
  * @param onProgress - Progress callback (progress: 0-1, stage: string)
296
566
  * @returns Complete analysis result
297
567
  */
298
- export declare function analyzeWithProgress(samples: Float32Array, sampleRate: number, onProgress: ProgressCallback): AnalysisResult;
568
+ declare function analyzeWithProgress(samples: Float32Array, sampleRate: number, onProgress: ProgressCallback): AnalysisResult;
299
569
  /**
300
570
  * Perform Harmonic-Percussive Source Separation (HPSS).
301
571
  *
@@ -305,7 +575,7 @@ export declare function analyzeWithProgress(samples: Float32Array, sampleRate: n
305
575
  * @param kernelPercussive - Vertical median filter size for percussive (default: 31)
306
576
  * @returns Separated harmonic and percussive components
307
577
  */
308
- export declare function hpss(samples: Float32Array, sampleRate: number, kernelHarmonic?: number, kernelPercussive?: number): HpssResult;
578
+ declare function hpss(samples: Float32Array, sampleRate: number, kernelHarmonic?: number, kernelPercussive?: number): HpssResult;
309
579
  /**
310
580
  * Extract harmonic component from audio.
311
581
  *
@@ -313,7 +583,7 @@ export declare function hpss(samples: Float32Array, sampleRate: number, kernelHa
313
583
  * @param sampleRate - Sample rate in Hz
314
584
  * @returns Harmonic component
315
585
  */
316
- export declare function harmonic(samples: Float32Array, sampleRate: number): Float32Array;
586
+ declare function harmonic(samples: Float32Array, sampleRate: number): Float32Array;
317
587
  /**
318
588
  * Extract percussive component from audio.
319
589
  *
@@ -321,7 +591,7 @@ export declare function harmonic(samples: Float32Array, sampleRate: number): Flo
321
591
  * @param sampleRate - Sample rate in Hz
322
592
  * @returns Percussive component
323
593
  */
324
- export declare function percussive(samples: Float32Array, sampleRate: number): Float32Array;
594
+ declare function percussive(samples: Float32Array, sampleRate: number): Float32Array;
325
595
  /**
326
596
  * Time-stretch audio without changing pitch.
327
597
  *
@@ -330,7 +600,7 @@ export declare function percussive(samples: Float32Array, sampleRate: number): F
330
600
  * @param rate - Time stretch rate (0.5 = double duration, 2.0 = half duration)
331
601
  * @returns Time-stretched audio
332
602
  */
333
- export declare function timeStretch(samples: Float32Array, sampleRate: number, rate: number): Float32Array;
603
+ declare function timeStretch(samples: Float32Array, sampleRate: number, rate: number): Float32Array;
334
604
  /**
335
605
  * Pitch-shift audio without changing duration.
336
606
  *
@@ -339,7 +609,7 @@ export declare function timeStretch(samples: Float32Array, sampleRate: number, r
339
609
  * @param semitones - Pitch shift in semitones (+12 = one octave up, -12 = one octave down)
340
610
  * @returns Pitch-shifted audio
341
611
  */
342
- export declare function pitchShift(samples: Float32Array, sampleRate: number, semitones: number): Float32Array;
612
+ declare function pitchShift(samples: Float32Array, sampleRate: number, semitones: number): Float32Array;
343
613
  /**
344
614
  * Normalize audio to target peak level.
345
615
  *
@@ -348,7 +618,146 @@ export declare function pitchShift(samples: Float32Array, sampleRate: number, se
348
618
  * @param targetDb - Target peak level in dB (default: 0 dB = full scale)
349
619
  * @returns Normalized audio
350
620
  */
351
- export declare function normalize(samples: Float32Array, sampleRate: number, targetDb?: number): Float32Array;
621
+ declare function normalize(samples: Float32Array, sampleRate: number, targetDb?: number): Float32Array;
622
+ /**
623
+ * Apply mastering loudness normalization with a true-peak ceiling.
624
+ *
625
+ * @param samples - Audio samples (mono, float32)
626
+ * @param sampleRate - Sample rate in Hz
627
+ * @param targetLufs - Target integrated LUFS (default: -14)
628
+ * @param ceilingDb - True/sample peak ceiling in dBFS (default: -1)
629
+ * @param truePeakOversample - Oversampling factor used for peak estimation
630
+ * @returns Processed audio and loudness metadata
631
+ */
632
+ declare function mastering(samples: Float32Array, sampleRate: number, targetLufs?: number, ceilingDb?: number, truePeakOversample?: number): MasteringResult;
633
+ declare function masteringProcessorNames(): string[];
634
+ declare function masteringPairProcessorNames(): string[];
635
+ declare function masteringPairAnalysisNames(): string[];
636
+ declare function masteringStereoAnalysisNames(): string[];
637
+ declare function masteringProcess(processorName: string, samples: Float32Array, sampleRate: number, params?: MasteringProcessorParams): MasteringResult;
638
+ declare function masteringProcessStereo(processorName: string, left: Float32Array, right: Float32Array, sampleRate: number, params?: MasteringProcessorParams): MasteringStereoResult;
639
+ declare function masteringPairProcess(processorName: string, source: Float32Array, reference: Float32Array, sampleRate: number, params?: MasteringProcessorParams): MasteringResult;
640
+ declare function masteringPairAnalyze(analysisName: string, source: Float32Array, reference: Float32Array, sampleRate: number, params?: MasteringProcessorParams): string;
641
+ declare function masteringStereoAnalyze(analysisName: string, left: Float32Array, right: Float32Array, sampleRate: number, params?: MasteringProcessorParams): string;
642
+ /**
643
+ * Apply a configurable mastering chain in WASM.
644
+ *
645
+ * @param samples - Audio samples (mono, float32)
646
+ * @param sampleRate - Sample rate in Hz
647
+ * @param config - Chain stage configuration
648
+ * @returns Processed audio, loudness metadata, and applied stage names
649
+ */
650
+ declare function masteringChain(samples: Float32Array, sampleRate: number, config: MasteringChainConfig): MasteringChainResult;
651
+ /**
652
+ * Apply a configurable stereo mastering chain in WASM.
653
+ *
654
+ * @param left - Left channel samples
655
+ * @param right - Right channel samples
656
+ * @param sampleRate - Sample rate in Hz
657
+ * @param config - Chain stage configuration
658
+ * @returns Processed stereo audio, loudness metadata, and applied stage names
659
+ */
660
+ declare function masteringChainStereo(left: Float32Array, right: Float32Array, sampleRate: number, config: MasteringChainConfig): MasteringStereoChainResult;
661
+ /**
662
+ * Apply a configurable mastering chain in WASM with progress reporting.
663
+ *
664
+ * @param samples - Audio samples (mono, float32)
665
+ * @param sampleRate - Sample rate in Hz
666
+ * @param config - Chain stage configuration
667
+ * @param onProgress - Progress callback (progress: 0-1, stage: string)
668
+ * @returns Processed audio, loudness metadata, and applied stage names
669
+ */
670
+ declare function masteringChainWithProgress(samples: Float32Array, sampleRate: number, config: MasteringChainConfig, onProgress: ProgressCallback): MasteringChainResult;
671
+ /**
672
+ * Apply a configurable stereo mastering chain in WASM with progress reporting.
673
+ *
674
+ * @param left - Left channel samples
675
+ * @param right - Right channel samples
676
+ * @param sampleRate - Sample rate in Hz
677
+ * @param config - Chain stage configuration
678
+ * @param onProgress - Progress callback (progress: 0-1, stage: string)
679
+ * @returns Processed stereo audio, loudness metadata, and applied stage names
680
+ */
681
+ declare function masteringChainStereoWithProgress(left: Float32Array, right: Float32Array, sampleRate: number, config: MasteringChainConfig, onProgress: ProgressCallback): MasteringStereoChainResult;
682
+ /**
683
+ * List built-in mastering preset identifiers.
684
+ *
685
+ * @returns Preset names in display order (e.g. "pop", "edm", "aiMusic")
686
+ */
687
+ declare function masteringPresetNames(): string[];
688
+ /**
689
+ * Apply a named mastering preset chain to mono audio.
690
+ *
691
+ * @param samples - Audio samples (mono, float32)
692
+ * @param sampleRate - Sample rate in Hz
693
+ * @param presetName - Preset identifier from {@link masteringPresetNames}
694
+ * @param overrides - Optional flat overrides (dot-notation, e.g. `'loudness.targetLufs'`) applied on top of the preset. Pass `null` for preset defaults.
695
+ * @returns Processed audio, loudness metadata, and applied stage names
696
+ */
697
+ declare function masterAudio(samples: Float32Array, sampleRate: number, presetName: string, overrides?: Record<string, number | boolean> | null): MasteringChainResult;
698
+ /**
699
+ * Apply a named mastering preset chain to stereo audio.
700
+ *
701
+ * @param left - Left channel samples
702
+ * @param right - Right channel samples
703
+ * @param sampleRate - Sample rate in Hz
704
+ * @param presetName - Preset identifier from {@link masteringPresetNames}
705
+ * @param overrides - Optional flat overrides (dot-notation, e.g. `'loudness.targetLufs'`) applied on top of the preset. Pass `null` for preset defaults.
706
+ * @returns Processed stereo audio, loudness metadata, and applied stage names
707
+ */
708
+ declare function masterAudioStereo(left: Float32Array, right: Float32Array, sampleRate: number, presetName: string, overrides?: Record<string, number | boolean> | null): MasteringStereoChainResult;
709
+ /**
710
+ * Block-by-block streaming variant of {@link masteringChain}.
711
+ *
712
+ * Maintains processor state across {@link processMono}/{@link processStereo}
713
+ * calls. Only ProcessorBase-backed stages are supported. Configurations that
714
+ * enable `repair.denoise` or `loudness` throw at construction.
715
+ *
716
+ * Call {@link delete} (or use a `try/finally`) to release the underlying WASM
717
+ * object — the embind handle is not garbage-collected automatically.
718
+ *
719
+ * @example
720
+ * ```typescript
721
+ * const chain = new StreamingMasteringChain({ eq: { tiltDb: 1.0 } });
722
+ * try {
723
+ * chain.prepare(44100, 512, 1);
724
+ * const out = chain.processMono(blockSamples);
725
+ * } finally {
726
+ * chain.delete();
727
+ * }
728
+ * ```
729
+ */
730
+ declare class StreamingMasteringChain {
731
+ private chain;
732
+ constructor(config: MasteringChainConfig);
733
+ /**
734
+ * Initialize processors for the given sample rate and block layout.
735
+ *
736
+ * @param sampleRate - Sample rate in Hz
737
+ * @param maxBlockSize - Maximum block size per process call
738
+ * @param numChannels - 1 (mono) or 2 (stereo)
739
+ */
740
+ prepare(sampleRate: number, maxBlockSize: number, numChannels: number): void;
741
+ /**
742
+ * Process one mono block, returning the processed samples (same length).
743
+ */
744
+ processMono(samples: Float32Array): Float32Array;
745
+ /**
746
+ * Process one stereo block, returning the processed channels.
747
+ */
748
+ processStereo(left: Float32Array, right: Float32Array): {
749
+ left: Float32Array;
750
+ right: Float32Array;
751
+ };
752
+ /** Reset all processor state without rebuilding. */
753
+ reset(): void;
754
+ /** Total reported latency in samples across all active processors. */
755
+ latencySamples(): number;
756
+ /** Ordered stage names that will run (e.g. `"eq.tilt"`). */
757
+ stageNames(): string[];
758
+ /** Release the underlying WASM object. Safe to call only once. */
759
+ delete(): void;
760
+ }
352
761
  /**
353
762
  * Trim silence from beginning and end of audio.
354
763
  *
@@ -357,7 +766,7 @@ export declare function normalize(samples: Float32Array, sampleRate: number, tar
357
766
  * @param thresholdDb - Silence threshold in dB (default: -60 dB)
358
767
  * @returns Trimmed audio
359
768
  */
360
- export declare function trim(samples: Float32Array, sampleRate: number, thresholdDb?: number): Float32Array;
769
+ declare function trim(samples: Float32Array, sampleRate: number, thresholdDb?: number): Float32Array;
361
770
  /**
362
771
  * Compute Short-Time Fourier Transform (STFT).
363
772
  *
@@ -367,7 +776,7 @@ export declare function trim(samples: Float32Array, sampleRate: number, threshol
367
776
  * @param hopLength - Hop length (default: 512)
368
777
  * @returns STFT result with magnitude and power spectrograms
369
778
  */
370
- export declare function stft(samples: Float32Array, sampleRate: number, nFft?: number, hopLength?: number): StftResult;
779
+ declare function stft(samples: Float32Array, sampleRate: number, nFft?: number, hopLength?: number): StftResult;
371
780
  /**
372
781
  * Compute STFT and return magnitude in decibels.
373
782
  *
@@ -377,7 +786,7 @@ export declare function stft(samples: Float32Array, sampleRate: number, nFft?: n
377
786
  * @param hopLength - Hop length (default: 512)
378
787
  * @returns STFT result with dB values
379
788
  */
380
- export declare function stftDb(samples: Float32Array, sampleRate: number, nFft?: number, hopLength?: number): {
789
+ declare function stftDb(samples: Float32Array, sampleRate: number, nFft?: number, hopLength?: number): {
381
790
  nBins: number;
382
791
  nFrames: number;
383
792
  db: Float32Array;
@@ -392,7 +801,7 @@ export declare function stftDb(samples: Float32Array, sampleRate: number, nFft?:
392
801
  * @param nMels - Number of Mel bands (default: 128)
393
802
  * @returns Mel spectrogram result
394
803
  */
395
- export declare function melSpectrogram(samples: Float32Array, sampleRate: number, nFft?: number, hopLength?: number, nMels?: number): MelSpectrogramResult;
804
+ declare function melSpectrogram(samples: Float32Array, sampleRate: number, nFft?: number, hopLength?: number, nMels?: number): MelSpectrogramResult;
396
805
  /**
397
806
  * Compute MFCC (Mel-Frequency Cepstral Coefficients).
398
807
  *
@@ -404,7 +813,7 @@ export declare function melSpectrogram(samples: Float32Array, sampleRate: number
404
813
  * @param nMfcc - Number of MFCC coefficients (default: 13)
405
814
  * @returns MFCC result
406
815
  */
407
- export declare function mfcc(samples: Float32Array, sampleRate: number, nFft?: number, hopLength?: number, nMels?: number, nMfcc?: number): MfccResult;
816
+ declare function mfcc(samples: Float32Array, sampleRate: number, nFft?: number, hopLength?: number, nMels?: number, nMfcc?: number): MfccResult;
408
817
  /**
409
818
  * Compute chromagram (pitch class distribution).
410
819
  *
@@ -414,7 +823,7 @@ export declare function mfcc(samples: Float32Array, sampleRate: number, nFft?: n
414
823
  * @param hopLength - Hop length (default: 512)
415
824
  * @returns Chroma features result
416
825
  */
417
- export declare function chroma(samples: Float32Array, sampleRate: number, nFft?: number, hopLength?: number): ChromaResult;
826
+ declare function chroma(samples: Float32Array, sampleRate: number, nFft?: number, hopLength?: number): ChromaResult;
418
827
  /**
419
828
  * Compute spectral centroid (center of mass of spectrum).
420
829
  *
@@ -424,7 +833,7 @@ export declare function chroma(samples: Float32Array, sampleRate: number, nFft?:
424
833
  * @param hopLength - Hop length (default: 512)
425
834
  * @returns Spectral centroid in Hz for each frame
426
835
  */
427
- export declare function spectralCentroid(samples: Float32Array, sampleRate: number, nFft?: number, hopLength?: number): Float32Array;
836
+ declare function spectralCentroid(samples: Float32Array, sampleRate: number, nFft?: number, hopLength?: number): Float32Array;
428
837
  /**
429
838
  * Compute spectral bandwidth.
430
839
  *
@@ -434,7 +843,7 @@ export declare function spectralCentroid(samples: Float32Array, sampleRate: numb
434
843
  * @param hopLength - Hop length (default: 512)
435
844
  * @returns Spectral bandwidth in Hz for each frame
436
845
  */
437
- export declare function spectralBandwidth(samples: Float32Array, sampleRate: number, nFft?: number, hopLength?: number): Float32Array;
846
+ declare function spectralBandwidth(samples: Float32Array, sampleRate: number, nFft?: number, hopLength?: number): Float32Array;
438
847
  /**
439
848
  * Compute spectral rolloff frequency.
440
849
  *
@@ -445,7 +854,7 @@ export declare function spectralBandwidth(samples: Float32Array, sampleRate: num
445
854
  * @param rollPercent - Percentage threshold (default: 0.85)
446
855
  * @returns Rolloff frequency in Hz for each frame
447
856
  */
448
- export declare function spectralRolloff(samples: Float32Array, sampleRate: number, nFft?: number, hopLength?: number, rollPercent?: number): Float32Array;
857
+ declare function spectralRolloff(samples: Float32Array, sampleRate: number, nFft?: number, hopLength?: number, rollPercent?: number): Float32Array;
449
858
  /**
450
859
  * Compute spectral flatness.
451
860
  *
@@ -455,7 +864,7 @@ export declare function spectralRolloff(samples: Float32Array, sampleRate: numbe
455
864
  * @param hopLength - Hop length (default: 512)
456
865
  * @returns Spectral flatness for each frame (0 = tonal, 1 = noise-like)
457
866
  */
458
- export declare function spectralFlatness(samples: Float32Array, sampleRate: number, nFft?: number, hopLength?: number): Float32Array;
867
+ declare function spectralFlatness(samples: Float32Array, sampleRate: number, nFft?: number, hopLength?: number): Float32Array;
459
868
  /**
460
869
  * Compute zero crossing rate.
461
870
  *
@@ -465,7 +874,7 @@ export declare function spectralFlatness(samples: Float32Array, sampleRate: numb
465
874
  * @param hopLength - Hop length (default: 512)
466
875
  * @returns Zero crossing rate for each frame
467
876
  */
468
- export declare function zeroCrossingRate(samples: Float32Array, sampleRate: number, frameLength?: number, hopLength?: number): Float32Array;
877
+ declare function zeroCrossingRate(samples: Float32Array, sampleRate: number, frameLength?: number, hopLength?: number): Float32Array;
469
878
  /**
470
879
  * Compute RMS energy.
471
880
  *
@@ -475,7 +884,7 @@ export declare function zeroCrossingRate(samples: Float32Array, sampleRate: numb
475
884
  * @param hopLength - Hop length (default: 512)
476
885
  * @returns RMS energy for each frame
477
886
  */
478
- export declare function rmsEnergy(samples: Float32Array, sampleRate: number, frameLength?: number, hopLength?: number): Float32Array;
887
+ declare function rmsEnergy(samples: Float32Array, sampleRate: number, frameLength?: number, hopLength?: number): Float32Array;
479
888
  /**
480
889
  * Detect pitch using YIN algorithm.
481
890
  *
@@ -488,7 +897,7 @@ export declare function rmsEnergy(samples: Float32Array, sampleRate: number, fra
488
897
  * @param threshold - YIN threshold (default: 0.3)
489
898
  * @returns Pitch detection result
490
899
  */
491
- export declare function pitchYin(samples: Float32Array, sampleRate: number, frameLength?: number, hopLength?: number, fmin?: number, fmax?: number, threshold?: number): PitchResult;
900
+ declare function pitchYin(samples: Float32Array, sampleRate: number, frameLength?: number, hopLength?: number, fmin?: number, fmax?: number, threshold?: number): PitchResult;
492
901
  /**
493
902
  * Detect pitch using pYIN algorithm (probabilistic YIN with HMM smoothing).
494
903
  *
@@ -501,49 +910,49 @@ export declare function pitchYin(samples: Float32Array, sampleRate: number, fram
501
910
  * @param threshold - YIN threshold (default: 0.3)
502
911
  * @returns Pitch detection result
503
912
  */
504
- export declare function pitchPyin(samples: Float32Array, sampleRate: number, frameLength?: number, hopLength?: number, fmin?: number, fmax?: number, threshold?: number): PitchResult;
913
+ declare function pitchPyin(samples: Float32Array, sampleRate: number, frameLength?: number, hopLength?: number, fmin?: number, fmax?: number, threshold?: number): PitchResult;
505
914
  /**
506
915
  * Convert frequency in Hz to Mel scale.
507
916
  *
508
917
  * @param hz - Frequency in Hz
509
918
  * @returns Mel frequency
510
919
  */
511
- export declare function hzToMel(hz: number): number;
920
+ declare function hzToMel(hz: number): number;
512
921
  /**
513
922
  * Convert Mel scale to frequency in Hz.
514
923
  *
515
924
  * @param mel - Mel frequency
516
925
  * @returns Frequency in Hz
517
926
  */
518
- export declare function melToHz(mel: number): number;
927
+ declare function melToHz(mel: number): number;
519
928
  /**
520
929
  * Convert frequency in Hz to MIDI note number.
521
930
  *
522
931
  * @param hz - Frequency in Hz
523
932
  * @returns MIDI note number (A4 = 440 Hz = 69)
524
933
  */
525
- export declare function hzToMidi(hz: number): number;
934
+ declare function hzToMidi(hz: number): number;
526
935
  /**
527
936
  * Convert MIDI note number to frequency in Hz.
528
937
  *
529
938
  * @param midi - MIDI note number
530
939
  * @returns Frequency in Hz
531
940
  */
532
- export declare function midiToHz(midi: number): number;
941
+ declare function midiToHz(midi: number): number;
533
942
  /**
534
943
  * Convert frequency in Hz to note name.
535
944
  *
536
945
  * @param hz - Frequency in Hz
537
946
  * @returns Note name (e.g., "A4", "C#5")
538
947
  */
539
- export declare function hzToNote(hz: number): string;
948
+ declare function hzToNote(hz: number): string;
540
949
  /**
541
950
  * Convert note name to frequency in Hz.
542
951
  *
543
952
  * @param note - Note name (e.g., "A4", "C#5")
544
953
  * @returns Frequency in Hz
545
954
  */
546
- export declare function noteToHz(note: string): number;
955
+ declare function noteToHz(note: string): number;
547
956
  /**
548
957
  * Convert frame index to time in seconds.
549
958
  *
@@ -552,7 +961,7 @@ export declare function noteToHz(note: string): number;
552
961
  * @param hopLength - Hop length in samples
553
962
  * @returns Time in seconds
554
963
  */
555
- export declare function framesToTime(frames: number, sr: number, hopLength: number): number;
964
+ declare function framesToTime(frames: number, sr: number, hopLength: number): number;
556
965
  /**
557
966
  * Convert time in seconds to frame index.
558
967
  *
@@ -561,7 +970,27 @@ export declare function framesToTime(frames: number, sr: number, hopLength: numb
561
970
  * @param hopLength - Hop length in samples
562
971
  * @returns Frame index
563
972
  */
564
- export declare function timeToFrames(time: number, sr: number, hopLength: number): number;
973
+ declare function timeToFrames(time: number, sr: number, hopLength: number): number;
974
+ declare function framesToSamples(frames: number, hopLength?: number, nFft?: number): number;
975
+ declare function samplesToFrames(samples: number, hopLength?: number, nFft?: number): number;
976
+ declare function powerToDb(values: Float32Array, ref?: number, amin?: number, topDb?: number): Float32Array;
977
+ declare function amplitudeToDb(values: Float32Array, ref?: number, amin?: number, topDb?: number): Float32Array;
978
+ declare function dbToPower(values: Float32Array, ref?: number): Float32Array;
979
+ declare function dbToAmplitude(values: Float32Array, ref?: number): Float32Array;
980
+ declare function preemphasis(samples: Float32Array, coef?: number, zi?: number): Float32Array;
981
+ declare function deemphasis(samples: Float32Array, coef?: number, zi?: number): Float32Array;
982
+ declare function trimSilence(samples: Float32Array, topDb?: number, frameLength?: number, hopLength?: number): WasmTrimResult;
983
+ declare function splitSilence(samples: Float32Array, topDb?: number, frameLength?: number, hopLength?: number): Int32Array;
984
+ declare function frameSignal(samples: Float32Array, frameLength: number, hopLength: number): WasmFrameResult;
985
+ declare function padCenter(values: Float32Array, size: number, padValue?: number): Float32Array;
986
+ declare function fixLength(values: Float32Array, size: number, padValue?: number): Float32Array;
987
+ declare function fixFrames(frames: Int32Array, xMin?: number, xMax?: number, pad?: boolean): Int32Array;
988
+ declare function peakPick(values: Float32Array, preMax: number, postMax: number, preAvg: number, postAvg: number, delta: number, wait: number): Int32Array;
989
+ declare function vectorNormalize(values: Float32Array, normType?: number, threshold?: number): Float32Array;
990
+ declare function pcen(values: Float32Array, nBins: number, nFrames: number, options?: Record<string, number>): Float32Array;
991
+ declare function tonnetz(chromagram: Float32Array, nChroma: number, nFrames: number): Float32Array;
992
+ declare function tempogram(onsetEnvelope: Float32Array, sampleRate: number, hopLength?: number, winLength?: number): WasmTempogramResult;
993
+ declare function plp(onsetEnvelope: Float32Array, sampleRate: number, hopLength?: number, tempoMin?: number, tempoMax?: number, winLength?: number): Float32Array;
565
994
  /**
566
995
  * Resample audio to a different sample rate.
567
996
  *
@@ -570,7 +999,7 @@ export declare function timeToFrames(time: number, sr: number, hopLength: number
570
999
  * @param targetSr - Target sample rate in Hz
571
1000
  * @returns Resampled audio
572
1001
  */
573
- export declare function resample(samples: Float32Array, srcSr: number, targetSr: number): Float32Array;
1002
+ declare function resample(samples: Float32Array, srcSr: number, targetSr: number): Float32Array;
574
1003
  /**
575
1004
  * Wrapper around audio data that exposes all analysis and feature functions as instance methods.
576
1005
  *
@@ -587,7 +1016,7 @@ export declare function resample(samples: Float32Array, srcSr: number, targetSr:
587
1016
  * const mel = audio.melSpectrogram();
588
1017
  * ```
589
1018
  */
590
- export declare class Audio {
1019
+ declare class Audio {
591
1020
  private _samples;
592
1021
  private _sampleRate;
593
1022
  private constructor();
@@ -613,6 +1042,10 @@ export declare class Audio {
613
1042
  timeStretch(rate: number): Float32Array;
614
1043
  pitchShift(semitones: number): Float32Array;
615
1044
  normalize(targetDb?: number): Float32Array;
1045
+ mastering(targetLufs?: number, ceilingDb?: number, truePeakOversample?: number): MasteringResult;
1046
+ masteringChain(config: MasteringChainConfig): MasteringChainResult;
1047
+ masterAudio(presetName: string, overrides?: Record<string, number | boolean> | null): MasteringChainResult;
1048
+ masteringProcess(processorName: string, params?: MasteringProcessorParams): MasteringResult;
616
1049
  trim(thresholdDb?: number): Float32Array;
617
1050
  stft(nFft?: number, hopLength?: number): StftResult;
618
1051
  stftDb(nFft?: number, hopLength?: number): {
@@ -633,96 +1066,6 @@ export declare class Audio {
633
1066
  pitchPyin(frameLength?: number, hopLength?: number, fmin?: number, fmax?: number, threshold?: number): PitchResult;
634
1067
  resample(targetSr: number): Float32Array;
635
1068
  }
636
- /**
637
- * A detected chord change in the progression
638
- */
639
- export interface ChordChange {
640
- root: PitchClass;
641
- quality: ChordQuality;
642
- startTime: number;
643
- confidence: number;
644
- }
645
- /**
646
- * A chord detected at bar boundary (beat-synchronized)
647
- */
648
- export interface BarChord {
649
- barIndex: number;
650
- root: PitchClass;
651
- quality: ChordQuality;
652
- startTime: number;
653
- confidence: number;
654
- }
655
- /**
656
- * Pattern score for known chord progressions
657
- */
658
- export interface PatternScore {
659
- name: string;
660
- score: number;
661
- }
662
- /**
663
- * Progressive estimation results for BPM, Key, and Chord
664
- */
665
- export interface ProgressiveEstimate {
666
- bpm: number;
667
- bpmConfidence: number;
668
- bpmCandidateCount: number;
669
- key: PitchClass;
670
- keyMinor: boolean;
671
- keyConfidence: number;
672
- chordRoot: PitchClass;
673
- chordQuality: ChordQuality;
674
- chordConfidence: number;
675
- chordProgression: ChordChange[];
676
- barChordProgression: BarChord[];
677
- currentBar: number;
678
- barDuration: number;
679
- votedPattern: BarChord[];
680
- patternLength: number;
681
- detectedPatternName: string;
682
- detectedPatternScore: number;
683
- allPatternScores: PatternScore[];
684
- accumulatedSeconds: number;
685
- usedFrames: number;
686
- updated: boolean;
687
- }
688
- /**
689
- * Statistics and current state of the analyzer
690
- */
691
- export interface AnalyzerStats {
692
- totalFrames: number;
693
- totalSamples: number;
694
- durationSeconds: number;
695
- estimate: ProgressiveEstimate;
696
- }
697
- /**
698
- * Frame buffer with analysis results
699
- */
700
- export interface FrameBuffer {
701
- nFrames: number;
702
- timestamps: Float32Array;
703
- mel: Float32Array;
704
- chroma: Float32Array;
705
- onsetStrength: Float32Array;
706
- rmsEnergy: Float32Array;
707
- spectralCentroid: Float32Array;
708
- spectralFlatness: Float32Array;
709
- chordRoot: Int32Array;
710
- chordQuality: Int32Array;
711
- chordConfidence: Float32Array;
712
- }
713
- /**
714
- * Configuration for StreamAnalyzer
715
- */
716
- export interface StreamConfig {
717
- sampleRate: number;
718
- nFft?: number;
719
- hopLength?: number;
720
- nMels?: number;
721
- computeMel?: boolean;
722
- computeChroma?: boolean;
723
- computeOnset?: boolean;
724
- emitEveryNFrames?: number;
725
- }
726
1069
  /**
727
1070
  * Real-time streaming audio analyzer.
728
1071
  *
@@ -744,7 +1087,7 @@ export interface StreamConfig {
744
1087
  * console.log('Chord progression:', stats.estimate.chordProgression);
745
1088
  * ```
746
1089
  */
747
- export declare class StreamAnalyzer {
1090
+ declare class StreamAnalyzer {
748
1091
  private analyzer;
749
1092
  /**
750
1093
  * Create a new StreamAnalyzer.
@@ -828,5 +1171,5 @@ export declare class StreamAnalyzer {
828
1171
  */
829
1172
  dispose(): void;
830
1173
  }
831
- export { PitchClass as Pitch };
832
- //# sourceMappingURL=index.d.ts.map
1174
+
1175
+ export { type AnalysisResult, type AnalyzerStats, Audio, type BarChord, type Beat, type Chord, type ChordChange, ChordQuality, type ChromaResult, type Dynamics, type FrameBuffer, type HpssResult, type Key, type MasteringChainConfig, type MasteringChainResult, type MasteringProcessorParams, type MasteringResult, type MasteringStereoChainResult, type MasteringStereoResult, type MelSpectrogramResult, type MfccResult, Mode, type PatternScore, PitchClass as Pitch, PitchClass, type PitchResult, type ProgressCallback, type ProgressiveEstimate, type RhythmFeatures, type Section, SectionType, type StftResult, StreamAnalyzer, type StreamConfig, StreamingMasteringChain, type Timbre, type TimeSignature, amplitudeToDb, analyze, analyzeWithProgress, chroma, dbToAmplitude, dbToPower, deemphasis, detectBeats, detectBpm, detectKey, detectOnsets, fixFrames, fixLength, frameSignal, framesToSamples, framesToTime, harmonic, hpss, hzToMel, hzToMidi, hzToNote, init, isInitialized, masterAudio, masterAudioStereo, mastering, masteringChain, masteringChainStereo, masteringChainStereoWithProgress, masteringChainWithProgress, masteringPairAnalysisNames, masteringPairAnalyze, masteringPairProcess, masteringPairProcessorNames, masteringPresetNames, masteringProcess, masteringProcessStereo, masteringProcessorNames, masteringStereoAnalysisNames, masteringStereoAnalyze, melSpectrogram, melToHz, mfcc, midiToHz, normalize, noteToHz, padCenter, pcen, peakPick, percussive, pitchPyin, pitchShift, pitchYin, plp, powerToDb, preemphasis, resample, rmsEnergy, samplesToFrames, spectralBandwidth, spectralCentroid, spectralFlatness, spectralRolloff, splitSilence, stft, stftDb, tempogram, timeStretch, timeToFrames, tonnetz, trim, trimSilence, vectorNormalize, version, zeroCrossingRate };