@libraz/libsonare 1.2.2 → 1.3.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 (44) hide show
  1. package/README.md +38 -1
  2. package/dist/index.d.ts +1 -2722
  3. package/dist/index.js +3659 -1896
  4. package/dist/index.js.map +1 -1
  5. package/dist/sonare-rt-module.js +1 -1
  6. package/dist/sonare-rt.js +1 -1
  7. package/dist/sonare-rt.wasm +0 -0
  8. package/dist/sonare.js +1 -1
  9. package/dist/sonare.wasm +0 -0
  10. package/dist/worklet.d.ts +4827 -455
  11. package/dist/worklet.js +1076 -494
  12. package/dist/worklet.js.map +1 -1
  13. package/package.json +2 -1
  14. package/src/analysis_helpers.ts +152 -0
  15. package/src/audio.ts +493 -0
  16. package/src/codes.ts +56 -0
  17. package/src/effects_mastering.ts +964 -0
  18. package/src/feature_core.ts +248 -0
  19. package/src/feature_music.ts +419 -0
  20. package/src/feature_pitch.ts +80 -0
  21. package/src/feature_resample.ts +21 -0
  22. package/src/feature_spectral.ts +330 -0
  23. package/src/feature_spectrogram.ts +454 -0
  24. package/src/features.ts +84 -0
  25. package/src/index.ts +352 -4793
  26. package/src/live_audio.ts +45 -0
  27. package/src/metering.ts +380 -0
  28. package/src/mixer.ts +523 -0
  29. package/src/module_state.ts +14 -0
  30. package/src/opfs_clip_pages.ts +188 -0
  31. package/src/project.ts +1614 -0
  32. package/src/public_types.ts +244 -2
  33. package/src/quick_analysis.ts +508 -0
  34. package/src/realtime_engine.ts +667 -0
  35. package/src/realtime_voice_changer.ts +275 -0
  36. package/src/scale.ts +42 -0
  37. package/src/sonare.js.d.ts +386 -4
  38. package/src/stream_analyzer.ts +275 -0
  39. package/src/stream_types.ts +29 -1
  40. package/src/streaming_mixing.ts +18 -0
  41. package/src/streaming_processors.ts +335 -0
  42. package/src/validation.ts +82 -0
  43. package/src/web_midi.ts +367 -0
  44. package/src/worklet.ts +525 -81
package/dist/index.d.ts CHANGED
@@ -1,2723 +1,2 @@
1
- import { ProgressCallback, WasmNnlsChromaResult, WasmDecomposeResult, WasmEngineAutomationPoint, WasmEngineBounceOptions, WasmEngineBounceResult, WasmEngineCaptureStatus, WasmEngineClip, WasmEngineFreezeOptions, WasmEngineFreezeResult, WasmEngineGraphSpec, WasmEngineMarker, WasmEngineMeterTelemetry, WasmEngineMetronomeConfig, WasmEngineParameterInfo, WasmEngineTelemetry, WasmEngineTransportState, WasmHpssWithResidualResult, WasmMatrix2dResult, WasmEngineProcessWithMonitorResult, WasmCyclicTempogramResult, WasmFourierTempogramResult, WasmFrameResult, WasmLufsResult, WasmTempogramResult, WasmTrimResult } from './sonare.js';
1
+ export { A as AcousticOptions, a as AcousticResult, b as AnalysisResult, c as AnalyzeBpmOptions, d as AnalyzeDynamicsOptions, e as AnalyzeRhythmOptions, f as AnalyzeSectionsOptions, g as AnalyzeTimbreOptions, h as AnalyzerStats, i as Audio, j as AutomationCurve, B as BarChord, k as Beat, l as BindMicrophoneInputOptions, m as BindWebMidiOptions, n as BpmAnalysisResult, o as BpmCandidate, p as BrowserAudioDecodeOptions, q as BuiltinSynthBinding, r as BuiltinSynthConfig, s as BuiltinSynthWaveform, C as Chord, t as ChordAnalysisResult, u as ChordChange, v as ChordDetectionOptions, w as ChordQuality, x as ChromaResult, y as ClippingRegion, z as ClippingReport, D as CompressorDetector, E as CompressorOptions, F as CqtResult, G as DeclickOptions, H as DeclipOptions, I as DecomposeResult, J as DecrackleMode, K as DecrackleOptions, L as DehumOptions, M as DenoiseClassicalMode, N as DenoiseClassicalNoiseEstimator, O as DenoiseClassicalOptions, P as DereverbClassicalOptions, Q as DynamicRangeReport, R as Dynamics, S as DynamicsAnalysisResult, T as DynamicsResult, U as EXPECTED_ENGINE_ABI_VERSION, V as EXPECTED_PROJECT_ABI_VERSION, W as EngineAutomationPoint, X as EngineBounceOptions, Y as EngineBounceResult, Z as EngineCapabilities, _ as EngineCaptureStatus, $ as EngineClip, a0 as EngineFreezeOptions, a1 as EngineFreezeResult, a2 as EngineGraphSpec, a3 as EngineMarker, a4 as EngineMeterTelemetry, a5 as EngineMetronomeConfig, a6 as EngineParameterInfo, a7 as EngineTelemetry, a8 as EngineTransportState, a9 as EqBand, aa as EqBandPhase, ab as EqBandType, ac as EqCoeffMode, ad as EqMatchOptions, ae as EqSpectrumSnapshot, af as EqStereoPlacement, ag as FrameBuffer, ah as GateOptions, ai as GoniometerPoint, aj as HpssResult, ak as HpssWithResidualResult, al as Key, am as KeyCandidate, an as KeyDetectionOptions, ao as KeyProfile, ap as KeyProfileName, aq as LufsResult, ar as MasteringChainConfig, as as MasteringChainResult, at as MasteringOptions, au as MasteringPreset, av as MasteringProcessorParams, aw as MasteringResult, ax as MasteringStereoChainResult, ay as MasteringStereoResult, az as Matrix2dResult, aA as MelPowerResult, aB as MelSpectrogramResult, aC as MelodyOptions, aD as MelodyPoint, aE as MelodyResult, aF as MeterTap, aG as MeteringDetectClippingOptions, aH as MeteringDynamicRangeOptions, aI as MfccResult, aJ as MicrophoneInputBinding, aK as MidiCcBindOptions, aL as MidiCcLearnOptions, aM as MixMeterSnapshot, aN as MixOptions, aO as MixResult, aP as Mixer, aQ as MixerProcessResult, aR as MixerRealtimeBuffer, aS as Mode, aT as NoteStretchOptions, aU as OpfsClipPageProviderBinding, aV as OpfsClipPageProviderOptions, aW as PairAnalysis, aX as PairProcessor, aY as PanLaw, aZ as PanMode, a_ as PatternScore, a$ as PhaseScopeReport, b0 as Pitch, b0 as PitchClass, b1 as PitchResult, b2 as ProgressiveEstimate, b3 as Project, b4 as ProjectAssistSidecar, b5 as ProjectAutomationCurve, b6 as ProjectAutomationLaneDesc, b7 as ProjectAutomationPoint, b8 as ProjectBounceOptions, b9 as ProjectChordSymbol, ba as ProjectClipCompSegment, bb as ProjectClipDesc, bc as ProjectClipFade, bd as ProjectClipTake, be as ProjectCompileResult, bf as ProjectFadeCurve, bg as ProjectKeySegment, bh as ProjectLoopMode, bi as ProjectLoopRecordingDesc, bj as ProjectLoopRecordingResult, bk as ProjectMidiClipResult, bl as ProjectMidiEvent, bm as ProjectNotePairValidation, bn as ProjectTrackDesc, bo as ProjectTrackKind, bp as ProjectWarpAnchor, bq as ProjectWarpMapDesc, br as RealtimeEngine, bs as RealtimeVoiceChanger, bt as RealtimeVoiceChangerConfigInput, bu as RealtimeVoiceChangerInterleavedBuffer, bv as RealtimeVoiceChangerMonoBuffer, bw as RealtimeVoiceChangerPlanarBuffer, bx as RealtimeVoiceChangerPodConfig, by as RhythmAnalysisResult, bz as RhythmFeatures, bA as RirResult, bB as RirSynthOptions, bC as RoomEstimateOptions, bD as RoomEstimateResult, bE as RoomGeometryOptions, bF as RoomMorphOptions, bG as SYNTH_BODY_TYPES, bH as SYNTH_ENGINE_MODES, bI as SYNTH_FILTER_MODELS, bJ as SYNTH_FILTER_OUTPUTS, bK as SYNTH_MOD_DESTINATIONS, bL as SYNTH_MOD_SOURCES, bM as SYNTH_OSC_WAVEFORMS, bN as Section, bO as SectionType, bP as SendTiming, bQ as Sf2InstrumentConfig, bR as Sf2ProgramStatus, bS as SoloProcessor, bT as SourceBackend, bU as SpectrumOptions, bV as SpectrumReport, bW as StereoAnalysis, bX as StftPowerResult, bY as StftResult, bZ as StreamAnalyzer, b_ as StreamConfig, b$ as StreamConfigDefaults, c0 as StreamFramesI16, c1 as StreamFramesU8, c2 as StreamQuantizeConfig, c3 as StreamingEqualizer, c4 as StreamingEqualizerConfig, c5 as StreamingMasteringChain, c6 as StreamingMasteringChainConfig, c7 as StreamingPlatform, c8 as StreamingRetune, c9 as StreamingRetuneConfig, ca as SynthBodyType, cb as SynthEngineMode, cc as SynthEnumTables, cd as SynthFilterModel, ce as SynthFilterOutput, cf as SynthModDestination, cg as SynthModRouting, ch as SynthModSource, ci as SynthOscWaveform, cj as SynthPatch, ck as TempogramMode, cl as Timbre, cm as TimbreAnalysisResult, cn as TimbreFrame, co as TimeSignature, cp as TransientShaperOptions, cq as TrimSilenceMode, cr as TrimSilenceOptions, cs as ValidateOptions, ct as VectorscopeReport, cu as VoiceChangeOptions, cv as VoiceChangeRealtimeOptions, cw as VoicePresetId, cx as WaveformPeakPyramidOptions, cy as WaveformPeaksOptions, cz as WaveformPeaksReport, cA as WebMidiBinding, cB as WebMidiCcBinding, cC as WebMidiInputInfo, cD as amplitudeToDb, cE as analyze, cF as analyzeBpm, cG as analyzeDynamics, cH as analyzeImpulseResponse, cI as analyzeMelody, cJ as analyzeRhythm, cK as analyzeSections, cL as analyzeTimbre, cM as analyzeWithProgress, cN as bassChroma, cO as bindMicrophoneInput, cP as bindWebMidi, cQ as chordFunctionalAnalysis, cR as chroma, cS as chromaCens, cT as cqt, cU as createOpfsClipPageProvider, cV as createOpfsClipPageWorker, cW as cyclicTempogram, cX as dbToAmplitude, cY as dbToPower, cZ as decompose, c_ as decomposeWithInit, c$ as deemphasis, d0 as detectAcoustic, d1 as detectBeats, d2 as detectBpm, d3 as detectChords, d4 as detectDownbeats, d5 as detectKey, d6 as detectKeyCandidates, d7 as detectOnsets, d8 as ebur128LoudnessRange, d9 as engineAbiVersion, da as engineCapabilities, db as estimateRoom, dc as estimateTuning, dd as fixFrames, de as fixLength, df as fourierTempogram, dg as frameSignal, dh as framesToSamples, di as framesToTime, dj as harmonic, dk as hasFfmpegSupport, dl as hpss, dm as hpssWithResidual, dn as hybridCqt, dp as hzToMel, dq as hzToMidi, dr as hzToNote, init, isInitialized, ds as isWebMidiAvailable, dt as lufs, du as lufsInterleaved, dv as masterAudio, dw as masterAudioStereo, dx as masterAudioStereoWithProgress, dy as masterAudioWithProgress, dz as mastering, dA as masteringAssistantSuggest, dB as masteringAudioProfile, dC as masteringChain, dD as masteringChainStereo, dE as masteringChainStereoWithProgress, dF as masteringChainWithProgress, dG as masteringDynamicsCompressor, dH as masteringDynamicsGate, dI as masteringDynamicsTransientShaper, dJ as masteringInsertNames, dK as masteringPairAnalysisNames, dL as masteringPairAnalyze, dM as masteringPairProcess, dN as masteringPairProcessorNames, dO as masteringPresetNames, dP as masteringProcess, dQ as masteringProcessStereo, dR as masteringProcessorNames, dS as masteringRepairDeclick, dT as masteringRepairDeclip, dU as masteringRepairDecrackle, dV as masteringRepairDehum, dW as masteringRepairDenoiseClassical, dX as masteringRepairDereverbClassical, dY as masteringRepairTrimSilence, dZ as masteringStereoAnalysisNames, d_ as masteringStereoAnalyze, d$ as masteringStreamingPreview, e0 as melSpectrogram, e1 as melToAudio, e2 as melToHz, e3 as melToStft, e4 as meteringCrestFactorDb, e5 as meteringDcOffset, e6 as meteringDetectClipping, e7 as meteringDynamicRange, e8 as meteringPeakDb, e9 as meteringPhaseScope, ea as meteringPhaseScopeDecimated, eb as meteringRmsDb, ec as meteringSpectrum, ed as meteringSpectrumFrame, ee as meteringStereoCorrelation, ef as meteringStereoWidth, eg as meteringTruePeakDb, eh as meteringVectorscope, ei as meteringVectorscopeDecimated, ej as mfcc, ek as mfccToAudio, el as mfccToMel, em as midiToHz, en as mixStereo, eo as mixingScenePresetJson, ep as mixingScenePresetNames, eq as momentaryLufs, er as nnFilter, es as nnlsChroma, et as normalize, eu as noteStretch, ev as noteToHz, ew as onsetEnvelope, ex as onsetStrengthMulti, ey as opfsClipPageWorkerSource, ez as padCenter, eA as pcen, eB as peakPick, eC as percussive, eD as phaseVocoder, eE as pitchCorrectToMidi, eF as pitchCorrectToMidiTimevarying, eG as pitchPyin, eH as pitchShift, eI as pitchTuning, eJ as pitchYin, eK as plp, eL as polyFeatures, eM as powerToDb, eN as preemphasis, eO as projectAbiVersion, eP as pseudoCqt, eQ as realtimeVoiceChangerPresetConfig, eR as realtimeVoiceChangerPresetJson, eS as realtimeVoiceChangerPresetNames, eT as remix, eU as resample, eV as rmsEnergy, eW as roomMorph, eX as samplesToFrames, eY as scaleCorrectionSemitones, eZ as scalePitchClassEnabled, e_ as scaleQuantizeMidi, e$ as shortTermLufs, f0 as spectralBandwidth, f1 as spectralCentroid, f2 as spectralContrast, f3 as spectralFlatness, f4 as spectralRolloff, f5 as splitSilence, f6 as stft, f7 as stftDb, f8 as streamAnalyzerConfigDefaults, f9 as synthEnumTables, fa as synthPresetNames, fb as synthPresetPatch, fc as synthesizeRir, fd as tempogram, fe as tempogramRatio, ff as timeStretch, fg as timeToFrames, fh as tonnetz, fi as trim, fj as trimSilence, fk as validateRealtimeVoiceChangerPresetJson, fl as vectorNormalize, fm as version, fn as voiceChange, fo as voiceChangeRealtime, fp as voiceChangerAbiVersion, fq as voiceCharacterPresetId, fr as vqt, fs as waveformPeakPyramid, ft as waveformPeaks, fu as zeroCrossingRate, fv as zeroCrossings } from './worklet.js';
2
2
  export { ProgressCallback } from './sonare.js';
3
-
4
- /**
5
- * Pitch class enum (C=0, C#=1, ..., B=11)
6
- */
7
- declare const PitchClass: {
8
- readonly C: 0;
9
- readonly Cs: 1;
10
- readonly D: 2;
11
- readonly Ds: 3;
12
- readonly E: 4;
13
- readonly F: 5;
14
- readonly Fs: 6;
15
- readonly G: 7;
16
- readonly Gs: 8;
17
- readonly A: 9;
18
- readonly As: 10;
19
- readonly B: 11;
20
- };
21
- type PitchClass = (typeof PitchClass)[keyof typeof PitchClass];
22
- /**
23
- * Musical mode
24
- */
25
- declare const Mode: {
26
- readonly Major: 0;
27
- readonly Minor: 1;
28
- readonly Dorian: 2;
29
- readonly Phrygian: 3;
30
- readonly Lydian: 4;
31
- readonly Mixolydian: 5;
32
- readonly Locrian: 6;
33
- };
34
- type Mode = (typeof Mode)[keyof typeof Mode];
35
- type TempogramMode = 'autocorrelation' | 'auto' | 'ac' | 'cosine' | 0 | 1;
36
- declare const KeyProfile: {
37
- readonly KrumhanslSchmuckler: 0;
38
- readonly Temperley: 1;
39
- readonly Shaath: 2;
40
- readonly FaraldoEDMT: 3;
41
- readonly FaraldoEDMA: 4;
42
- readonly FaraldoEDMM: 5;
43
- readonly BellmanBudge: 6;
44
- };
45
- type KeyProfile = (typeof KeyProfile)[keyof typeof KeyProfile];
46
- type KeyProfileName = 'ks' | 'krumhansl' | 'temperley' | 'shaath' | 'keyfinder' | 'faraldo-edmt' | 'edmt' | 'faraldo-edma' | 'edma' | 'faraldo-edmm' | 'edmm' | 'bellman-budge' | 'bellman';
47
- /**
48
- * Chord quality
49
- */
50
- declare const ChordQuality: {
51
- readonly Major: 0;
52
- readonly Minor: 1;
53
- readonly Diminished: 2;
54
- readonly Augmented: 3;
55
- readonly Dominant7: 4;
56
- readonly Major7: 5;
57
- readonly Minor7: 6;
58
- readonly Sus2: 7;
59
- readonly Sus4: 8;
60
- readonly Unknown: 9;
61
- readonly Add9: 10;
62
- readonly MinorAdd9: 11;
63
- readonly Dim7: 12;
64
- readonly HalfDim7: 13;
65
- readonly Major9: 14;
66
- readonly Dominant9: 15;
67
- readonly Sus2Add4: 16;
68
- };
69
- type ChordQuality = (typeof ChordQuality)[keyof typeof ChordQuality];
70
- type MasteringPreset = 'pop' | 'edm' | 'acoustic' | 'hipHop' | 'aiMusic' | 'speech' | 'streaming' | 'youtube' | 'broadcast' | 'podcast' | 'audiobook' | 'cinema' | 'jpop' | 'ambient' | 'lofi' | 'classical' | 'drumAndBass' | 'techno' | 'metal' | 'trap' | 'rnb' | 'jazz' | 'kpop' | 'trance' | 'gameOst';
71
- interface StreamingPlatform {
72
- name: string;
73
- targetLufs: number;
74
- ceilingDb: number;
75
- }
76
- type SoloProcessor = 'dynamics.brickwallLimiter' | 'dynamics.compressor' | 'dynamics.deesser' | 'dynamics.expander' | 'dynamics.gate' | 'dynamics.limiter' | 'dynamics.parallelComp' | 'dynamics.sidechainRouter' | 'dynamics.duckingProcessor' | 'dynamics.transientShaper' | 'dynamics.upwardCompressor' | 'dynamics.upwardExpander' | 'dynamics.vocalRider' | 'eq.apiStyle' | 'eq.bandPass' | 'eq.cutFilter' | 'eq.dynamic' | 'eq.equalizer' | 'eq.graphic' | 'eq.linearPhase' | 'eq.midSide' | 'eq.minimumPhase' | 'eq.parametric' | 'eq.pultec' | 'eq.shelving' | 'eq.tilt' | 'final.bitDepth' | 'final.dither' | 'final.outputChain' | 'maximizer.adaptiveRelease' | 'maximizer.loudnessOptimize' | 'maximizer.maximizer' | 'maximizer.softKneeMax' | 'maximizer.truePeakLimiter' | 'multiband.compressor' | 'multiband.dynamicEq' | 'multiband.expander' | 'multiband.imager' | 'multiband.limiter' | 'multiband.saturation' | 'repair.declick' | 'repair.declip' | 'repair.decrackle' | 'repair.dehum' | 'repair.denoiseClassical' | 'repair.dereverbClassical' | 'repair.trimSilence' | 'saturation.bitcrusher' | 'saturation.exciter' | 'saturation.hardClipper' | 'saturation.multibandExciter' | 'saturation.softClipper' | 'saturation.tape' | 'saturation.transformer' | 'saturation.tube' | 'saturation.waveshaper' | 'spectral.airBand' | 'spectral.lowEndFocus' | 'spectral.presenceEnhancer' | 'spectral.spectralShaper' | 'stereo.autoPan' | 'stereo.haasEnhancer' | 'stereo.imager' | 'stereo.monoMaker' | 'stereo.phaseAlign' | 'stereo.stereoBalance';
77
- type PairProcessor = 'match.applyMatchEq' | 'match.alignReferenceToSource' | 'match.abSwitch' | 'match.abCrossfade';
78
- type PairAnalysis = 'match.referenceLoudness' | 'match.tonalBalance' | 'match.tonalBalanceLogBands' | 'match.matchEqCurve' | 'match.estimateReferenceDelaySamples';
79
- type StereoAnalysis = 'stereo.monoCompatCheck' | 'stereo.monoCompatCheckLogBands';
80
- /**
81
- * Section type
82
- */
83
- declare const SectionType: {
84
- readonly Intro: 0;
85
- readonly Verse: 1;
86
- readonly PreChorus: 2;
87
- readonly Chorus: 3;
88
- readonly Bridge: 4;
89
- readonly Instrumental: 5;
90
- readonly Outro: 6;
91
- readonly Unknown: 7;
92
- };
93
- type SectionType = (typeof SectionType)[keyof typeof SectionType];
94
- /**
95
- * Detected musical key
96
- */
97
- interface Key {
98
- root: PitchClass;
99
- mode: Mode;
100
- confidence: number;
101
- name: string;
102
- shortName: string;
103
- }
104
- interface KeyDetectionOptions {
105
- nFft?: number;
106
- hopLength?: number;
107
- useHpss?: boolean;
108
- loudnessWeighted?: boolean;
109
- highPassHz?: number;
110
- modes?: Mode[] | ('major' | 'minor' | 'dorian' | 'phrygian' | 'lydian' | 'mixolydian' | 'locrian')[] | 'major-minor' | 'all' | 'modal';
111
- profile?: KeyProfile | KeyProfileName;
112
- genreHint?: 'auto' | 'edm' | 'electronic' | 'dance' | 'pop' | 'classical' | 'jazz' | string;
113
- }
114
- interface KeyCandidate {
115
- key: Key;
116
- correlation: number;
117
- }
118
- interface ChordDetectionOptions {
119
- minDuration?: number;
120
- smoothingWindow?: number;
121
- threshold?: number;
122
- useTriadsOnly?: boolean;
123
- nFft?: number;
124
- hopLength?: number;
125
- useBeatSync?: boolean;
126
- useHmm?: boolean;
127
- hmmBeamWidth?: number;
128
- useKeyContext?: boolean;
129
- keyRoot?: PitchClass;
130
- keyMode?: Mode;
131
- detectInversions?: boolean;
132
- chromaMethod?: 'stft' | 'nnls';
133
- }
134
- /**
135
- * Detected beat
136
- */
137
- interface Beat {
138
- time: number;
139
- strength: number;
140
- }
141
- /**
142
- * Detected chord
143
- */
144
- interface Chord {
145
- root: PitchClass;
146
- bass: PitchClass;
147
- quality: ChordQuality;
148
- start: number;
149
- end: number;
150
- confidence: number;
151
- name: string;
152
- }
153
- interface ChordAnalysisResult {
154
- chords: Chord[];
155
- }
156
- /**
157
- * Detected section
158
- */
159
- interface Section {
160
- type: SectionType;
161
- start: number;
162
- end: number;
163
- energyLevel: number;
164
- confidence: number;
165
- name: string;
166
- }
167
- /**
168
- * A single melody contour point (mirrors the C `SonareMelodyPoint`).
169
- */
170
- interface MelodyPoint {
171
- /** Frame time in seconds. */
172
- time: number;
173
- /** Estimated fundamental frequency in Hz (0 when unvoiced). */
174
- frequency: number;
175
- /** Voicing confidence in `[0, 1]`. */
176
- confidence: number;
177
- }
178
- /**
179
- * Melody analysis result (mirrors the C `SonareMelodyResult`).
180
- */
181
- interface MelodyResult {
182
- points: MelodyPoint[];
183
- pitchRangeOctaves: number;
184
- pitchStability: number;
185
- meanFrequency: number;
186
- vibratoRate: number;
187
- }
188
- /**
189
- * Constant-Q / Variable-Q transform magnitude result (mirrors the C
190
- * `SonareCqtResult`).
191
- */
192
- interface CqtResult {
193
- /** Number of frequency bins. */
194
- nBins: number;
195
- /** Number of time frames. */
196
- nFrames: number;
197
- /** Hop length in samples. */
198
- hopLength: number;
199
- /** Sample rate in Hz. */
200
- sampleRate: number;
201
- /** Row-major `[nBins x nFrames]` magnitude matrix. */
202
- magnitude: Float32Array;
203
- /** Center frequency (Hz) of each of the `nBins` bins. */
204
- frequencies: Float32Array;
205
- }
206
- /**
207
- * Timbre characteristics
208
- */
209
- interface Timbre {
210
- brightness: number;
211
- warmth: number;
212
- density: number;
213
- roughness: number;
214
- complexity: number;
215
- }
216
- /**
217
- * Dynamics characteristics
218
- */
219
- interface Dynamics {
220
- dynamicRangeDb: number;
221
- loudnessRangeDb: number;
222
- crestFactor: number;
223
- isCompressed: boolean;
224
- }
225
- /**
226
- * Time signature
227
- */
228
- interface TimeSignature {
229
- numerator: number;
230
- denominator: number;
231
- confidence: number;
232
- }
233
- /**
234
- * Rhythm features
235
- */
236
- interface RhythmFeatures {
237
- syncopation: number;
238
- grooveType: string;
239
- patternRegularity: number;
240
- }
241
- /**
242
- * Complete analysis result
243
- */
244
- interface AnalysisResult {
245
- bpm: number;
246
- bpmConfidence: number;
247
- key: Key;
248
- timeSignature: TimeSignature;
249
- beatTimes: Float32Array;
250
- beats: Beat[];
251
- chords: Chord[];
252
- sections: Section[];
253
- timbre: Timbre;
254
- dynamics: Dynamics;
255
- rhythm: RhythmFeatures;
256
- form: string;
257
- }
258
- /**
259
- * Room acoustic parameters from an impulse response
260
- */
261
- interface AcousticResult {
262
- rt60: number;
263
- edt: number;
264
- c50: number;
265
- c80: number;
266
- d50: number;
267
- rt60Bands: Float32Array;
268
- edtBands: Float32Array;
269
- c50Bands: Float32Array;
270
- c80Bands: Float32Array;
271
- confidence: number;
272
- isBlind: boolean;
273
- }
274
- /**
275
- * HPSS (Harmonic-Percussive Source Separation) result
276
- */
277
- interface HpssResult {
278
- harmonic: Float32Array;
279
- percussive: Float32Array;
280
- sampleRate: number;
281
- }
282
- /**
283
- * Mastering loudness/true-peak processing result
284
- */
285
- interface MasteringResult {
286
- samples: Float32Array;
287
- sampleRate: number;
288
- inputLufs: number;
289
- outputLufs: number;
290
- appliedGainDb: number;
291
- latencySamples?: number;
292
- }
293
- type MasteringProcessorParams = Record<string, number | boolean>;
294
- type PanMode = 'balance' | 'stereoPan' | 'stereo-pan' | 'dualPan' | 'dual-pan' | number;
295
- interface MixOptions {
296
- inputTrimDb?: number | number[];
297
- faderDb?: number | number[];
298
- pan?: number | number[];
299
- panMode?: PanMode | PanMode[];
300
- width?: number | number[];
301
- muted?: boolean | boolean[];
302
- }
303
- interface MixMeterSnapshot {
304
- peakDbL: number;
305
- peakDbR: number;
306
- rmsDbL: number;
307
- rmsDbR: number;
308
- correlation: number;
309
- monoCompatWidth: number;
310
- monoCompatPeak: number;
311
- monoCompatSideRms: number;
312
- likelyMonoCompatible: boolean;
313
- momentaryLufs: number;
314
- shortTermLufs: number;
315
- integratedLufs: number;
316
- gainReductionDb: number;
317
- truePeakDbL: number;
318
- truePeakDbR: number;
319
- maxTruePeakDb: number;
320
- seq: number;
321
- }
322
- interface MixResult {
323
- left: Float32Array;
324
- right: Float32Array;
325
- sampleRate: number;
326
- meters: MixMeterSnapshot[];
327
- }
328
- /** Mixed stereo master returned by {@link Mixer.processStereo}. */
329
- interface MixerProcessResult {
330
- left: Float32Array;
331
- right: Float32Array;
332
- sampleRate: number;
333
- }
334
- /**
335
- * Interpolation curve for scheduled automation events
336
- * (see {@link Mixer.scheduleInsertAutomation}).
337
- */
338
- type AutomationCurve = 'linear' | 'exponential' | 'hold' | 's-curve';
339
- /**
340
- * Pan law applied when computing left/right gains from a pan position
341
- * (see {@link Mixer.setPanLaw}). Maps to the underlying integer code.
342
- */
343
- type PanLaw = 'const3dB' | 'const4.5dB' | 'const6dB' | 'linear0dB';
344
- /**
345
- * Meter tap point for reading a strip's meter snapshot
346
- * (see {@link Mixer.meterTap} and {@link Mixer.stripMeter}).
347
- */
348
- type MeterTap = 'preFader' | 'postFader';
349
- /** Pre/post-fader send timing (see {@link Mixer.addSend}). */
350
- type SendTiming = 'preFader' | 'postFader';
351
- /** A single goniometer (left/right) sample returned by {@link Mixer.readGoniometerLatest}. */
352
- interface GoniometerPoint {
353
- left: number;
354
- right: number;
355
- }
356
- interface MasteringChainConfig {
357
- repair?: {
358
- denoise?: boolean;
359
- nFft?: number;
360
- hopLength?: number;
361
- ddAlpha?: number;
362
- gainFloor?: number;
363
- declick?: {
364
- threshold?: number;
365
- neighborRatio?: number;
366
- maxClickSamples?: number;
367
- lpcOrder?: number;
368
- residualRatio?: number;
369
- };
370
- dereverb?: {
371
- threshold?: number;
372
- attenuation?: number;
373
- nFft?: number;
374
- hopLength?: number;
375
- t60Sec?: number;
376
- lateDelayMs?: number;
377
- overSubtraction?: number;
378
- spectralFloor?: number;
379
- wpeEnabled?: boolean;
380
- wpeIterations?: number;
381
- wpeTaps?: number;
382
- wpeStrength?: number;
383
- };
384
- };
385
- eq?: {
386
- tiltDb?: number;
387
- pivotHz?: number;
388
- };
389
- dynamics?: {
390
- compressor?: {
391
- thresholdDb?: number;
392
- ratio?: number;
393
- attackMs?: number;
394
- releaseMs?: number;
395
- kneeDb?: number;
396
- makeupGainDb?: number;
397
- autoMakeup?: boolean;
398
- };
399
- deesser?: {
400
- frequencyHz?: number;
401
- thresholdDb?: number;
402
- ratio?: number;
403
- attackMs?: number;
404
- releaseMs?: number;
405
- rangeDb?: number;
406
- bandpassQ?: number;
407
- };
408
- transientShaper?: {
409
- attackGainDb?: number;
410
- sustainGainDb?: number;
411
- fastAttackMs?: number;
412
- fastReleaseMs?: number;
413
- slowAttackMs?: number;
414
- slowReleaseMs?: number;
415
- sensitivity?: number;
416
- maxGainDb?: number;
417
- gainSmoothingMs?: number;
418
- lookaheadMs?: number;
419
- };
420
- multibandComp?: {
421
- lowCutoffHz?: number;
422
- highCutoffHz?: number;
423
- lowThresholdDb?: number;
424
- lowRatio?: number;
425
- lowAttackMs?: number;
426
- lowReleaseMs?: number;
427
- midThresholdDb?: number;
428
- midRatio?: number;
429
- midAttackMs?: number;
430
- midReleaseMs?: number;
431
- highThresholdDb?: number;
432
- highRatio?: number;
433
- highAttackMs?: number;
434
- highReleaseMs?: number;
435
- };
436
- };
437
- saturation?: {
438
- tape?: {
439
- driveDb?: number;
440
- saturation?: number;
441
- hysteresis?: number;
442
- outputGainDb?: number;
443
- speedIps?: number;
444
- headBumpDb?: number;
445
- bias?: number;
446
- gapLoss?: number;
447
- };
448
- exciter?: {
449
- frequencyHz?: number;
450
- driveDb?: number;
451
- amount?: number;
452
- q?: number;
453
- evenOddMix?: number;
454
- };
455
- };
456
- spectral?: {
457
- airBand?: {
458
- amount?: number;
459
- shelfFrequencyHz?: number;
460
- dynamicThresholdDb?: number;
461
- dynamicRangeDb?: number;
462
- };
463
- };
464
- stereo?: {
465
- imager?: {
466
- width?: number;
467
- outputGainDb?: number;
468
- decorrelationAmount?: number;
469
- preserveEnergy?: boolean;
470
- };
471
- monoMaker?: {
472
- amount?: number;
473
- };
474
- };
475
- maximizer?: {
476
- truePeakLimiter?: {
477
- ceilingDb?: number;
478
- lookaheadMs?: number;
479
- releaseMs?: number;
480
- oversampleFactor?: number;
481
- applyGainAtInputRate?: boolean;
482
- };
483
- };
484
- loudness?: {
485
- targetLufs?: number;
486
- ceilingDb?: number;
487
- truePeakOversample?: number;
488
- };
489
- }
490
- interface MasteringChainResult extends MasteringResult {
491
- stages: string[];
492
- }
493
- interface MasteringStereoChainResult {
494
- left: Float32Array;
495
- right: Float32Array;
496
- sampleRate: number;
497
- inputLufs: number;
498
- outputLufs: number;
499
- appliedGainDb: number;
500
- stages: string[];
501
- latencySamples?: number;
502
- }
503
- interface MasteringStereoResult {
504
- left: Float32Array;
505
- right: Float32Array;
506
- sampleRate: number;
507
- inputLufs: number;
508
- outputLufs: number;
509
- appliedGainDb: number;
510
- latencySamples: number;
511
- }
512
- /**
513
- * STFT (Short-Time Fourier Transform) result
514
- */
515
- interface StftResult {
516
- nBins: number;
517
- nFrames: number;
518
- nFft: number;
519
- hopLength: number;
520
- sampleRate: number;
521
- magnitude: Float32Array;
522
- power: Float32Array;
523
- }
524
- /**
525
- * Mel spectrogram result
526
- */
527
- interface MelSpectrogramResult {
528
- nMels: number;
529
- nFrames: number;
530
- sampleRate: number;
531
- hopLength: number;
532
- power: Float32Array;
533
- db: Float32Array;
534
- }
535
- /**
536
- * MFCC result
537
- */
538
- interface MfccResult {
539
- nMfcc: number;
540
- nFrames: number;
541
- coefficients: Float32Array;
542
- }
543
- /**
544
- * STFT power spectrogram result (from inverse Mel reconstruction)
545
- */
546
- interface StftPowerResult {
547
- nBins: number;
548
- nFrames: number;
549
- power: Float32Array;
550
- }
551
- /**
552
- * Mel power spectrogram result (from inverse MFCC reconstruction)
553
- */
554
- interface MelPowerResult {
555
- nMels: number;
556
- nFrames: number;
557
- power: Float32Array;
558
- }
559
- /**
560
- * Chroma features result
561
- */
562
- interface ChromaResult {
563
- nChroma: number;
564
- nFrames: number;
565
- sampleRate: number;
566
- hopLength: number;
567
- features: Float32Array;
568
- meanEnergy: number[];
569
- }
570
- /**
571
- * Pitch detection result
572
- */
573
- interface PitchResult {
574
- f0: Float32Array;
575
- voicedProb: Float32Array;
576
- voicedFlag: boolean[];
577
- nFrames: number;
578
- medianF0: number;
579
- meanF0: number;
580
- }
581
- /**
582
- * Loudness measurement result (EBU R128 / ITU-R BS.1770)
583
- */
584
- interface LufsResult {
585
- integratedLufs: number;
586
- momentaryLufs: number;
587
- shortTermLufs: number;
588
- loudnessRange: number;
589
- }
590
- /**
591
- * Realtime equalizer spectrum snapshot.
592
- *
593
- * Mirrors the C++ `EqualizerSpectrumSnapshot`: `preLeft`/`preRight` and
594
- * `postLeft`/`postRight` are the pre- and post-EQ spectrum streams (trimmed to
595
- * their valid count). `bandGainDb` holds per-band applied gain (24 entries),
596
- * `profileDb` the smoothed magnitude profile (16 entries), `lastAutoGainDb`
597
- * the latest auto-gain compensation, and `seq` increments each time a new
598
- * snapshot is published.
599
- */
600
- interface EqSpectrumSnapshot {
601
- preLeft: Float32Array;
602
- preRight: Float32Array;
603
- postLeft: Float32Array;
604
- postRight: Float32Array;
605
- bandGainDb: Float32Array;
606
- profileDb: Float32Array;
607
- lastAutoGainDb: number;
608
- seq: number;
609
- }
610
- /**
611
- * Equalizer band type (string union mirroring `sonare::mastering::eq::EqBandType`).
612
- */
613
- type EqBandType = 'Peak' | 'LowShelf' | 'HighShelf' | 'LowPass' | 'HighPass' | 'BandPass' | 'Notch' | 'TiltShelf' | 'FlatTilt';
614
- /** Biquad coefficient design mode. */
615
- type EqCoeffMode = 'Rbj' | 'Vicanek';
616
- /** Stereo placement for an EQ band. */
617
- type EqStereoPlacement = 'Stereo' | 'Left' | 'Right' | 'Mid' | 'Side';
618
- /** Per-band phase behaviour. */
619
- type EqBandPhase = 'Inherit' | 'ZeroLatency' | 'NaturalPhase' | 'LinearPhase';
620
- /**
621
- * Equalizer band configuration accepted by {@link StreamingEqualizer.setBand}.
622
- *
623
- * All fields are optional; omitted values fall back to the C++ band defaults
624
- * (Peak, 1000 Hz, 0 dB gain, Butterworth Q, disabled).
625
- */
626
- interface EqBand {
627
- type?: EqBandType;
628
- frequencyHz?: number;
629
- gainDb?: number;
630
- q?: number;
631
- enabled?: boolean;
632
- coeffMode?: EqCoeffMode;
633
- slopeDbOct?: number;
634
- placement?: EqStereoPlacement;
635
- phase?: EqBandPhase;
636
- soloed?: boolean;
637
- bypassed?: boolean;
638
- proportionalQ?: boolean;
639
- proportionalQStrength?: number;
640
- dynamic?: boolean;
641
- thresholdDb?: number;
642
- autoThreshold?: boolean;
643
- ratio?: number;
644
- rangeDb?: number;
645
- attackMs?: number;
646
- releaseMs?: number;
647
- lookaheadMs?: number;
648
- externalSidechain?: boolean;
649
- sidechainFreqHz?: number;
650
- sidechainQ?: number;
651
- }
652
- /** Construction options for {@link StreamingEqualizer}. */
653
- interface StreamingEqualizerConfig {
654
- sampleRate?: number;
655
- maxBlockSize?: number;
656
- }
657
- /** Configuration for {@link StreamingRetune}. */
658
- interface StreamingRetuneConfig {
659
- /** Pitch shift in semitones, clamped by the native processor to +/-24. */
660
- semitones?: number;
661
- /** Wet/dry mix, clamped by the native processor to 0..1. */
662
- mix?: number;
663
- /** Grain size in samples. Use 0/omit to derive it from the sample rate. */
664
- grainSize?: number;
665
- }
666
- type VoicePresetId = 'neutral-monitor' | 'bright-idol' | 'soft-whisper' | 'deep-narrator' | 'robot-mascot' | 'dark-villain';
667
- interface RealtimeVoiceChangerPreset {
668
- schemaVersion: 1;
669
- id?: string;
670
- name?: string;
671
- description?: string;
672
- macros?: Record<string, number>;
673
- dsp?: Record<string, unknown>;
674
- }
675
- type RealtimeVoiceChangerConfigInput = VoicePresetId | RealtimeVoiceChangerPreset;
676
- /**
677
- * Flat (POD) realtime voice-changer configuration. Field names mirror the
678
- * C ABI `SonareRealtimeVoiceChangerConfig` / Python POD exactly (snake_case),
679
- * so a config can be round-tripped across bindings without renaming.
680
- */
681
- interface RealtimeVoiceChangerPodConfig {
682
- input_gain_db: number;
683
- output_gain_db: number;
684
- wet_mix: number;
685
- retune_semitones: number;
686
- retune_mix: number;
687
- retune_grain_size: number;
688
- formant_factor: number;
689
- formant_amount: number;
690
- formant_body: number;
691
- formant_brightness: number;
692
- formant_nasal: number;
693
- eq_highpass_hz: number;
694
- eq_body_db: number;
695
- eq_presence_db: number;
696
- eq_air_db: number;
697
- gate_threshold_db: number;
698
- gate_attack_ms: number;
699
- gate_release_ms: number;
700
- gate_range_db: number;
701
- compressor_threshold_db: number;
702
- compressor_ratio: number;
703
- compressor_attack_ms: number;
704
- compressor_release_ms: number;
705
- compressor_makeup_gain_db: number;
706
- deesser_frequency_hz: number;
707
- deesser_threshold_db: number;
708
- deesser_ratio: number;
709
- deesser_range_db: number;
710
- reverb_mix: number;
711
- reverb_time_ms: number;
712
- reverb_damping: number;
713
- reverb_seed: number;
714
- limiter_ceiling_db: number;
715
- limiter_release_ms: number;
716
- }
717
- /** Options for {@link StreamingEqualizer.match}. */
718
- interface EqMatchOptions {
719
- sampleRate?: number;
720
- maxBands?: number;
721
- }
722
-
723
- /**
724
- * A detected chord change in the progression
725
- */
726
- interface ChordChange {
727
- root: PitchClass;
728
- quality: ChordQuality;
729
- startTime: number;
730
- confidence: number;
731
- }
732
- /**
733
- * A chord detected at bar boundary (beat-synchronized)
734
- */
735
- interface BarChord {
736
- barIndex: number;
737
- root: PitchClass;
738
- quality: ChordQuality;
739
- startTime: number;
740
- confidence: number;
741
- }
742
- /**
743
- * Pattern score for known chord progressions
744
- */
745
- interface PatternScore {
746
- name: string;
747
- score: number;
748
- }
749
- /**
750
- * Progressive estimation results for BPM, Key, and Chord
751
- */
752
- interface ProgressiveEstimate {
753
- bpm: number;
754
- bpmConfidence: number;
755
- bpmCandidateCount: number;
756
- key: PitchClass;
757
- keyMinor: boolean;
758
- keyConfidence: number;
759
- chordRoot: PitchClass;
760
- chordQuality: ChordQuality;
761
- chordConfidence: number;
762
- chordStartTime: number;
763
- chordProgression: ChordChange[];
764
- barChordProgression: BarChord[];
765
- currentBar: number;
766
- barDuration: number;
767
- votedPattern: BarChord[];
768
- patternLength: number;
769
- detectedPatternName: string;
770
- detectedPatternScore: number;
771
- allPatternScores: PatternScore[];
772
- accumulatedSeconds: number;
773
- usedFrames: number;
774
- updated: boolean;
775
- }
776
- /**
777
- * Statistics and current state of the analyzer
778
- */
779
- interface AnalyzerStats {
780
- totalFrames: number;
781
- totalSamples: number;
782
- durationSeconds: number;
783
- estimate: ProgressiveEstimate;
784
- }
785
- /**
786
- * Frame buffer with analysis results
787
- */
788
- interface FrameBuffer {
789
- nFrames: number;
790
- timestamps: Float32Array;
791
- mel: Float32Array;
792
- chroma: Float32Array;
793
- onsetStrength: Float32Array;
794
- rmsEnergy: Float32Array;
795
- spectralCentroid: Float32Array;
796
- spectralFlatness: Float32Array;
797
- chordRoot: Int32Array;
798
- chordQuality: Int32Array;
799
- chordConfidence: Float32Array;
800
- }
801
- interface StreamFramesU8 {
802
- nFrames: number;
803
- nMels: number;
804
- timestamps: Float32Array;
805
- mel: Uint8Array;
806
- chroma: Uint8Array;
807
- onsetStrength: Uint8Array;
808
- rmsEnergy: Uint8Array;
809
- spectralCentroid: Uint8Array;
810
- spectralFlatness: Uint8Array;
811
- }
812
- interface StreamFramesI16 {
813
- nFrames: number;
814
- nMels: number;
815
- timestamps: Float32Array;
816
- mel: Int16Array;
817
- chroma: Int16Array;
818
- onsetStrength: Int16Array;
819
- rmsEnergy: Int16Array;
820
- spectralCentroid: Int16Array;
821
- spectralFlatness: Int16Array;
822
- }
823
- /**
824
- * Configuration for StreamAnalyzer
825
- */
826
- interface StreamConfig {
827
- sampleRate: number;
828
- nFft?: number;
829
- hopLength?: number;
830
- nMels?: number;
831
- fmin?: number;
832
- fmax?: number;
833
- tuningRefHz?: number;
834
- computeMagnitude?: boolean;
835
- computeMel?: boolean;
836
- computeChroma?: boolean;
837
- computeOnset?: boolean;
838
- computeSpectral?: boolean;
839
- emitEveryNFrames?: number;
840
- magnitudeDownsample?: number;
841
- keyUpdateIntervalSec?: number;
842
- bpmUpdateIntervalSec?: number;
843
- window?: number;
844
- outputFormat?: number;
845
- }
846
-
847
- /**
848
- * sonare - Audio Analysis Library
849
- *
850
- * @example
851
- * ```typescript
852
- * import { init, detectBpm, detectKey, analyze } from '@libraz/sonare';
853
- *
854
- * await init();
855
- *
856
- * // Detect BPM from audio samples
857
- * const bpm = detectBpm(samples, sampleRate);
858
- *
859
- * // Detect musical key
860
- * const key = detectKey(samples, sampleRate);
861
- *
862
- * // Full analysis
863
- * const result = analyze(samples, sampleRate);
864
- * ```
865
- */
866
-
867
- type EngineClip = WasmEngineClip;
868
- type EngineParameterInfo = WasmEngineParameterInfo;
869
- type EngineAutomationPoint = WasmEngineAutomationPoint;
870
- type EngineMarker = WasmEngineMarker;
871
- type EngineMetronomeConfig = WasmEngineMetronomeConfig;
872
- type EngineGraphSpec = WasmEngineGraphSpec;
873
- type EngineCaptureStatus = WasmEngineCaptureStatus;
874
- type EngineBounceOptions = WasmEngineBounceOptions;
875
- type EngineBounceResult = WasmEngineBounceResult;
876
- type EngineFreezeOptions = WasmEngineFreezeOptions;
877
- type EngineFreezeResult = WasmEngineFreezeResult;
878
- type EngineTelemetry = WasmEngineTelemetry;
879
- type EngineMeterTelemetry = WasmEngineMeterTelemetry;
880
- type EngineTransportState = WasmEngineTransportState;
881
- /** Row-major 2-D matrix as a flat buffer plus its dimensions. */
882
- type Matrix2dResult = WasmMatrix2dResult;
883
- /** NMF factor matrices { w, h } from {@link decompose}. */
884
- type DecomposeResult = WasmDecomposeResult;
885
- /** Harmonic / percussive / residual signals from {@link hpssWithResidual}. */
886
- type HpssWithResidualResult = WasmHpssWithResidualResult;
887
- declare const EXPECTED_ENGINE_ABI_VERSION = 2;
888
- interface EngineCapabilities {
889
- engineAbiVersion: number;
890
- expectedEngineAbiVersion: number;
891
- abiCompatible: boolean;
892
- sharedArrayBuffer: boolean;
893
- atomics: boolean;
894
- audioWorklet: boolean;
895
- mode: 'sab' | 'postMessage';
896
- }
897
- interface MixerRealtimeBuffer {
898
- leftInputs: Float32Array[];
899
- rightInputs: Float32Array[];
900
- outLeft: Float32Array;
901
- outRight: Float32Array;
902
- process: (numSamples?: number) => void;
903
- }
904
- /**
905
- * Zero-copy realtime buffer pair for {@link RealtimeVoiceChanger} mono
906
- * processing. The `input` / `output` `Float32Array`s are typed-memory views
907
- * onto the WASM heap — write samples into `input`, call `process()`, then
908
- * read from `output`. The views are owned by the {@link RealtimeVoiceChanger}
909
- * and remain valid until `delete()` is called on it.
910
- */
911
- interface RealtimeVoiceChangerMonoBuffer {
912
- input: Float32Array;
913
- output: Float32Array;
914
- process: () => void;
915
- }
916
- /**
917
- * Zero-copy realtime buffer pair for {@link RealtimeVoiceChanger} interleaved
918
- * multi-channel processing. Layout is L0,R0,L1,R1,... for stereo. The views
919
- * are owned by the {@link RealtimeVoiceChanger}.
920
- */
921
- interface RealtimeVoiceChangerInterleavedBuffer {
922
- input: Float32Array;
923
- output: Float32Array;
924
- channels: number;
925
- process: () => void;
926
- }
927
- /**
928
- * Zero-copy realtime buffer for {@link RealtimeVoiceChanger} planar stereo
929
- * processing. Each entry in `channels` is a heap-backed `Float32Array` for one
930
- * channel (matching AudioWorklet's native layout). Process happens in place:
931
- * write samples into each channel view, call `process()`, then read back from
932
- * the same views.
933
- */
934
- interface RealtimeVoiceChangerPlanarBuffer {
935
- channels: Float32Array[];
936
- process: () => void;
937
- }
938
- /**
939
- * Per-call validation options accepted by guarded wrappers. Empty-buffer
940
- * checks are always performed; pass `{ validate: false }` to opt out of the
941
- * O(n) NaN/Inf scan on hot paths.
942
- */
943
- interface ValidateOptions {
944
- validate?: boolean;
945
- }
946
- /**
947
- * Initialize the WASM module.
948
- * Must be called before using any analysis functions.
949
- *
950
- * @param options - Optional module configuration
951
- * @returns Promise that resolves when initialization is complete
952
- */
953
- declare function init(options?: {
954
- locateFile?: (path: string, prefix: string) => string;
955
- }): Promise<void>;
956
- /**
957
- * Check if the module is initialized.
958
- */
959
- declare function isInitialized(): boolean;
960
- /**
961
- * Get the library version.
962
- */
963
- declare function version(): string;
964
- declare function engineAbiVersion(): number;
965
- declare function voiceChangerAbiVersion(): number;
966
- /**
967
- * Map a voice-character preset ordinal (or canonical id) to its canonical id
968
- * string (e.g. `'bright-idol'`). Returns `null` for an out-of-range ordinal.
969
- */
970
- declare function voiceCharacterPresetId(preset: VoicePresetId | number): string | null;
971
- /**
972
- * Return the canonical (normalized) flat POD config for a built-in voice
973
- * preset, skipping the JSON round-trip. Accepts a canonical preset id or its
974
- * integer ordinal. Returns `null` for an out-of-range ordinal.
975
- */
976
- declare function realtimeVoiceChangerPresetConfig(preset: VoicePresetId | number): RealtimeVoiceChangerPodConfig | null;
977
- declare function engineCapabilities(): EngineCapabilities;
978
- declare class RealtimeEngine {
979
- private native;
980
- constructor(sampleRate?: number, maxBlockSize?: number, commandCapacity?: number, telemetryCapacity?: number);
981
- prepare(sampleRate: number, maxBlockSize: number, commandCapacity?: number, telemetryCapacity?: number): void;
982
- /** Queue a sample-accurate parameter change (engine kSetParam). */
983
- setParameter(paramId: number, value: number, renderFrame?: number): void;
984
- /** Queue a smoothed parameter change (engine kSetParamSmoothed). */
985
- setParameterSmoothed(paramId: number, value: number, renderFrame?: number): void;
986
- /** Read back the current transport state snapshot. */
987
- getTransportState(): EngineTransportState;
988
- play(renderFrame?: number): void;
989
- stop(renderFrame?: number): void;
990
- seekSample(timelineSample: number, renderFrame?: number): void;
991
- seekPpq(ppq: number, renderFrame?: number): void;
992
- setTempo(bpm: number): void;
993
- setTimeSignature(numerator: number, denominator: number): void;
994
- setLoop(startPpq: number, endPpq: number, enabled?: boolean): void;
995
- addParameter(info: EngineParameterInfo): void;
996
- parameterCount(): number;
997
- parameterInfoByIndex(index: number): EngineParameterInfo;
998
- parameterInfo(id: number): EngineParameterInfo;
999
- setAutomationLane(paramId: number, points: EngineAutomationPoint[]): void;
1000
- automationLaneCount(): number;
1001
- setMarkers(markers: EngineMarker[]): void;
1002
- markerCount(): number;
1003
- markerByIndex(index: number): EngineMarker;
1004
- marker(id: number): EngineMarker;
1005
- seekMarker(markerId: number, renderFrame?: number): void;
1006
- setLoopFromMarkers(startMarkerId: number, endMarkerId: number): void;
1007
- setMetronome(config: EngineMetronomeConfig): void;
1008
- metronome(): Required<EngineMetronomeConfig>;
1009
- countInEndSample(startSample: number, bars: number): number;
1010
- setGraph(spec: EngineGraphSpec): void;
1011
- graphNodeCount(): number;
1012
- graphConnectionCount(): number;
1013
- setClips(clips: EngineClip[]): void;
1014
- clipCount(): number;
1015
- setCaptureBuffer(numChannels: number, capacityFrames: number): void;
1016
- armCapture(armed?: boolean): void;
1017
- setCapturePunch(startSample: number, endSample: number, enabled?: boolean): void;
1018
- resetCapture(): void;
1019
- captureStatus(): EngineCaptureStatus;
1020
- capturedAudio(): Float32Array[];
1021
- process(channels: Float32Array[]): Float32Array[];
1022
- processWithMonitor(channels: Float32Array[]): WasmEngineProcessWithMonitorResult;
1023
- renderOffline(channels: Float32Array[], blockSize?: number): Float32Array[];
1024
- bounceOffline(options: EngineBounceOptions): EngineBounceResult;
1025
- freezeOffline(options: EngineFreezeOptions): EngineFreezeResult;
1026
- drainTelemetry(maxRecords?: number): EngineTelemetry[];
1027
- drainMeterTelemetry(maxRecords?: number): EngineMeterTelemetry[];
1028
- destroy(): void;
1029
- }
1030
- /**
1031
- * Detect BPM from audio samples.
1032
- *
1033
- * @param samples - Audio samples (mono, float32)
1034
- * @param sampleRate - Sample rate in Hz (default: 22050)
1035
- * @returns Detected BPM
1036
- */
1037
- declare function detectBpm(samples: Float32Array, sampleRate?: number): number;
1038
- /**
1039
- * Detect musical key from audio samples.
1040
- *
1041
- * @param samples - Audio samples (mono, float32)
1042
- * @param sampleRate - Sample rate in Hz (default: 22050)
1043
- * @returns Detected key
1044
- */
1045
- declare function detectKey(samples: Float32Array, sampleRate?: number, options?: KeyDetectionOptions): Key;
1046
- declare function detectKeyCandidates(samples: Float32Array, sampleRate?: number, options?: KeyDetectionOptions): KeyCandidate[];
1047
- /**
1048
- * Detect onset times from audio samples.
1049
- *
1050
- * @param samples - Audio samples (mono, float32)
1051
- * @param sampleRate - Sample rate in Hz (default: 22050)
1052
- * @returns Array of onset times in seconds
1053
- */
1054
- declare function detectOnsets(samples: Float32Array, sampleRate?: number): Float32Array;
1055
- /**
1056
- * Detect beat times from audio samples.
1057
- *
1058
- * @param samples - Audio samples (mono, float32)
1059
- * @param sampleRate - Sample rate in Hz (default: 22050)
1060
- * @returns Array of beat times in seconds
1061
- */
1062
- declare function detectBeats(samples: Float32Array, sampleRate?: number): Float32Array;
1063
- /**
1064
- * Detect downbeat times from audio samples.
1065
- *
1066
- * @param samples - Audio samples (mono, float32)
1067
- * @param sampleRate - Sample rate in Hz (default: 22050)
1068
- * @returns Array of downbeat times in seconds
1069
- */
1070
- declare function detectDownbeats(samples: Float32Array, sampleRate?: number): Float32Array;
1071
- /**
1072
- * Detect chords from audio samples.
1073
- *
1074
- * @param samples - Audio samples (mono, float32)
1075
- * @param sampleRate - Sample rate in Hz (default: 22050)
1076
- * @param options - Optional chord detection settings
1077
- * @returns Detected chord segments
1078
- */
1079
- declare function detectChords(samples: Float32Array, sampleRate?: number, options?: ChordDetectionOptions): ChordAnalysisResult;
1080
- /**
1081
- * Perform complete music analysis.
1082
- *
1083
- * @param samples - Audio samples (mono, float32)
1084
- * @param sampleRate - Sample rate in Hz (default: 22050)
1085
- * @returns Complete analysis result
1086
- */
1087
- declare function analyze(samples: Float32Array, sampleRate?: number): AnalysisResult;
1088
- declare function analyzeImpulseResponse(samples: Float32Array, sampleRate?: number, nOctaveBands?: number): AcousticResult;
1089
- declare function detectAcoustic(samples: Float32Array, sampleRate?: number, nOctaveBands?: number, nThirdOctaveSubbands?: number, minDecayDb?: number, noiseFloorMarginDb?: number): AcousticResult;
1090
- /**
1091
- * Perform complete music analysis with progress reporting.
1092
- *
1093
- * @param samples - Audio samples (mono, float32)
1094
- * @param sampleRate - Sample rate in Hz (default: 22050)
1095
- * @param onProgress - Progress callback (progress: 0-1, stage: string)
1096
- * @returns Complete analysis result
1097
- */
1098
- declare function analyzeWithProgress(samples: Float32Array, sampleRate: number | undefined, onProgress: ProgressCallback): AnalysisResult;
1099
- interface BpmCandidate {
1100
- bpm: number;
1101
- confidence: number;
1102
- }
1103
- interface BpmAnalysisResult {
1104
- bpm: number;
1105
- confidence: number;
1106
- candidates: BpmCandidate[];
1107
- autocorrelation: Float32Array;
1108
- tempogram: Float32Array;
1109
- }
1110
- interface RhythmAnalysisResult {
1111
- timeSignature: {
1112
- numerator: number;
1113
- denominator: number;
1114
- confidence: number;
1115
- };
1116
- syncopation: number;
1117
- grooveType: string;
1118
- patternRegularity: number;
1119
- tempoStability: number;
1120
- bpm: number;
1121
- beatIntervals: Float32Array;
1122
- }
1123
- interface DynamicsAnalysisResult {
1124
- dynamicRangeDb: number;
1125
- peakDb: number;
1126
- rmsDb: number;
1127
- crestFactor: number;
1128
- loudnessRangeDb: number;
1129
- isCompressed: boolean;
1130
- /** Loudness curve timestamps (seconds), parallel to {@link loudnessRmsDb}. */
1131
- loudnessTimes: Float32Array;
1132
- /** Loudness curve RMS values (dB), parallel to {@link loudnessTimes}. */
1133
- loudnessRmsDb: Float32Array;
1134
- }
1135
- /** Timbre metrics for one analysis window. Entries are ordered by time in `timbreOverTime`. */
1136
- interface TimbreFrame {
1137
- brightness: number;
1138
- warmth: number;
1139
- density: number;
1140
- roughness: number;
1141
- complexity: number;
1142
- }
1143
- interface TimbreAnalysisResult extends TimbreFrame {
1144
- spectralCentroid: Float32Array;
1145
- spectralFlatness: Float32Array;
1146
- spectralRolloff: Float32Array;
1147
- /** Time-varying timbre metrics, one entry per analysis window. */
1148
- timbreOverTime: TimbreFrame[];
1149
- }
1150
- /**
1151
- * Detailed BPM analysis (BPM, confidence, alternate candidates, autocorrelation,
1152
- * tempogram). Matches the Node `analyzeBpm` / Python `analyze_bpm` surface.
1153
- */
1154
- declare function analyzeBpm(samples: Float32Array, sampleRate?: number, bpmMin?: number, bpmMax?: number, startBpm?: number, nFft?: number, hopLength?: number, maxCandidates?: number): BpmAnalysisResult;
1155
- /**
1156
- * Detailed rhythm analysis (time signature, groove, syncopation, beat intervals).
1157
- */
1158
- declare function analyzeRhythm(samples: Float32Array, sampleRate?: number, bpmMin?: number, bpmMax?: number, startBpm?: number, nFft?: number, hopLength?: number): RhythmAnalysisResult;
1159
- /**
1160
- * Dynamics analysis (RMS, peak, crest factor, LRA, loudness curve).
1161
- */
1162
- declare function analyzeDynamics(samples: Float32Array, sampleRate?: number, windowSec?: number, hopLength?: number, compressionThreshold?: number): DynamicsAnalysisResult;
1163
- /**
1164
- * Timbre analysis (brightness/warmth/density/roughness/complexity plus spectral
1165
- * features and per-window timbre frames).
1166
- */
1167
- declare function analyzeTimbre(samples: Float32Array, sampleRate?: number, nFft?: number, hopLength?: number, nMels?: number, nMfcc?: number, windowSec?: number): TimbreAnalysisResult;
1168
- /**
1169
- * Whether this WASM build was compiled with FFmpeg support. Mirrors Node /
1170
- * Python `hasFfmpegSupport`. In the published WASM binding this currently
1171
- * always returns `false` (FFmpeg is not bundled into the .wasm), but the API
1172
- * exists so caller code can branch on capabilities portably.
1173
- */
1174
- declare function hasFfmpegSupport(): boolean;
1175
- /**
1176
- * Perform Harmonic-Percussive Source Separation (HPSS).
1177
- *
1178
- * @param samples - Audio samples (mono, float32)
1179
- * @param sampleRate - Sample rate in Hz (default: 22050)
1180
- * @param kernelHarmonic - Horizontal median filter size for harmonic (default: 31)
1181
- * @param kernelPercussive - Vertical median filter size for percussive (default: 31)
1182
- * @returns Separated harmonic and percussive components
1183
- */
1184
- declare function hpss(samples: Float32Array, sampleRate?: number, kernelHarmonic?: number, kernelPercussive?: number): HpssResult;
1185
- /**
1186
- * Extract harmonic component from audio.
1187
- *
1188
- * @param samples - Audio samples (mono, float32)
1189
- * @param sampleRate - Sample rate in Hz
1190
- * @returns Harmonic component
1191
- */
1192
- declare function harmonic(samples: Float32Array, sampleRate: number): Float32Array;
1193
- /**
1194
- * Extract percussive component from audio.
1195
- *
1196
- * @param samples - Audio samples (mono, float32)
1197
- * @param sampleRate - Sample rate in Hz
1198
- * @returns Percussive component
1199
- */
1200
- declare function percussive(samples: Float32Array, sampleRate: number): Float32Array;
1201
- /**
1202
- * Time-stretch audio without changing pitch.
1203
- *
1204
- * @param samples - Audio samples (mono, float32)
1205
- * @param sampleRate - Sample rate in Hz
1206
- * @param rate - Time stretch rate (0.5 = double duration, 2.0 = half duration)
1207
- * @returns Time-stretched audio
1208
- */
1209
- declare function timeStretch(samples: Float32Array, sampleRate: number, rate: number): Float32Array;
1210
- /**
1211
- * Pitch-shift audio without changing duration.
1212
- *
1213
- * @param samples - Audio samples (mono, float32)
1214
- * @param sampleRate - Sample rate in Hz
1215
- * @param semitones - Pitch shift in semitones (+12 = one octave up, -12 = one octave down)
1216
- * @returns Pitch-shifted audio
1217
- */
1218
- declare function pitchShift(samples: Float32Array, sampleRate: number, semitones: number): Float32Array;
1219
- /**
1220
- * Pitch-correct audio from a current MIDI note to a target MIDI note.
1221
- *
1222
- * @param samples - Audio samples (mono, float32)
1223
- * @param sampleRate - Sample rate in Hz
1224
- * @param currentMidi - Detected/current MIDI note number
1225
- * @param targetMidi - Desired MIDI note number
1226
- * @returns Pitch-corrected audio
1227
- */
1228
- declare function pitchCorrectToMidi(samples: Float32Array, sampleRate?: number, currentMidi?: number, targetMidi?: number): Float32Array;
1229
- /**
1230
- * Time-stretch a note region between two sample offsets without changing pitch.
1231
- *
1232
- * @param samples - Audio samples (mono, float32)
1233
- * @param sampleRate - Sample rate in Hz
1234
- * @param onsetSample - Note onset position in samples
1235
- * @param offsetSample - Note offset position in samples
1236
- * @param stretchRatio - Stretch ratio (0.5 = double duration, 2.0 = half duration)
1237
- * @returns Audio with the note region stretched
1238
- */
1239
- declare function noteStretch(samples: Float32Array, sampleRate?: number, onsetSample?: number, offsetSample?: number, stretchRatio?: number): Float32Array;
1240
- /**
1241
- * Apply a voice change by shifting pitch and formants independently.
1242
- *
1243
- * @param samples - Audio samples (mono, float32)
1244
- * @param sampleRate - Sample rate in Hz
1245
- * @param pitchSemitones - Pitch shift in semitones
1246
- * @param formantFactor - Formant scaling factor (1.0 = unchanged)
1247
- * @returns Voice-changed audio
1248
- */
1249
- declare function voiceChange(samples: Float32Array, sampleRate?: number, pitchSemitones?: number, formantFactor?: number, options?: ValidateOptions): Float32Array;
1250
- /**
1251
- * Normalize audio to target peak level.
1252
- *
1253
- * @param samples - Audio samples (mono, float32)
1254
- * @param sampleRate - Sample rate in Hz
1255
- * @param targetDb - Target peak level in dB (default: 0 dB = full scale)
1256
- * @returns Normalized audio
1257
- */
1258
- declare function normalize(samples: Float32Array, sampleRate: number, targetDb?: number): Float32Array;
1259
- /**
1260
- * Apply mastering loudness normalization with a true-peak ceiling.
1261
- *
1262
- * @param samples - Audio samples (mono, float32)
1263
- * @param sampleRate - Sample rate in Hz (default: 22050)
1264
- * @param targetLufs - Target integrated LUFS (default: -14)
1265
- * @param ceilingDb - True/sample peak ceiling in dBFS (default: -1)
1266
- * @param truePeakOversample - Oversampling factor used for peak estimation
1267
- * @returns Processed audio and loudness metadata
1268
- */
1269
- declare function mastering(samples: Float32Array, sampleRate?: number, targetLufs?: number, ceilingDb?: number, truePeakOversample?: number): MasteringResult;
1270
- declare function masteringProcessorNames(): SoloProcessor[];
1271
- declare function masteringPairProcessorNames(): PairProcessor[];
1272
- declare function masteringPairAnalysisNames(): PairAnalysis[];
1273
- declare function masteringStereoAnalysisNames(): StereoAnalysis[];
1274
- declare function masteringProcess(processorName: SoloProcessor, samples: Float32Array, sampleRate?: number, params?: MasteringProcessorParams): MasteringResult;
1275
- declare function masteringProcessStereo(processorName: SoloProcessor, left: Float32Array, right: Float32Array, sampleRate?: number, params?: MasteringProcessorParams): MasteringStereoResult;
1276
- declare function masteringPairProcess(processorName: PairProcessor, source: Float32Array, reference: Float32Array, sampleRate?: number, params?: MasteringProcessorParams): MasteringResult;
1277
- declare function masteringPairAnalyze(analysisName: PairAnalysis, source: Float32Array, reference: Float32Array, sampleRate?: number, params?: MasteringProcessorParams): string;
1278
- declare function masteringStereoAnalyze(analysisName: StereoAnalysis, left: Float32Array, right: Float32Array, sampleRate?: number, params?: MasteringProcessorParams): string;
1279
- declare function masteringAssistantSuggest(samples: Float32Array, sampleRate?: number, params?: MasteringProcessorParams): string;
1280
- declare function masteringAudioProfile(samples: Float32Array, sampleRate?: number, params?: MasteringProcessorParams): string;
1281
- declare function masteringStreamingPreview(samples: Float32Array, sampleRate?: number, platforms?: StreamingPlatform[]): string;
1282
- /** Options for `masteringRepairDeclick`. */
1283
- interface DeclickOptions {
1284
- threshold?: number;
1285
- neighborRatio?: number;
1286
- maxClickSamples?: number;
1287
- lpcOrder?: number;
1288
- residualRatio?: number;
1289
- }
1290
- /** Algorithms accepted by `masteringRepairDenoiseClassical`. */
1291
- type DenoiseClassicalMode = 'logMmse' | 'mmseStsa' | 'spectralSubtraction';
1292
- /** Noise PSD estimators accepted by `masteringRepairDenoiseClassical`. */
1293
- type DenoiseClassicalNoiseEstimator = 'quantile' | 'mcra' | 'imcra';
1294
- /** Options for `masteringRepairDenoiseClassical`. */
1295
- interface DenoiseClassicalOptions {
1296
- mode?: DenoiseClassicalMode;
1297
- noiseEstimator?: DenoiseClassicalNoiseEstimator;
1298
- nFft?: number;
1299
- hopLength?: number;
1300
- ddAlpha?: number;
1301
- gainFloor?: number;
1302
- overSubtraction?: number;
1303
- spectralFloor?: number;
1304
- noiseEstimationQuantile?: number;
1305
- speechPresenceGain?: boolean;
1306
- gainSmoothing?: boolean;
1307
- }
1308
- /** Offline LPC-based declicker. */
1309
- declare function masteringRepairDeclick(samples: Float32Array, sampleRate: number, options?: DeclickOptions): Float32Array;
1310
- /** Offline STFT-domain classical denoiser (LogMMSE / MMSE-STSA / SpectralSubtraction). */
1311
- declare function masteringRepairDenoiseClassical(samples: Float32Array, sampleRate: number, options?: DenoiseClassicalOptions): Float32Array;
1312
- /** Options for `masteringRepairDeclip`. */
1313
- interface DeclipOptions {
1314
- clipThreshold?: number;
1315
- lpcOrder?: number;
1316
- iterations?: number;
1317
- lpcBlend?: number;
1318
- }
1319
- /** Algorithms accepted by `masteringRepairDecrackle`. */
1320
- type DecrackleMode = 'median' | 'waveletShrinkage';
1321
- /** Options for `masteringRepairDecrackle`. */
1322
- interface DecrackleOptions {
1323
- threshold?: number;
1324
- mode?: DecrackleMode;
1325
- levels?: number;
1326
- }
1327
- /** Options for `masteringRepairDehum`. */
1328
- interface DehumOptions {
1329
- fundamentalHz?: number;
1330
- harmonics?: number;
1331
- q?: number;
1332
- adaptive?: boolean;
1333
- searchRangeHz?: number;
1334
- adaptation?: number;
1335
- frameSize?: number;
1336
- pllBandwidth?: number;
1337
- }
1338
- /** Options for `masteringRepairDereverbClassical`. */
1339
- interface DereverbClassicalOptions {
1340
- threshold?: number;
1341
- attenuation?: number;
1342
- nFft?: number;
1343
- hopLength?: number;
1344
- t60Sec?: number;
1345
- lateDelayMs?: number;
1346
- overSubtraction?: number;
1347
- spectralFloor?: number;
1348
- wpeEnabled?: boolean;
1349
- wpeIterations?: number;
1350
- wpeTaps?: number;
1351
- wpeStrength?: number;
1352
- }
1353
- /** Trimming modes accepted by `masteringRepairTrimSilence`. */
1354
- type TrimSilenceMode = 'peak' | 'lufsGated';
1355
- /** Options for `masteringRepairTrimSilence`. */
1356
- interface TrimSilenceOptions {
1357
- threshold?: number;
1358
- paddingSamples?: number;
1359
- mode?: TrimSilenceMode;
1360
- gateLufs?: number;
1361
- windowMs?: number;
1362
- }
1363
- /** Offline LPC-based declipper. */
1364
- declare function masteringRepairDeclip(samples: Float32Array, sampleRate: number, options?: DeclipOptions): Float32Array;
1365
- /** Offline crackle suppressor (median or wavelet-shrinkage). */
1366
- declare function masteringRepairDecrackle(samples: Float32Array, sampleRate: number, options?: DecrackleOptions): Float32Array;
1367
- /** Offline mains-hum remover. */
1368
- declare function masteringRepairDehum(samples: Float32Array, sampleRate: number, options?: DehumOptions): Float32Array;
1369
- /** Offline classical dereverberator (spectral subtraction + optional WPE). */
1370
- declare function masteringRepairDereverbClassical(samples: Float32Array, sampleRate: number, options?: DereverbClassicalOptions): Float32Array;
1371
- /** Offline silence trimmer (peak threshold or LUFS-gated). */
1372
- declare function masteringRepairTrimSilence(samples: Float32Array, sampleRate: number, options?: TrimSilenceOptions): Float32Array;
1373
- /** Compressor sidechain detector mode. */
1374
- type CompressorDetector = 'peak' | 'rms' | 'log_rms';
1375
- /** Options for `masteringDynamicsCompressor`. */
1376
- interface CompressorOptions extends ValidateOptions {
1377
- thresholdDb?: number;
1378
- ratio?: number;
1379
- attackMs?: number;
1380
- releaseMs?: number;
1381
- kneeDb?: number;
1382
- makeupGainDb?: number;
1383
- autoMakeup?: boolean;
1384
- detector?: CompressorDetector | number;
1385
- sidechainHpfEnabled?: boolean;
1386
- sidechainHpfHz?: number;
1387
- pdrTimeMs?: number;
1388
- pdrReleaseScale?: number;
1389
- }
1390
- /** Options for `masteringDynamicsGate`. */
1391
- interface GateOptions extends ValidateOptions {
1392
- thresholdDb?: number;
1393
- attackMs?: number;
1394
- releaseMs?: number;
1395
- rangeDb?: number;
1396
- holdMs?: number;
1397
- closeThresholdDb?: number;
1398
- keyHpfHz?: number;
1399
- }
1400
- /** Options for `masteringDynamicsTransientShaper`. */
1401
- interface TransientShaperOptions extends ValidateOptions {
1402
- attackGainDb?: number;
1403
- sustainGainDb?: number;
1404
- fastAttackMs?: number;
1405
- fastReleaseMs?: number;
1406
- slowAttackMs?: number;
1407
- slowReleaseMs?: number;
1408
- sensitivity?: number;
1409
- maxGainDb?: number;
1410
- gainSmoothingMs?: number;
1411
- lookaheadMs?: number;
1412
- }
1413
- /** Result envelope returned by offline mastering dynamics processors. */
1414
- interface DynamicsResult {
1415
- samples: Float32Array;
1416
- latencySamples: number;
1417
- }
1418
- /** Offline feed-forward compressor (soft knee, optional auto-makeup / sidechain HPF). */
1419
- declare function masteringDynamicsCompressor(samples: Float32Array, sampleRate: number, options?: CompressorOptions): DynamicsResult;
1420
- /** Offline noise gate (hysteresis, hold, optional key HPF). */
1421
- declare function masteringDynamicsGate(samples: Float32Array, sampleRate: number, options?: GateOptions): DynamicsResult;
1422
- /** Offline transient shaper (envelope-difference attack/sustain control). */
1423
- declare function masteringDynamicsTransientShaper(samples: Float32Array, sampleRate: number, options?: TransientShaperOptions): DynamicsResult;
1424
- /**
1425
- * Apply a configurable mastering chain in WASM.
1426
- *
1427
- * @param samples - Audio samples (mono, float32)
1428
- * @param sampleRate - Sample rate in Hz (default: 22050)
1429
- * @param config - Chain stage configuration
1430
- * @returns Processed audio, loudness metadata, and applied stage names
1431
- */
1432
- declare function masteringChain(samples: Float32Array, sampleRate: number | undefined, config: MasteringChainConfig): MasteringChainResult;
1433
- /**
1434
- * Apply a configurable stereo mastering chain in WASM.
1435
- *
1436
- * @param left - Left channel samples
1437
- * @param right - Right channel samples
1438
- * @param sampleRate - Sample rate in Hz
1439
- * @param config - Chain stage configuration
1440
- * @returns Processed stereo audio, loudness metadata, and applied stage names
1441
- */
1442
- declare function masteringChainStereo(left: Float32Array, right: Float32Array, sampleRate: number | undefined, config: MasteringChainConfig): MasteringStereoChainResult;
1443
- /**
1444
- * Apply a configurable mastering chain in WASM with progress reporting.
1445
- *
1446
- * @param samples - Audio samples (mono, float32)
1447
- * @param sampleRate - Sample rate in Hz (default: 22050)
1448
- * @param config - Chain stage configuration
1449
- * @param onProgress - Progress callback (progress: 0-1, stage: string)
1450
- * @returns Processed audio, loudness metadata, and applied stage names
1451
- */
1452
- declare function masteringChainWithProgress(samples: Float32Array, sampleRate: number | undefined, config: MasteringChainConfig, onProgress: ProgressCallback): MasteringChainResult;
1453
- /**
1454
- * Apply a configurable stereo mastering chain in WASM with progress reporting.
1455
- *
1456
- * @param left - Left channel samples
1457
- * @param right - Right channel samples
1458
- * @param sampleRate - Sample rate in Hz
1459
- * @param config - Chain stage configuration
1460
- * @param onProgress - Progress callback (progress: 0-1, stage: string)
1461
- * @returns Processed stereo audio, loudness metadata, and applied stage names
1462
- */
1463
- declare function masteringChainStereoWithProgress(left: Float32Array, right: Float32Array, sampleRate: number | undefined, config: MasteringChainConfig, onProgress: ProgressCallback): MasteringStereoChainResult;
1464
- /**
1465
- * List built-in mastering preset identifiers.
1466
- *
1467
- * @returns Preset names in display order (e.g. "pop", "edm", "aiMusic")
1468
- */
1469
- declare function masteringPresetNames(): MasteringPreset[];
1470
- /**
1471
- * Apply a named mastering preset chain to mono audio.
1472
- *
1473
- * @param samples - Audio samples (mono, float32)
1474
- * @param sampleRate - Sample rate in Hz (default: 22050)
1475
- * @param presetName - Preset identifier from {@link masteringPresetNames}
1476
- * @param overrides - Optional flat overrides (dot-notation, e.g. `'loudness.targetLufs'`) applied on top of the preset. Pass `null` for preset defaults.
1477
- * @returns Processed audio, loudness metadata, and applied stage names
1478
- */
1479
- declare function masterAudio(samples: Float32Array, sampleRate: number | undefined, presetName: MasteringPreset, overrides?: Record<string, number | boolean> | null): MasteringChainResult;
1480
- /**
1481
- * Apply a named mastering preset chain to stereo audio.
1482
- *
1483
- * @param left - Left channel samples
1484
- * @param right - Right channel samples
1485
- * @param sampleRate - Sample rate in Hz
1486
- * @param presetName - Preset identifier from {@link masteringPresetNames}
1487
- * @param overrides - Optional flat overrides (dot-notation, e.g. `'loudness.targetLufs'`) applied on top of the preset. Pass `null` for preset defaults.
1488
- * @returns Processed stereo audio, loudness metadata, and applied stage names
1489
- */
1490
- declare function masterAudioStereo(left: Float32Array, right: Float32Array, sampleRate: number | undefined, presetName: MasteringPreset, overrides?: Record<string, number | boolean> | null): MasteringStereoChainResult;
1491
- /**
1492
- * Mono `masterAudio` with per-stage progress reporting. `onProgress` is invoked
1493
- * with `(progress, stage)` between each chain stage (progress is in [0,1]).
1494
- */
1495
- declare function masterAudioWithProgress(samples: Float32Array, sampleRate: number | undefined, presetName: MasteringPreset, onProgress: ProgressCallback, overrides?: Record<string, number | boolean> | null): MasteringChainResult;
1496
- /**
1497
- * Stereo `masterAudio` with per-stage progress reporting.
1498
- */
1499
- declare function masterAudioStereoWithProgress(left: Float32Array, right: Float32Array, sampleRate: number | undefined, presetName: MasteringPreset, onProgress: ProgressCallback, overrides?: Record<string, number | boolean> | null): MasteringStereoChainResult;
1500
- declare function mixingScenePresetNames(): string[];
1501
- /**
1502
- * Get a built-in mixing scene preset serialized as JSON. This is the canonical
1503
- * name shared with the Node and Python bindings; the returned JSON loads
1504
- * directly into a {@link Mixer} via {@link Mixer.fromSceneJson}.
1505
- *
1506
- * @param presetName - Preset name (see {@link mixingScenePresetNames})
1507
- * @returns Scene JSON string
1508
- */
1509
- declare function mixingScenePresetJson(presetName: string): string;
1510
- declare function mixStereo(leftChannels: Float32Array[], rightChannels: Float32Array[], sampleRate?: number, options?: MixOptions): MixResult;
1511
- /**
1512
- * Block-by-block streaming variant of {@link masteringChain}.
1513
- *
1514
- * Maintains processor state across {@link processMono}/{@link processStereo}
1515
- * calls. Only ProcessorBase-backed stages are supported. Configurations that
1516
- * enable `repair.denoise` or `loudness` throw at construction.
1517
- *
1518
- * Call {@link delete} (or use a `try/finally`) to release the underlying WASM
1519
- * object — the embind handle is not garbage-collected automatically.
1520
- *
1521
- * @example
1522
- * ```typescript
1523
- * const chain = new StreamingMasteringChain({ eq: { tiltDb: 1.0 } });
1524
- * try {
1525
- * chain.prepare(44100, 512, 1);
1526
- * const out = chain.processMono(blockSamples);
1527
- * } finally {
1528
- * chain.delete();
1529
- * }
1530
- * ```
1531
- */
1532
- declare class StreamingMasteringChain {
1533
- private chain;
1534
- constructor(config: MasteringChainConfig);
1535
- /**
1536
- * Initialize processors for the given sample rate and block layout.
1537
- *
1538
- * @param sampleRate - Sample rate in Hz
1539
- * @param maxBlockSize - Maximum block size per process call
1540
- * @param numChannels - 1 (mono) or 2 (stereo)
1541
- */
1542
- prepare(sampleRate: number, maxBlockSize: number, numChannels: number): void;
1543
- /**
1544
- * Process one mono block, returning the processed samples (same length).
1545
- */
1546
- processMono(samples: Float32Array): Float32Array;
1547
- /**
1548
- * Process one stereo block, returning the processed channels.
1549
- */
1550
- processStereo(left: Float32Array, right: Float32Array): {
1551
- left: Float32Array;
1552
- right: Float32Array;
1553
- };
1554
- /** Reset all processor state without rebuilding. */
1555
- reset(): void;
1556
- /** Total reported latency in samples across all active processors. */
1557
- latencySamples(): number;
1558
- /** Ordered stage names that will run (e.g. `"eq.tilt"`). */
1559
- stageNames(): string[];
1560
- /** Release the underlying WASM object. Safe to call only once. */
1561
- delete(): void;
1562
- }
1563
- /**
1564
- * Block-by-block streaming equalizer wrapping the unified C++
1565
- * `EqualizerProcessor` (up to 24 bands, RBJ/Vicanek biquads, dynamic EQ,
1566
- * linear-phase FIR, mid/side processing, and auto-gain).
1567
- *
1568
- * State is maintained across {@link processMono}/{@link processStereo} calls.
1569
- * Call {@link delete} (or use `try/finally`) to release the underlying WASM
1570
- * object — the embind handle is not garbage-collected automatically.
1571
- *
1572
- * @example
1573
- * ```typescript
1574
- * const eq = new StreamingEqualizer({ sampleRate: 48000, maxBlockSize: 512 });
1575
- * try {
1576
- * eq.setBand(0, { type: 'HighShelf', frequencyHz: 8000, gainDb: 6, enabled: true });
1577
- * const out = eq.processStereo(left, right);
1578
- * const snapshot = eq.spectrum();
1579
- * } finally {
1580
- * eq.delete();
1581
- * }
1582
- * ```
1583
- */
1584
- declare class StreamingEqualizer {
1585
- private eq;
1586
- constructor(config?: StreamingEqualizerConfig);
1587
- /**
1588
- * Configure the band at `index` (0..23). Omitted fields use C++ defaults.
1589
- */
1590
- setBand(index: number, band: EqBand): void;
1591
- /** Disable and reset every band. */
1592
- clear(): void;
1593
- /**
1594
- * Set the global phase mode: 1=ZeroLatency, 2=NaturalPhase, 3=LinearPhase.
1595
- */
1596
- setPhaseMode(mode: number): void;
1597
- /** Enable or disable output auto-gain compensation. */
1598
- setAutoGain(enabled: boolean): void;
1599
- /** Set all-band EQ gain scale as a 0.0..2.0 multiplier. */
1600
- setGainScale(scale: number): void;
1601
- /** Set post-EQ output gain in dB. */
1602
- setOutputGainDb(gainDb: number): void;
1603
- /** Set post-EQ stereo balance in -1.0..1.0; mono input ignores pan. */
1604
- setOutputPan(pan: number): void;
1605
- /**
1606
- * Provide a mono external sidechain key for dynamic bands that opt into
1607
- * `external_sidechain`. The samples are copied into an owned buffer.
1608
- */
1609
- setSidechainMono(samples: Float32Array): void;
1610
- /**
1611
- * Provide a stereo external sidechain key. Both channels must match length.
1612
- */
1613
- setSidechainStereo(left: Float32Array, right: Float32Array): void;
1614
- /** Release any borrowed external sidechain buffers. */
1615
- clearSidechain(): void;
1616
- /** Auto-gain applied on the most recent block, in dB. */
1617
- lastAutoGainDb(): number;
1618
- /** Reported processing latency in samples (non-zero for linear-phase bands). */
1619
- latencySamples(): number;
1620
- /**
1621
- * Process one mono block, returning the equalized samples (same length).
1622
- */
1623
- processMono(samples: Float32Array): Float32Array;
1624
- /**
1625
- * Process one stereo block, returning the equalized channels.
1626
- */
1627
- processStereo(left: Float32Array, right: Float32Array): {
1628
- left: Float32Array;
1629
- right: Float32Array;
1630
- };
1631
- /**
1632
- * Read the latest pre/post spectrum snapshot for metering. `seq` increments
1633
- * each time a new snapshot is published.
1634
- */
1635
- spectrum(): EqSpectrumSnapshot;
1636
- /**
1637
- * Configure bands so the source spectrum matches the reference spectrum.
1638
- *
1639
- * @param source - Source audio (mono samples)
1640
- * @param reference - Reference audio (mono samples)
1641
- * @param options - `sampleRate` (default 48000) and `maxBands` (default 8)
1642
- */
1643
- match(source: Float32Array, reference: Float32Array, options?: EqMatchOptions): void;
1644
- /** Release the underlying WASM object. Safe to call only once. */
1645
- delete(): void;
1646
- }
1647
- /**
1648
- * Block-by-block mono voice retune / pitch shifter.
1649
- *
1650
- * State is maintained across {@link processMono} calls. Call {@link prepare}
1651
- * before processing, and call {@link delete} (or use `try/finally`) to release
1652
- * the underlying WASM object.
1653
- */
1654
- declare class StreamingRetune {
1655
- private retune;
1656
- constructor(config?: StreamingRetuneConfig);
1657
- /**
1658
- * Allocate and initialize native state for the given sample rate and maximum
1659
- * process block size.
1660
- */
1661
- prepare(sampleRate: number, maxBlockSize: number): void;
1662
- /** Reset delay, grain, and overlap-add state without changing config. */
1663
- reset(): void;
1664
- /**
1665
- * Update retune settings. Changing `grainSize` takes effect after the next
1666
- * {@link prepare} call.
1667
- */
1668
- setConfig(config: StreamingRetuneConfig): void;
1669
- /** Current native config. */
1670
- config(): Required<StreamingRetuneConfig>;
1671
- /** Resolved grain size in samples after {@link prepare}. */
1672
- grainSize(): number;
1673
- /** Process one mono block, returning the shifted samples (same length). */
1674
- processMono(samples: Float32Array): Float32Array;
1675
- /** Release the underlying WASM object. Safe to call only once. */
1676
- delete(): void;
1677
- }
1678
- declare class RealtimeVoiceChanger {
1679
- private changer;
1680
- constructor(config?: RealtimeVoiceChangerConfigInput);
1681
- prepare(sampleRate: number, maxBlockSize?: number, channels?: number): void;
1682
- reset(): void;
1683
- setConfig(config: RealtimeVoiceChangerConfigInput): void;
1684
- configJson(): string;
1685
- latencySamples(): number;
1686
- processMono(samples: Float32Array): Float32Array;
1687
- processMonoInto(samples: Float32Array, output: Float32Array): void;
1688
- processInterleaved(samples: Float32Array, channels: number): Float32Array;
1689
- processInterleavedInto(samples: Float32Array, channels: number, output: Float32Array): void;
1690
- /**
1691
- * Acquire a typed-memory view onto the WASM heap for mono input.
1692
- *
1693
- * Write your input samples into the returned `Float32Array` directly (e.g.
1694
- * via `input.set(source)`); no copy crosses the JS↔C++ bridge until
1695
- * {@link processPreparedMono} is called. The view is owned by this
1696
- * RealtimeVoiceChanger and becomes invalid after {@link delete}; it may
1697
- * also be invalidated if you later call this method with a larger
1698
- * `numSamples` value (the underlying buffer may be reallocated).
1699
- */
1700
- getMonoInputBuffer(numSamples: number): Float32Array;
1701
- /** Mono output view counterpart to {@link getMonoInputBuffer}. */
1702
- getMonoOutputBuffer(numSamples: number): Float32Array;
1703
- /**
1704
- * Process the previously-acquired mono input buffer in place. The output
1705
- * appears in the buffer returned by {@link getMonoOutputBuffer}. No JS↔C++
1706
- * sample-level crossings happen on this call — it just hands control to
1707
- * the underlying DSP on already-on-heap data.
1708
- */
1709
- processPreparedMono(numSamples: number): void;
1710
- /** Interleaved input view (layout L0,R0,L1,R1,...). */
1711
- getInterleavedInputBuffer(numFrames: number, numChannels: number): Float32Array;
1712
- /** Interleaved output view counterpart. */
1713
- getInterleavedOutputBuffer(numFrames: number, numChannels: number): Float32Array;
1714
- /**
1715
- * Process the previously-acquired interleaved buffer in place. Output
1716
- * appears in the buffer returned by {@link getInterleavedOutputBuffer}.
1717
- */
1718
- processPreparedInterleaved(numFrames: number, numChannels: number): void;
1719
- /**
1720
- * Planar-channel input/output view (one Float32Array per channel). Matches
1721
- * AudioWorklet's native layout; processing happens in place.
1722
- */
1723
- getPlanarChannelBuffer(channel: number, numFrames: number): Float32Array;
1724
- /**
1725
- * Process the previously-acquired planar channel buffers in place. Each
1726
- * channel must have been obtained from {@link getPlanarChannelBuffer}
1727
- * with the same `numFrames`. Output replaces input in the same buffers.
1728
- */
1729
- processPreparedPlanar(numFrames: number): void;
1730
- /**
1731
- * Convenience factory for the mono zero-copy path: returns the input/output
1732
- * heap views plus a `process()` thunk wired to the same `numSamples`. The
1733
- * views are reused across calls and become invalid after {@link delete}.
1734
- */
1735
- createRealtimeMonoBuffer(numSamples: number): RealtimeVoiceChangerMonoBuffer;
1736
- /** Same as {@link createRealtimeMonoBuffer} but for interleaved I/O. */
1737
- createRealtimeInterleavedBuffer(numFrames: number, numChannels: number): RealtimeVoiceChangerInterleavedBuffer;
1738
- /**
1739
- * Convenience factory for the planar zero-copy path. Acquires one
1740
- * heap-backed Float32Array per channel and returns a `process()` thunk
1741
- * wired to the same `numFrames`. Buffers are reused across calls and
1742
- * become invalid after {@link delete}.
1743
- */
1744
- createRealtimePlanarBuffer(numFrames: number, numChannels: number): RealtimeVoiceChangerPlanarBuffer;
1745
- delete(): void;
1746
- }
1747
- declare function realtimeVoiceChangerPresetNames(): VoicePresetId[];
1748
- declare function realtimeVoiceChangerPresetJson(name: VoicePresetId): string;
1749
- declare function validateRealtimeVoiceChangerPresetJson(json: string): {
1750
- ok: boolean;
1751
- normalizedJson?: string;
1752
- error?: string;
1753
- };
1754
- /**
1755
- * Persistent, scene-based stereo mixer.
1756
- *
1757
- * Build one from a scene JSON string (e.g. {@link mixingScenePresetJson} or a
1758
- * hand-authored scene), then feed per-strip stereo blocks through
1759
- * {@link processStereo} to get the routed stereo master. Strips, sends, buses,
1760
- * and inserts are described entirely by the scene; the routing graph is
1761
- * compiled lazily on the first {@link processStereo} call (or eagerly via
1762
- * {@link compile}).
1763
- *
1764
- * Call {@link delete} (or use a `try/finally`) to release the underlying WASM
1765
- * object — the embind handle is not garbage-collected automatically.
1766
- *
1767
- * @example
1768
- * ```typescript
1769
- * const mixer = Mixer.fromSceneJson(mixingScenePresetJson('basicStereo'), 48000, 512);
1770
- * try {
1771
- * const out = mixer.processStereo([stripL], [stripR]);
1772
- * } finally {
1773
- * mixer.delete();
1774
- * }
1775
- * ```
1776
- */
1777
- declare class Mixer {
1778
- private mixer;
1779
- private constructor();
1780
- /**
1781
- * Build a mixer from a scene JSON string.
1782
- *
1783
- * @param json - Scene JSON (strips, buses, sends, connections, inserts)
1784
- * @param sampleRate - Sample rate in Hz (default: 48000)
1785
- * @param blockSize - Maximum block size per {@link processStereo} call (default: 512)
1786
- */
1787
- static fromSceneJson(json: string, sampleRate?: number, blockSize?: number): Mixer;
1788
- /** Rebuild and compile the routing graph from the current scene topology. */
1789
- compile(): void;
1790
- /**
1791
- * Mix one block of per-strip stereo audio into the stereo master.
1792
- *
1793
- * @param leftChannels - `leftChannels[i]` is the left channel of strip `i`
1794
- * @param rightChannels - `rightChannels[i]` is the right channel of strip `i`
1795
- * @returns Mixed stereo master (`left`, `right`, `sampleRate`)
1796
- */
1797
- processStereo(leftChannels: Float32Array[], rightChannels: Float32Array[]): MixerProcessResult;
1798
- /**
1799
- * Mix one block into caller-owned output arrays.
1800
- *
1801
- * This avoids allocating the result object and result `Float32Array`s. It is
1802
- * intended for realtime bridges such as AudioWorklet; the input channel count
1803
- * must match the scene strip count and all arrays must have the same length.
1804
- */
1805
- processStereoInto(leftChannels: Float32Array[], rightChannels: Float32Array[], outLeft: Float32Array, outRight: Float32Array): void;
1806
- /**
1807
- * Create reusable WASM-heap input/output views for realtime-style processing.
1808
- *
1809
- * Fill `leftInputs[i]` / `rightInputs[i]`, call `process()`, then read
1810
- * `outLeft` / `outRight`. The views are owned by this mixer and become invalid
1811
- * after {@link delete}.
1812
- */
1813
- createRealtimeBuffer(): MixerRealtimeBuffer;
1814
- /** Number of strips in the mixer (e.g. strips loaded from the scene). */
1815
- stripCount(): number;
1816
- /**
1817
- * Schedule sample-accurate insert-parameter automation on a strip's insert.
1818
- *
1819
- * @param stripIndex - Strip index in `[0, stripCount())`
1820
- * @param insertIndex - Index into the strip's combined insert sequence
1821
- * (`[pre-inserts... post-inserts...]`)
1822
- * @param paramId - Processor-specific parameter id
1823
- * @param samplePos - Absolute samples from the start of processing (the mixer
1824
- * advances an internal position from 0 on the first {@link processStereo}
1825
- * call; recompiling resets it to 0)
1826
- * @param value - Target parameter value
1827
- * @param curve - Interpolation curve (default: `'linear'`)
1828
- * @throws If the strip index is out of range or the schedule call fails
1829
- * (unknown curve, out-of-range insert index, or full event lane)
1830
- */
1831
- scheduleInsertAutomation(stripIndex: number, insertIndex: number, paramId: number, samplePos: number, value: number, curve?: AutomationCurve): void;
1832
- /**
1833
- * Resolve a strip's index in `[0, stripCount())` from its scene id, or `null`
1834
- * when no strip with that id exists (matches the Node binding's `number | null`).
1835
- */
1836
- stripById(id: string): number | null;
1837
- /**
1838
- * Add a bus to the mixer topology. `role` is one of `'master'`, `'aux'`, or
1839
- * `'submix'` (defaults to `'aux'`). Marks the routing graph dirty; call
1840
- * {@link compile} (or {@link processStereo}) to rebuild.
1841
- */
1842
- addBus(id: string, role?: string): void;
1843
- /** Remove a bus by id. Marks the routing graph dirty. */
1844
- removeBus(id: string): void;
1845
- /** Number of buses in the mixer topology. */
1846
- busCount(): number;
1847
- /**
1848
- * Add a VCA group with the given gain offset (dB). `members` is a list of
1849
- * strip ids governed by the group (may be empty).
1850
- */
1851
- addVcaGroup(id: string, gainDb?: number, members?: string[]): void;
1852
- /** Remove a VCA group by id. */
1853
- removeVcaGroup(id: string): void;
1854
- /** Number of VCA groups in the mixer topology. */
1855
- vcaGroupCount(): number;
1856
- /** Set the strip's input trim in dB. */
1857
- setInputTrimDb(stripIndex: number, db: number): void;
1858
- /** Set the strip's fader level in dB. */
1859
- setFaderDb(stripIndex: number, db: number): void;
1860
- /** Set the strip's pan position. */
1861
- setPan(stripIndex: number, pan: number, panMode?: PanMode | number): void;
1862
- /** Set the strip's stereo width. */
1863
- setWidth(stripIndex: number, width: number): void;
1864
- /** Set the strip's mute state. */
1865
- setMuted(stripIndex: number, muted: boolean): void;
1866
- /**
1867
- * Set a strip's solo state. Takes effect on the next process without a
1868
- * graph recompile.
1869
- */
1870
- setSoloed(stripIndex: number, soloed: boolean): void;
1871
- /**
1872
- * Mark a strip solo-safe so it is never implied-muted by another strip's
1873
- * solo. Takes effect on the next process without a graph recompile.
1874
- */
1875
- setSoloSafe(stripIndex: number, soloSafe: boolean): void;
1876
- /** Invert the polarity of the left and/or right channel of a strip. */
1877
- setPolarityInvert(stripIndex: number, invertLeft: boolean, invertRight: boolean): void;
1878
- /** Set the strip's pan law. */
1879
- setPanLaw(stripIndex: number, panLaw: PanLaw | number): void;
1880
- /**
1881
- * Set a per-strip channel delay in samples. This changes the strip's reported
1882
- * latency; recompile to re-run latency compensation.
1883
- */
1884
- setChannelDelaySamples(stripIndex: number, delaySamples: number): void;
1885
- /** Set the strip's live VCA gain offset in dB (not persisted to the scene). */
1886
- setVcaOffsetDb(stripIndex: number, offsetDb: number): void;
1887
- /** Set independent left/right pan positions (dual-pan mode). */
1888
- setDualPan(stripIndex: number, leftPan: number, rightPan: number): void;
1889
- /**
1890
- * Add a send to a strip after construction.
1891
- *
1892
- * @param stripIndex - Strip index in `[0, stripCount())`
1893
- * @param id - Send id
1894
- * @param destinationBusId - Destination bus id
1895
- * @param sendDb - Initial send level in dB
1896
- * @param timing - `'preFader'` or `'postFader'` (default: `'postFader'`)
1897
- * @returns The new send's index
1898
- */
1899
- addSend(stripIndex: number, id: string, destinationBusId: string, sendDb: number, timing?: SendTiming | number): number;
1900
- /** Set the send level (in dB) for an existing send by index. */
1901
- setSendDb(stripIndex: number, sendIndex: number, sendDb: number): void;
1902
- /**
1903
- * Read a strip's meter snapshot at the given tap point.
1904
- *
1905
- * @param stripIndex - Strip index in `[0, stripCount())`
1906
- * @param tap - `'preFader'` or `'postFader'` (default: `'postFader'`)
1907
- */
1908
- meterTap(stripIndex: number, tap?: MeterTap): MixMeterSnapshot;
1909
- /**
1910
- * Read a strip's meter snapshot. Alias of {@link meterTap}, provided for
1911
- * cross-binding (Node/Python) parity.
1912
- *
1913
- * @param stripIndex - Strip index in `[0, stripCount())`
1914
- * @param tap - `'preFader'` or `'postFader'` (default: `'postFader'`)
1915
- */
1916
- stripMeter(stripIndex: number, tap?: MeterTap): MixMeterSnapshot;
1917
- /**
1918
- * Schedule sample-accurate fader automation on a strip.
1919
- *
1920
- * @param stripIndex - Strip index in `[0, stripCount())`
1921
- * @param samplePos - Absolute samples from the start of processing
1922
- * @param faderDb - Target fader level in dB
1923
- * @param curve - Interpolation curve (default: `'linear'`)
1924
- */
1925
- scheduleFaderAutomation(stripIndex: number, samplePos: number, faderDb: number, curve?: AutomationCurve): void;
1926
- /**
1927
- * Schedule sample-accurate pan automation on a strip.
1928
- *
1929
- * @param stripIndex - Strip index in `[0, stripCount())`
1930
- * @param samplePos - Absolute samples from the start of processing
1931
- * @param pan - Target pan position
1932
- * @param curve - Interpolation curve (default: `'linear'`)
1933
- */
1934
- schedulePanAutomation(stripIndex: number, samplePos: number, pan: number, curve?: AutomationCurve): void;
1935
- /**
1936
- * Schedule sample-accurate width automation on a strip.
1937
- *
1938
- * @param stripIndex - Strip index in `[0, stripCount())`
1939
- * @param samplePos - Absolute samples from the start of processing
1940
- * @param width - Target stereo width
1941
- * @param curve - Interpolation curve (default: `'linear'`)
1942
- */
1943
- scheduleWidthAutomation(stripIndex: number, samplePos: number, width: number, curve?: AutomationCurve): void;
1944
- /**
1945
- * Schedule sample-accurate send-level automation on a strip's send.
1946
- *
1947
- * @param stripIndex - Strip index in `[0, stripCount())`
1948
- * @param sendIndex - Send index in the strip's add order
1949
- * @param samplePos - Absolute samples from the start of processing
1950
- * @param db - Target send level in dB
1951
- * @param curve - Interpolation curve (default: `'linear'`)
1952
- */
1953
- scheduleSendAutomation(stripIndex: number, sendIndex: number, samplePos: number, db: number, curve?: AutomationCurve): void;
1954
- /**
1955
- * Read up to `maxPoints` of a strip's most recent goniometer samples
1956
- * (oldest to newest).
1957
- */
1958
- readGoniometerLatest(stripIndex: number, maxPoints: number): GoniometerPoint[];
1959
- /** Serialize the current scene (strips, buses, sends, connections) to JSON. */
1960
- toSceneJson(): string;
1961
- /** Release the underlying WASM object. Safe to call only once. */
1962
- delete(): void;
1963
- /** Alias for {@link delete}, provided for cross-binding (Node) compatibility. */
1964
- destroy(): void;
1965
- }
1966
- /**
1967
- * Trim silence from beginning and end of audio.
1968
- *
1969
- * @param samples - Audio samples (mono, float32)
1970
- * @param sampleRate - Sample rate in Hz
1971
- * @param thresholdDb - Silence threshold in dB (default: -60 dB)
1972
- * @returns Trimmed audio
1973
- */
1974
- declare function trim(samples: Float32Array, sampleRate: number, thresholdDb?: number): Float32Array;
1975
- /**
1976
- * Compute Short-Time Fourier Transform (STFT).
1977
- *
1978
- * @param samples - Audio samples (mono, float32)
1979
- * @param sampleRate - Sample rate in Hz (default: 22050)
1980
- * @param nFft - FFT size (default: 2048)
1981
- * @param hopLength - Hop length (default: 512)
1982
- * @returns STFT result with magnitude and power spectrograms
1983
- */
1984
- declare function stft(samples: Float32Array, sampleRate?: number, nFft?: number, hopLength?: number): StftResult;
1985
- /**
1986
- * Compute STFT and return magnitude in decibels.
1987
- *
1988
- * @param samples - Audio samples (mono, float32)
1989
- * @param sampleRate - Sample rate in Hz (default: 22050)
1990
- * @param nFft - FFT size (default: 2048)
1991
- * @param hopLength - Hop length (default: 512)
1992
- * @returns STFT result with dB values
1993
- */
1994
- declare function stftDb(samples: Float32Array, sampleRate?: number, nFft?: number, hopLength?: number): {
1995
- nBins: number;
1996
- nFrames: number;
1997
- db: Float32Array;
1998
- };
1999
- /**
2000
- * Compute Mel spectrogram.
2001
- *
2002
- * @param samples - Audio samples (mono, float32)
2003
- * @param sampleRate - Sample rate in Hz (default: 22050)
2004
- * @param nFft - FFT size (default: 2048)
2005
- * @param hopLength - Hop length (default: 512)
2006
- * @param nMels - Number of Mel bands (default: 128)
2007
- * @returns Mel spectrogram result
2008
- */
2009
- declare function melSpectrogram(samples: Float32Array, sampleRate?: number, nFft?: number, hopLength?: number, nMels?: number): MelSpectrogramResult;
2010
- /**
2011
- * Compute MFCC (Mel-Frequency Cepstral Coefficients).
2012
- *
2013
- * @param samples - Audio samples (mono, float32)
2014
- * @param sampleRate - Sample rate in Hz (default: 22050)
2015
- * @param nFft - FFT size (default: 2048)
2016
- * @param hopLength - Hop length (default: 512)
2017
- * @param nMels - Number of Mel bands (default: 128)
2018
- * @param nMfcc - Number of MFCC coefficients (default: 20)
2019
- * @returns MFCC result
2020
- */
2021
- declare function mfcc(samples: Float32Array, sampleRate?: number, nFft?: number, hopLength?: number, nMels?: number, nMfcc?: number): MfccResult;
2022
- /**
2023
- * Approximate inverse of a Mel filterbank: Mel power spectrogram -> STFT power
2024
- * spectrogram. Mirrors `feature::mel_to_stft`.
2025
- *
2026
- * @param melPower - Mel power spectrogram [nMels x nFrames] row-major
2027
- * @param nMels - Number of Mel bands
2028
- * @param nFrames - Number of time frames
2029
- * @param sampleRate - Sample rate in Hz
2030
- * @param nFft - FFT size (default: 2048)
2031
- * @param fmin - Lower Mel band edge in Hz (default: 0)
2032
- * @param fmax - Upper Mel band edge in Hz (default: sr/2 when 0)
2033
- * @returns STFT power spectrogram result
2034
- */
2035
- declare function melToStft(melPower: Float32Array, nMels: number, nFrames: number, sampleRate?: number, nFft?: number, fmin?: number, fmax?: number): StftPowerResult;
2036
- /**
2037
- * Reconstruct audio from a Mel power spectrogram via Griffin-Lim. Mirrors
2038
- * `feature::mel_to_audio`.
2039
- *
2040
- * @param melPower - Mel power spectrogram [nMels x nFrames] row-major
2041
- * @param nMels - Number of Mel bands
2042
- * @param nFrames - Number of time frames
2043
- * @param sampleRate - Sample rate in Hz
2044
- * @param nFft - FFT size (default: 2048)
2045
- * @param hopLength - Hop length (default: 512)
2046
- * @param fmin - Minimum Mel frequency in Hz (default: 0)
2047
- * @param fmax - Maximum Mel frequency in Hz (default: 0 = sr/2)
2048
- * @param nIter - Griffin-Lim iterations (default: 32)
2049
- * @returns Reconstructed audio samples (mono, float32)
2050
- */
2051
- declare function melToAudio(melPower: Float32Array, nMels: number, nFrames: number, sampleRate?: number, nFft?: number, hopLength?: number, fmin?: number, fmax?: number, nIter?: number): Float32Array;
2052
- /**
2053
- * Invert MFCC coefficients back to a Mel power spectrogram. Mirrors
2054
- * `feature::mfcc_to_mel`.
2055
- *
2056
- * @param mfccCoefficients - MFCC matrix [nMfcc x nFrames] row-major
2057
- * @param nMfcc - Number of MFCC coefficients
2058
- * @param nFrames - Number of time frames
2059
- * @param nMels - Number of Mel bins to reconstruct (default: 128)
2060
- * @returns Mel power spectrogram result
2061
- */
2062
- declare function mfccToMel(mfccCoefficients: Float32Array, nMfcc: number, nFrames: number, nMels?: number): MelPowerResult;
2063
- /**
2064
- * Reconstruct audio directly from MFCC coefficients via Griffin-Lim. Mirrors
2065
- * `feature::mfcc_to_audio`.
2066
- *
2067
- * @param mfccCoefficients - MFCC matrix [nMfcc x nFrames] row-major
2068
- * @param nMfcc - Number of MFCC coefficients
2069
- * @param nFrames - Number of time frames
2070
- * @param nMels - Number of Mel bins (default: 128)
2071
- * @param sampleRate - Sample rate in Hz (default: 22050)
2072
- * @param nFft - FFT size (default: 2048)
2073
- * @param hopLength - Hop length (default: 512)
2074
- * @param fmin - Minimum Mel frequency in Hz (default: 0)
2075
- * @param fmax - Maximum Mel frequency in Hz (default: 0 = sr/2)
2076
- * @param nIter - Griffin-Lim iterations (default: 32)
2077
- * @returns Reconstructed audio samples (mono, float32)
2078
- */
2079
- declare function mfccToAudio(mfccCoefficients: Float32Array, nMfcc: number, nFrames: number, nMels?: number, sampleRate?: number, nFft?: number, hopLength?: number, fmin?: number, fmax?: number, nIter?: number): Float32Array;
2080
- /**
2081
- * Compute chromagram (pitch class distribution).
2082
- *
2083
- * @param samples - Audio samples (mono, float32)
2084
- * @param sampleRate - Sample rate in Hz (default: 22050)
2085
- * @param nFft - FFT size (default: 2048)
2086
- * @param hopLength - Hop length (default: 512)
2087
- * @returns Chroma features result
2088
- */
2089
- declare function chroma(samples: Float32Array, sampleRate?: number, nFft?: number, hopLength?: number): ChromaResult;
2090
- /**
2091
- * Compute spectral centroid (center of mass of spectrum).
2092
- *
2093
- * @param samples - Audio samples (mono, float32)
2094
- * @param sampleRate - Sample rate in Hz (default: 22050)
2095
- * @param nFft - FFT size (default: 2048)
2096
- * @param hopLength - Hop length (default: 512)
2097
- * @returns Spectral centroid in Hz for each frame
2098
- */
2099
- declare function spectralCentroid(samples: Float32Array, sampleRate?: number, nFft?: number, hopLength?: number): Float32Array;
2100
- /**
2101
- * Compute spectral contrast (librosa.feature.spectral_contrast).
2102
- *
2103
- * @returns Matrix2d of shape (nBands + 1) x nFrames.
2104
- */
2105
- declare function spectralContrast(samples: Float32Array, sampleRate?: number, nFft?: number, hopLength?: number, nBands?: number, fmin?: number, quantile?: number): WasmMatrix2dResult;
2106
- /**
2107
- * Fit per-frame polynomial coefficients (librosa.feature.poly_features).
2108
- *
2109
- * @returns Matrix2d of shape (order + 1) x nFrames.
2110
- */
2111
- declare function polyFeatures(samples: Float32Array, sampleRate?: number, nFft?: number, hopLength?: number, order?: number): WasmMatrix2dResult;
2112
- /**
2113
- * Locate zero-crossing indices of a signal (librosa.zero_crossings).
2114
- */
2115
- declare function zeroCrossings(samples: Float32Array, threshold?: number, refMagnitude?: boolean, pad?: boolean, zeroPos?: boolean): Int32Array;
2116
- /**
2117
- * Estimate the global tuning offset from a set of frequencies
2118
- * (librosa.pitch_tuning). Returns a deviation in fractions of a bin.
2119
- */
2120
- declare function pitchTuning(frequencies: Float32Array, resolution?: number, binsPerOctave?: number): number;
2121
- /**
2122
- * Estimate the tuning offset of an audio signal (librosa.estimate_tuning).
2123
- */
2124
- declare function estimateTuning(samples: Float32Array, sampleRate?: number, nFft?: number, hopLength?: number, resolution?: number, binsPerOctave?: number): number;
2125
- /**
2126
- * Non-negative matrix factorisation of a flattened [nFeatures x nFrames]
2127
- * spectrogram (librosa.decompose.decompose). Returns the W and H factors.
2128
- */
2129
- declare function decompose(s: Float32Array, nFeatures: number, nFrames: number, nComponents: number, nIter?: number, beta?: number): WasmDecomposeResult;
2130
- /**
2131
- * Nearest-neighbour filtering of a flattened [nFeatures x nFrames] spectrogram
2132
- * (librosa.decompose.nn_filter).
2133
- */
2134
- declare function nnFilter(s: Float32Array, nFeatures: number, nFrames: number, aggregate?: string, k?: number, width?: number): WasmMatrix2dResult;
2135
- /**
2136
- * Reorder/concatenate a signal by interval slices (librosa.effects.remix).
2137
- *
2138
- * @param intervals - Flat (start, end) sample pairs (even length).
2139
- */
2140
- declare function remix(samples: Float32Array, intervals: Int32Array | ArrayLike<number>, sampleRate?: number, alignZeros?: boolean): Float32Array;
2141
- /**
2142
- * Phase-vocoder time-scale modification (rate > 1 faster, < 1 slower).
2143
- */
2144
- declare function phaseVocoder(samples: Float32Array, rate: number, sampleRate?: number, nFft?: number, hopLength?: number): Float32Array;
2145
- /**
2146
- * HPSS into harmonic / percussive / residual signals.
2147
- */
2148
- declare function hpssWithResidual(samples: Float32Array, sampleRate?: number, kernelHarmonic?: number, kernelPercussive?: number): WasmHpssWithResidualResult;
2149
- /**
2150
- * Channel-weighted multichannel integrated loudness + LRA (ITU-R BS.1770 /
2151
- * EBU R128) from an interleaved buffer of `frames * channels` samples. The
2152
- * per-channel frame count is derived from the buffer length and `channels`.
2153
- */
2154
- declare function lufsInterleaved(samples: Float32Array, channels: number, sampleRate?: number): WasmLufsResult;
2155
- /**
2156
- * Standards-compliant EBU R128 loudness range (LRA) in LU.
2157
- */
2158
- declare function ebur128LoudnessRange(samples: Float32Array, sampleRate?: number): number;
2159
- /**
2160
- * Compute spectral bandwidth.
2161
- *
2162
- * @param samples - Audio samples (mono, float32)
2163
- * @param sampleRate - Sample rate in Hz (default: 22050)
2164
- * @param nFft - FFT size (default: 2048)
2165
- * @param hopLength - Hop length (default: 512)
2166
- * @returns Spectral bandwidth in Hz for each frame
2167
- */
2168
- declare function spectralBandwidth(samples: Float32Array, sampleRate?: number, nFft?: number, hopLength?: number): Float32Array;
2169
- /**
2170
- * Compute spectral rolloff frequency.
2171
- *
2172
- * @param samples - Audio samples (mono, float32)
2173
- * @param sampleRate - Sample rate in Hz (default: 22050)
2174
- * @param nFft - FFT size (default: 2048)
2175
- * @param hopLength - Hop length (default: 512)
2176
- * @param rollPercent - Percentage threshold (default: 0.85)
2177
- * @returns Rolloff frequency in Hz for each frame
2178
- */
2179
- declare function spectralRolloff(samples: Float32Array, sampleRate?: number, nFft?: number, hopLength?: number, rollPercent?: number): Float32Array;
2180
- /**
2181
- * Compute spectral flatness.
2182
- *
2183
- * @param samples - Audio samples (mono, float32)
2184
- * @param sampleRate - Sample rate in Hz (default: 22050)
2185
- * @param nFft - FFT size (default: 2048)
2186
- * @param hopLength - Hop length (default: 512)
2187
- * @returns Spectral flatness for each frame (0 = tonal, 1 = noise-like)
2188
- */
2189
- declare function spectralFlatness(samples: Float32Array, sampleRate?: number, nFft?: number, hopLength?: number): Float32Array;
2190
- /**
2191
- * Compute zero crossing rate.
2192
- *
2193
- * @param samples - Audio samples (mono, float32)
2194
- * @param sampleRate - Sample rate in Hz (default: 22050)
2195
- * @param frameLength - Frame length (default: 2048)
2196
- * @param hopLength - Hop length (default: 512)
2197
- * @returns Zero crossing rate for each frame
2198
- */
2199
- declare function zeroCrossingRate(samples: Float32Array, sampleRate?: number, frameLength?: number, hopLength?: number): Float32Array;
2200
- /**
2201
- * Compute RMS energy.
2202
- *
2203
- * @param samples - Audio samples (mono, float32)
2204
- * @param sampleRate - Sample rate in Hz (default: 22050)
2205
- * @param frameLength - Frame length (default: 2048)
2206
- * @param hopLength - Hop length (default: 512)
2207
- * @returns RMS energy for each frame
2208
- */
2209
- declare function rmsEnergy(samples: Float32Array, sampleRate?: number, frameLength?: number, hopLength?: number): Float32Array;
2210
- /**
2211
- * Detect pitch using YIN algorithm.
2212
- *
2213
- * @param samples - Audio samples (mono, float32)
2214
- * @param sampleRate - Sample rate in Hz (default: 22050)
2215
- * @param frameLength - Frame length (default: 2048)
2216
- * @param hopLength - Hop length (default: 512)
2217
- * @param fmin - Minimum frequency in Hz (default: 65)
2218
- * @param fmax - Maximum frequency in Hz (default: 2093)
2219
- * @param threshold - YIN threshold (default: 0.3)
2220
- * @param fillNa - If true, return 0 for unvoiced f0 frames; otherwise keep NaN (default: false)
2221
- * @returns Pitch detection result
2222
- */
2223
- declare function pitchYin(samples: Float32Array, sampleRate?: number, frameLength?: number, hopLength?: number, fmin?: number, fmax?: number, threshold?: number, fillNa?: boolean): PitchResult;
2224
- /**
2225
- * Detect pitch using pYIN algorithm (probabilistic YIN with HMM smoothing).
2226
- *
2227
- * @param samples - Audio samples (mono, float32)
2228
- * @param sampleRate - Sample rate in Hz (default: 22050)
2229
- * @param frameLength - Frame length (default: 2048)
2230
- * @param hopLength - Hop length (default: 512)
2231
- * @param fmin - Minimum frequency in Hz (default: 65)
2232
- * @param fmax - Maximum frequency in Hz (default: 2093)
2233
- * @param threshold - YIN threshold (default: 0.3)
2234
- * @param fillNa - If true, return 0 for unvoiced f0 frames; otherwise keep NaN (default: false)
2235
- * @returns Pitch detection result
2236
- */
2237
- declare function pitchPyin(samples: Float32Array, sampleRate?: number, frameLength?: number, hopLength?: number, fmin?: number, fmax?: number, threshold?: number, fillNa?: boolean): PitchResult;
2238
- /**
2239
- * Convert frequency in Hz to Mel scale.
2240
- *
2241
- * @param hz - Frequency in Hz
2242
- * @returns Mel frequency
2243
- */
2244
- declare function hzToMel(hz: number): number;
2245
- /**
2246
- * Convert Mel scale to frequency in Hz.
2247
- *
2248
- * @param mel - Mel frequency
2249
- * @returns Frequency in Hz
2250
- */
2251
- declare function melToHz(mel: number): number;
2252
- /**
2253
- * Convert frequency in Hz to MIDI note number.
2254
- *
2255
- * @param hz - Frequency in Hz
2256
- * @returns MIDI note number (A4 = 440 Hz = 69)
2257
- */
2258
- declare function hzToMidi(hz: number): number;
2259
- /**
2260
- * Convert MIDI note number to frequency in Hz.
2261
- *
2262
- * @param midi - MIDI note number
2263
- * @returns Frequency in Hz
2264
- */
2265
- declare function midiToHz(midi: number): number;
2266
- /**
2267
- * Convert frequency in Hz to note name.
2268
- *
2269
- * @param hz - Frequency in Hz
2270
- * @returns Note name (e.g., "A4", "C#5")
2271
- */
2272
- declare function hzToNote(hz: number): string;
2273
- /**
2274
- * Convert note name to frequency in Hz.
2275
- *
2276
- * @param note - Note name (e.g., "A4", "C#5")
2277
- * @returns Frequency in Hz
2278
- */
2279
- declare function noteToHz(note: string): number;
2280
- /**
2281
- * Convert frame index to time in seconds.
2282
- *
2283
- * @param frames - Frame index
2284
- * @param sr - Sample rate in Hz (default: 22050)
2285
- * @param hopLength - Hop length in samples (default: 512)
2286
- * @returns Time in seconds
2287
- */
2288
- declare function framesToTime(frames: number, sr?: number, hopLength?: number): number;
2289
- /**
2290
- * Convert time in seconds to frame index.
2291
- *
2292
- * @param time - Time in seconds
2293
- * @param sr - Sample rate in Hz (default: 22050)
2294
- * @param hopLength - Hop length in samples (default: 512)
2295
- * @returns Frame index
2296
- */
2297
- declare function timeToFrames(time: number, sr?: number, hopLength?: number): number;
2298
- declare function framesToSamples(frames: number, hopLength?: number, nFft?: number): number;
2299
- declare function samplesToFrames(samples: number, hopLength?: number, nFft?: number): number;
2300
- declare function powerToDb(values: Float32Array, ref?: number, amin?: number, topDb?: number): Float32Array;
2301
- declare function amplitudeToDb(values: Float32Array, ref?: number, amin?: number, topDb?: number): Float32Array;
2302
- declare function dbToPower(values: Float32Array, ref?: number): Float32Array;
2303
- declare function dbToAmplitude(values: Float32Array, ref?: number): Float32Array;
2304
- declare function preemphasis(samples: Float32Array, coef?: number, zi?: number): Float32Array;
2305
- declare function deemphasis(samples: Float32Array, coef?: number, zi?: number): Float32Array;
2306
- declare function trimSilence(samples: Float32Array, topDb?: number, frameLength?: number, hopLength?: number): WasmTrimResult;
2307
- declare function splitSilence(samples: Float32Array, topDb?: number, frameLength?: number, hopLength?: number): Int32Array;
2308
- declare function frameSignal(samples: Float32Array, frameLength: number, hopLength: number): WasmFrameResult;
2309
- declare function padCenter(values: Float32Array, targetSize: number, padValue?: number): Float32Array;
2310
- declare function fixLength(values: Float32Array, targetSize: number, padValue?: number): Float32Array;
2311
- declare function fixFrames(frames: Int32Array, xMin?: number, xMax?: number, pad?: boolean): Int32Array;
2312
- declare function peakPick(values: Float32Array, preMax: number, postMax: number, preAvg: number, postAvg: number, delta: number, wait: number): Int32Array;
2313
- declare function vectorNormalize(values: Float32Array, normType?: number, threshold?: number): Float32Array;
2314
- declare function pcen(values: Float32Array, nBins: number, nFrames: number, options?: Record<string, number>): Float32Array;
2315
- declare function tonnetz(chromagram: Float32Array, nChroma: number, nFrames: number): Float32Array;
2316
- declare function tempogram(onsetEnvelope: Float32Array, sampleRate?: number, hopLength?: number, winLength?: number, mode?: TempogramMode): WasmTempogramResult;
2317
- declare function cyclicTempogram(onsetEnvelope: Float32Array, sampleRate?: number, hopLength?: number, winLength?: number, bpmMin?: number, nBins?: number): WasmCyclicTempogramResult;
2318
- declare function plp(onsetEnvelope: Float32Array, sampleRate?: number, hopLength?: number, tempoMin?: number, tempoMax?: number, winLength?: number): Float32Array;
2319
- /**
2320
- * Compute NNLS (non-negative least squares) chromagram.
2321
- *
2322
- * @param samples - Audio samples (mono, float32)
2323
- * @param sampleRate - Sample rate in Hz (default: 22050)
2324
- * @returns NNLS chroma result
2325
- */
2326
- declare function nnlsChroma(samples: Float32Array, sampleRate?: number): WasmNnlsChromaResult;
2327
- /**
2328
- * Compute the Constant-Q Transform magnitude.
2329
- *
2330
- * @param samples - Audio samples (mono, float32)
2331
- * @param sampleRate - Sample rate in Hz (default: 22050)
2332
- * @param hopLength - Hop length (default: 512)
2333
- * @param fmin - Minimum frequency in Hz (default: 32.70319566257483, C1)
2334
- * @param nBins - Number of frequency bins (default: 84)
2335
- * @param binsPerOctave - Bins per octave (default: 12)
2336
- * @returns CQT magnitude result
2337
- */
2338
- declare function cqt(samples: Float32Array, sampleRate?: number, hopLength?: number, fmin?: number, nBins?: number, binsPerOctave?: number): CqtResult;
2339
- /**
2340
- * Compute the Variable-Q Transform magnitude (gamma controls Q).
2341
- *
2342
- * @param samples - Audio samples (mono, float32)
2343
- * @param sampleRate - Sample rate in Hz (default: 22050)
2344
- * @param hopLength - Hop length (default: 512)
2345
- * @param fmin - Minimum frequency in Hz (default: 32.70319566257483, C1)
2346
- * @param nBins - Number of frequency bins (default: 84)
2347
- * @param binsPerOctave - Bins per octave (default: 12)
2348
- * @param gamma - Bandwidth offset; 0 is equivalent to CQT (default: 0)
2349
- * @returns VQT magnitude result (same shape as CQT)
2350
- */
2351
- declare function vqt(samples: Float32Array, sampleRate?: number, hopLength?: number, fmin?: number, nBins?: number, binsPerOctave?: number, gamma?: number): CqtResult;
2352
- /**
2353
- * Detect song-structure sections (intro/verse/chorus/...).
2354
- *
2355
- * @param samples - Audio samples (mono, float32)
2356
- * @param sampleRate - Sample rate in Hz (default: 22050)
2357
- * @param nFft - FFT size (default: 2048)
2358
- * @param hopLength - Hop length (default: 512)
2359
- * @param minSectionSec - Minimum section duration in seconds (default: 4.0)
2360
- * @returns Array of detected sections
2361
- */
2362
- declare function analyzeSections(samples: Float32Array, sampleRate?: number, nFft?: number, hopLength?: number, minSectionSec?: number): Section[];
2363
- /**
2364
- * Extract the melody contour from monophonic audio via YIN.
2365
- *
2366
- * @param samples - Audio samples (mono, float32)
2367
- * @param sampleRate - Sample rate in Hz (default: 22050)
2368
- * @param fmin - Minimum frequency in Hz (default: 65.0)
2369
- * @param fmax - Maximum frequency in Hz (default: 2093.0)
2370
- * @param frameLength - Frame length in samples (default: 2048)
2371
- * @param hopLength - Hop length (default: 512)
2372
- * @param threshold - YIN threshold; lower is stricter (default: 0.1)
2373
- * @returns Melody contour with per-frame pitch points and summary stats
2374
- */
2375
- declare function analyzeMelody(samples: Float32Array, sampleRate?: number, fmin?: number, fmax?: number, frameLength?: number, hopLength?: number, threshold?: number): MelodyResult;
2376
- /**
2377
- * Compute the onset strength envelope.
2378
- *
2379
- * @param samples - Audio samples (mono, float32)
2380
- * @param sampleRate - Sample rate in Hz (default: 22050)
2381
- * @param nFft - FFT size (default: 2048)
2382
- * @param hopLength - Hop length (default: 512)
2383
- * @param nMels - Number of Mel bands (default: 128)
2384
- * @returns Onset envelope for each frame
2385
- */
2386
- declare function onsetEnvelope(samples: Float32Array, sampleRate?: number, nFft?: number, hopLength?: number, nMels?: number): Float32Array;
2387
- /**
2388
- * Compute the Fourier tempogram from an onset envelope.
2389
- *
2390
- * @param onsetEnvelope - Onset strength envelope (float32)
2391
- * @param sampleRate - Sample rate in Hz (default: 22050)
2392
- * @param hopLength - Hop length (default: 512)
2393
- * @param winLength - Window length in frames (default: 384)
2394
- * @returns Fourier tempogram result
2395
- */
2396
- declare function fourierTempogram(onsetEnvelope: Float32Array, sampleRate?: number, hopLength?: number, winLength?: number): WasmFourierTempogramResult;
2397
- /**
2398
- * Compute tempogram ratio features.
2399
- *
2400
- * @param tempogramData - Tempogram data (float32)
2401
- * @param winLength - Window length in frames (default: 384)
2402
- * @param sampleRate - Sample rate in Hz (default: 22050)
2403
- * @param hopLength - Hop length (default: 512)
2404
- * @returns Tempogram ratio features
2405
- */
2406
- declare function tempogramRatio(tempogramData: Float32Array, winLength?: number, sampleRate?: number, hopLength?: number): Float32Array;
2407
- /**
2408
- * Measure loudness (EBU R128 / ITU-R BS.1770).
2409
- *
2410
- * @param samples - Audio samples (mono, float32)
2411
- * @param sampleRate - Sample rate in Hz (default: 22050)
2412
- * @returns Loudness measurement result
2413
- */
2414
- declare function lufs(samples: Float32Array, sampleRate?: number, options?: ValidateOptions): LufsResult;
2415
- /**
2416
- * Compute the momentary loudness (LUFS) over time.
2417
- *
2418
- * @param samples - Audio samples (mono, float32)
2419
- * @param sampleRate - Sample rate in Hz (default: 22050)
2420
- * @returns Momentary LUFS values over time
2421
- */
2422
- declare function momentaryLufs(samples: Float32Array, sampleRate?: number, options?: ValidateOptions): Float32Array;
2423
- /**
2424
- * Compute the short-term loudness (LUFS) over time.
2425
- *
2426
- * @param samples - Audio samples (mono, float32)
2427
- * @param sampleRate - Sample rate in Hz (default: 22050)
2428
- * @returns Short-term LUFS values over time
2429
- */
2430
- declare function shortTermLufs(samples: Float32Array, sampleRate?: number, options?: ValidateOptions): Float32Array;
2431
- /** One contiguous run of clipped samples reported by `meteringDetectClipping`. */
2432
- interface ClippingRegion {
2433
- startSample: number;
2434
- endSample: number;
2435
- length: number;
2436
- peak: number;
2437
- }
2438
- /** Aggregated clipping report. */
2439
- interface ClippingReport {
2440
- clippedSamples: number;
2441
- clippingRatio: number;
2442
- maxClippedPeak: number;
2443
- regions: ClippingRegion[];
2444
- }
2445
- /** Sliding-window dynamic range report. */
2446
- interface DynamicRangeReport {
2447
- dynamicRangeDb: number;
2448
- lowPercentileDb: number;
2449
- highPercentileDb: number;
2450
- windowRmsDb: Float32Array;
2451
- }
2452
- declare function meteringPeakDb(samples: Float32Array, sampleRate?: number, options?: ValidateOptions): number;
2453
- declare function meteringRmsDb(samples: Float32Array, sampleRate?: number, options?: ValidateOptions): number;
2454
- declare function meteringCrestFactorDb(samples: Float32Array, sampleRate?: number, options?: ValidateOptions): number;
2455
- declare function meteringDcOffset(samples: Float32Array, sampleRate?: number, options?: ValidateOptions): number;
2456
- /**
2457
- * Inter-sample (true) peak in dBFS. `oversampleFactor` must be a power of two
2458
- * in [1, 16]; pass 0 to use the library default (4).
2459
- */
2460
- declare function meteringTruePeakDb(samples: Float32Array, sampleRate?: number, oversampleFactor?: number, options?: ValidateOptions): number;
2461
- /**
2462
- * Detect contiguous runs of clipped samples.
2463
- *
2464
- * @param threshold Linear absolute threshold (default 0.999).
2465
- * @param minRegionSamples Minimum run length to report (default 1).
2466
- */
2467
- declare function meteringDetectClipping(samples: Float32Array, sampleRate?: number, threshold?: number, minRegionSamples?: number, options?: ValidateOptions): ClippingReport;
2468
- /**
2469
- * Sliding-window dynamic range. Pass 0 for any parameter to use the library
2470
- * default (window=3 s, hop=1 s, low=0.10, high=0.95).
2471
- */
2472
- declare function meteringDynamicRange(samples: Float32Array, sampleRate?: number, windowSec?: number, hopSec?: number, lowPercentile?: number, highPercentile?: number, options?: ValidateOptions): DynamicRangeReport;
2473
- /** Mid/side vectorscope point series for a (left, right) stereo pair. */
2474
- interface VectorscopeReport {
2475
- mid: Float32Array;
2476
- side: Float32Array;
2477
- }
2478
- /** Phase-scope (Lissajous) point series plus summary stats. */
2479
- interface PhaseScopeReport {
2480
- mid: Float32Array;
2481
- side: Float32Array;
2482
- radius: Float32Array;
2483
- angleRad: Float32Array;
2484
- correlation: number;
2485
- averageAbsAngleRad: number;
2486
- maxRadius: number;
2487
- }
2488
- /** Options for `meteringSpectrum`. */
2489
- interface SpectrumOptions {
2490
- /** FFT size. Pass 0 / omit for the library default (2048). */
2491
- nFft?: number;
2492
- /** Apply fractional-octave smoothing to magnitude. */
2493
- applyOctaveSmoothing?: boolean;
2494
- /** Smoothing fraction (e.g. 3 = 1/3-octave). 0 / omit = library default (3). */
2495
- octaveFraction?: number;
2496
- /** Linear reference for the dB conversion. 0 / omit = 1.0. */
2497
- dbRef?: number;
2498
- /** Linear floor used to avoid log(0). 0 / omit = library default. */
2499
- dbAmin?: number;
2500
- }
2501
- /** Single-frame magnitude / power / dB spectrum returned by `meteringSpectrum`. */
2502
- interface SpectrumReport {
2503
- frequencies: Float32Array;
2504
- magnitude: Float32Array;
2505
- power: Float32Array;
2506
- db: Float32Array;
2507
- nFft: number;
2508
- sampleRate: number;
2509
- }
2510
- /** Pearson correlation in [-1, 1] between two equal-length channels. */
2511
- declare function meteringStereoCorrelation(left: Float32Array, right: Float32Array, sampleRate?: number, options?: ValidateOptions): number;
2512
- /** Side / mid energy ratio: 0 = pure mono, ~1 = wide stereo. */
2513
- declare function meteringStereoWidth(left: Float32Array, right: Float32Array, sampleRate?: number, options?: ValidateOptions): number;
2514
- /** Per-sample mid/side point series (one entry per input frame). */
2515
- declare function meteringVectorscope(left: Float32Array, right: Float32Array, sampleRate?: number, options?: ValidateOptions): VectorscopeReport;
2516
- /** Phase-scope point series plus summary stats. */
2517
- declare function meteringPhaseScope(left: Float32Array, right: Float32Array, sampleRate?: number, options?: ValidateOptions): PhaseScopeReport;
2518
- /** Single-frame spectrum view (uses the first `nFft` samples of `samples`). */
2519
- declare function meteringSpectrum(samples: Float32Array, sampleRate?: number, options?: SpectrumOptions & ValidateOptions): SpectrumReport;
2520
- /**
2521
- * Snap a MIDI value to the nearest pitch class enabled by `modeMask`.
2522
- *
2523
- * `modeMask` is a 12-bit mask. For natural C major use `0b101010110101`.
2524
- * `referenceMidi` defaults to A4 (69) when passed as 0.
2525
- */
2526
- declare function scaleQuantizeMidi(root: number, modeMask: number, midi: number, referenceMidi?: number): number;
2527
- declare function scaleCorrectionSemitones(root: number, modeMask: number, midi: number, referenceMidi?: number): number;
2528
- declare function scalePitchClassEnabled(root: number, modeMask: number, pitchClass: number): boolean;
2529
- /**
2530
- * Resample audio to a different sample rate.
2531
- *
2532
- * @param samples - Audio samples (mono, float32)
2533
- * @param srcSr - Source sample rate in Hz
2534
- * @param targetSr - Target sample rate in Hz
2535
- * @returns Resampled audio
2536
- */
2537
- declare function resample(samples: Float32Array, srcSr: number, targetSr: number): Float32Array;
2538
- /**
2539
- * Wrapper around audio data that exposes all analysis and feature functions as instance methods.
2540
- *
2541
- * @example
2542
- * ```typescript
2543
- * import { init, Audio } from '@libraz/sonare';
2544
- *
2545
- * await init();
2546
- *
2547
- * const audio = Audio.fromBuffer(samples, 44100);
2548
- * console.log('BPM:', audio.detectBpm());
2549
- * console.log('Key:', audio.detectKey().name);
2550
- *
2551
- * const mel = audio.melSpectrogram();
2552
- * ```
2553
- */
2554
- declare class Audio {
2555
- private _samples;
2556
- private _sampleRate;
2557
- private constructor();
2558
- /** Create an Audio instance from raw sample data. */
2559
- static fromBuffer(samples: Float32Array, sampleRate: number): Audio;
2560
- /** The raw audio samples. */
2561
- get data(): Float32Array;
2562
- /** Number of samples. */
2563
- get length(): number;
2564
- /** Sample rate in Hz. */
2565
- get sampleRate(): number;
2566
- /** Duration in seconds. */
2567
- get duration(): number;
2568
- detectBpm(): number;
2569
- detectKey(options?: KeyDetectionOptions): Key;
2570
- detectKeyCandidates(options?: KeyDetectionOptions): KeyCandidate[];
2571
- detectOnsets(): Float32Array;
2572
- detectBeats(): Float32Array;
2573
- detectDownbeats(): Float32Array;
2574
- detectChords(options?: ChordDetectionOptions): ChordAnalysisResult;
2575
- analyze(): AnalysisResult;
2576
- analyzeWithProgress(onProgress: ProgressCallback): AnalysisResult;
2577
- hpss(kernelHarmonic?: number, kernelPercussive?: number): HpssResult;
2578
- harmonic(): Float32Array;
2579
- percussive(): Float32Array;
2580
- timeStretch(rate: number): Float32Array;
2581
- pitchShift(semitones: number): Float32Array;
2582
- pitchCorrectToMidi(currentMidi?: number, targetMidi?: number): Float32Array;
2583
- noteStretch(onsetSample?: number, offsetSample?: number, stretchRatio?: number): Float32Array;
2584
- voiceChange(pitchSemitones?: number, formantFactor?: number): Float32Array;
2585
- normalize(targetDb?: number): Float32Array;
2586
- mastering(targetLufs?: number, ceilingDb?: number, truePeakOversample?: number): MasteringResult;
2587
- masteringChain(config: MasteringChainConfig): MasteringChainResult;
2588
- masterAudio(presetName: MasteringPreset, overrides?: Record<string, number | boolean> | null): MasteringChainResult;
2589
- masteringProcess(processorName: SoloProcessor, params?: MasteringProcessorParams): MasteringResult;
2590
- trim(thresholdDb?: number): Float32Array;
2591
- stft(nFft?: number, hopLength?: number): StftResult;
2592
- stftDb(nFft?: number, hopLength?: number): {
2593
- nBins: number;
2594
- nFrames: number;
2595
- db: Float32Array;
2596
- };
2597
- melSpectrogram(nFft?: number, hopLength?: number, nMels?: number): MelSpectrogramResult;
2598
- mfcc(nFft?: number, hopLength?: number, nMels?: number, nMfcc?: number): MfccResult;
2599
- chroma(nFft?: number, hopLength?: number): ChromaResult;
2600
- nnlsChroma(): WasmNnlsChromaResult;
2601
- onsetEnvelope(nFft?: number, hopLength?: number, nMels?: number): Float32Array;
2602
- lufs(): LufsResult;
2603
- momentaryLufs(): Float32Array;
2604
- shortTermLufs(): Float32Array;
2605
- spectralCentroid(nFft?: number, hopLength?: number): Float32Array;
2606
- spectralBandwidth(nFft?: number, hopLength?: number): Float32Array;
2607
- spectralRolloff(nFft?: number, hopLength?: number, rollPercent?: number): Float32Array;
2608
- spectralFlatness(nFft?: number, hopLength?: number): Float32Array;
2609
- zeroCrossingRate(frameLength?: number, hopLength?: number): Float32Array;
2610
- rmsEnergy(frameLength?: number, hopLength?: number): Float32Array;
2611
- pitchYin(frameLength?: number, hopLength?: number, fmin?: number, fmax?: number, threshold?: number, fillNa?: boolean): PitchResult;
2612
- pitchPyin(frameLength?: number, hopLength?: number, fmin?: number, fmax?: number, threshold?: number, fillNa?: boolean): PitchResult;
2613
- resample(targetSr: number): Float32Array;
2614
- }
2615
- /**
2616
- * Real-time streaming audio analyzer.
2617
- *
2618
- * @example
2619
- * ```typescript
2620
- * import { init, StreamAnalyzer } from '@libraz/sonare';
2621
- *
2622
- * await init();
2623
- *
2624
- * const analyzer = new StreamAnalyzer({ sampleRate: 44100 });
2625
- *
2626
- * // In audio processing callback
2627
- * analyzer.process(samples);
2628
- *
2629
- * // Get current analysis state
2630
- * const stats = analyzer.stats();
2631
- * console.log('BPM:', stats.estimate.bpm);
2632
- * console.log('Key:', stats.estimate.key);
2633
- * console.log('Chord progression:', stats.estimate.chordProgression);
2634
- * ```
2635
- */
2636
- declare class StreamAnalyzer {
2637
- private analyzer;
2638
- /**
2639
- * Create a new StreamAnalyzer.
2640
- *
2641
- * @param config - Configuration options
2642
- */
2643
- constructor(config: StreamConfig);
2644
- /**
2645
- * Process audio samples.
2646
- *
2647
- * @param samples - Audio samples (mono, float32)
2648
- */
2649
- process(samples: Float32Array): void;
2650
- /**
2651
- * Process audio samples with explicit sample offset.
2652
- *
2653
- * @param samples - Audio samples (mono, float32)
2654
- * @param sampleOffset - Cumulative sample count at start of this chunk
2655
- */
2656
- processWithOffset(samples: Float32Array, sampleOffset: number): void;
2657
- /**
2658
- * Get the number of frames available to read.
2659
- */
2660
- availableFrames(): number;
2661
- /**
2662
- * Read processed frames as Structure of Arrays.
2663
- *
2664
- * @param maxFrames - Maximum number of frames to read
2665
- * @returns Frame buffer with analysis results
2666
- */
2667
- readFrames(maxFrames: number): FrameBuffer;
2668
- readFramesU8(maxFrames: number): StreamFramesU8;
2669
- readFramesI16(maxFrames: number): StreamFramesI16;
2670
- /**
2671
- * Reset the analyzer state.
2672
- *
2673
- * @param baseSampleOffset - Starting sample offset (default 0)
2674
- */
2675
- reset(baseSampleOffset?: number): void;
2676
- /**
2677
- * Get current statistics and progressive estimates.
2678
- *
2679
- * @returns Analyzer statistics including BPM, key, and chord progression
2680
- */
2681
- stats(): AnalyzerStats;
2682
- /**
2683
- * Get total frames processed.
2684
- */
2685
- frameCount(): number;
2686
- /**
2687
- * Get current time position in seconds.
2688
- */
2689
- currentTime(): number;
2690
- /**
2691
- * Get the sample rate.
2692
- */
2693
- sampleRate(): number;
2694
- /**
2695
- * Set the expected total duration for pattern lock timing.
2696
- *
2697
- * @param durationSeconds - Total duration in seconds
2698
- */
2699
- setExpectedDuration(durationSeconds: number): void;
2700
- /**
2701
- * Set normalization gain for loud/compressed audio.
2702
- *
2703
- * @param gain - Gain factor to apply (e.g., 0.5 for -6dB reduction)
2704
- */
2705
- setNormalizationGain(gain: number): void;
2706
- /**
2707
- * Set tuning reference frequency for non-standard tuning.
2708
- *
2709
- * @param refHz - Reference frequency for A4 (default 440 Hz)
2710
- * @example
2711
- * // If audio is 1 semitone sharp (A4 = 466.16 Hz)
2712
- * analyzer.setTuningRefHz(466.16);
2713
- * // If audio is 1 semitone flat (A4 = 415.30 Hz)
2714
- * analyzer.setTuningRefHz(415.30);
2715
- */
2716
- setTuningRefHz(refHz: number): void;
2717
- /**
2718
- * Release resources. Call when done using the analyzer.
2719
- */
2720
- dispose(): void;
2721
- }
2722
-
2723
- export { type AcousticResult, type AnalysisResult, type AnalyzerStats, Audio, type AutomationCurve, type BarChord, type Beat, type BpmAnalysisResult, type BpmCandidate, type Chord, type ChordAnalysisResult, type ChordChange, type ChordDetectionOptions, ChordQuality, type ChromaResult, type ClippingRegion, type ClippingReport, type CompressorDetector, type CompressorOptions, type CqtResult, type DeclickOptions, type DeclipOptions, type DecomposeResult, type DecrackleMode, type DecrackleOptions, type DehumOptions, type DenoiseClassicalMode, type DenoiseClassicalNoiseEstimator, type DenoiseClassicalOptions, type DereverbClassicalOptions, type DynamicRangeReport, type Dynamics, type DynamicsAnalysisResult, type DynamicsResult, EXPECTED_ENGINE_ABI_VERSION, type EngineAutomationPoint, type EngineBounceOptions, type EngineBounceResult, type EngineCapabilities, type EngineCaptureStatus, type EngineClip, type EngineFreezeOptions, type EngineFreezeResult, type EngineGraphSpec, type EngineMarker, type EngineMeterTelemetry, type EngineMetronomeConfig, type EngineParameterInfo, type EngineTelemetry, type EngineTransportState, type EqBand, type EqBandPhase, type EqBandType, type EqCoeffMode, type EqMatchOptions, type EqSpectrumSnapshot, type EqStereoPlacement, type FrameBuffer, type GateOptions, type GoniometerPoint, type HpssResult, type HpssWithResidualResult, type Key, type KeyCandidate, type KeyDetectionOptions, KeyProfile, type KeyProfileName, type LufsResult, type MasteringChainConfig, type MasteringChainResult, type MasteringPreset, type MasteringProcessorParams, type MasteringResult, type MasteringStereoChainResult, type MasteringStereoResult, type Matrix2dResult, type MelSpectrogramResult, type MelodyPoint, type MelodyResult, type MeterTap, type MfccResult, type MixMeterSnapshot, type MixOptions, type MixResult, Mixer, type MixerProcessResult, type MixerRealtimeBuffer, Mode, type PairAnalysis, type PairProcessor, type PanLaw, type PanMode, type PatternScore, type PhaseScopeReport, PitchClass as Pitch, PitchClass, type PitchResult, type ProgressiveEstimate, RealtimeEngine, RealtimeVoiceChanger, type RealtimeVoiceChangerConfigInput, type RealtimeVoiceChangerInterleavedBuffer, type RealtimeVoiceChangerMonoBuffer, type RealtimeVoiceChangerPlanarBuffer, type RhythmAnalysisResult, type RhythmFeatures, type Section, SectionType, type SendTiming, type SoloProcessor, type SpectrumOptions, type SpectrumReport, type StereoAnalysis, type StftResult, StreamAnalyzer, type StreamConfig, type StreamFramesI16, type StreamFramesU8, StreamingEqualizer, type StreamingEqualizerConfig, StreamingMasteringChain, type StreamingPlatform, StreamingRetune, type StreamingRetuneConfig, type Timbre, type TimbreAnalysisResult, type TimbreFrame, type TimeSignature, type TransientShaperOptions, type TrimSilenceMode, type TrimSilenceOptions, type ValidateOptions, type VectorscopeReport, type VoicePresetId, amplitudeToDb, analyze, analyzeBpm, analyzeDynamics, analyzeImpulseResponse, analyzeMelody, analyzeRhythm, analyzeSections, analyzeTimbre, analyzeWithProgress, chroma, cqt, cyclicTempogram, dbToAmplitude, dbToPower, decompose, deemphasis, detectAcoustic, detectBeats, detectBpm, detectChords, detectDownbeats, detectKey, detectKeyCandidates, detectOnsets, ebur128LoudnessRange, engineAbiVersion, engineCapabilities, estimateTuning, fixFrames, fixLength, fourierTempogram, frameSignal, framesToSamples, framesToTime, harmonic, hasFfmpegSupport, hpss, hpssWithResidual, hzToMel, hzToMidi, hzToNote, init, isInitialized, lufs, lufsInterleaved, masterAudio, masterAudioStereo, masterAudioStereoWithProgress, masterAudioWithProgress, mastering, masteringAssistantSuggest, masteringAudioProfile, masteringChain, masteringChainStereo, masteringChainStereoWithProgress, masteringChainWithProgress, masteringDynamicsCompressor, masteringDynamicsGate, masteringDynamicsTransientShaper, masteringPairAnalysisNames, masteringPairAnalyze, masteringPairProcess, masteringPairProcessorNames, masteringPresetNames, masteringProcess, masteringProcessStereo, masteringProcessorNames, masteringRepairDeclick, masteringRepairDeclip, masteringRepairDecrackle, masteringRepairDehum, masteringRepairDenoiseClassical, masteringRepairDereverbClassical, masteringRepairTrimSilence, masteringStereoAnalysisNames, masteringStereoAnalyze, masteringStreamingPreview, melSpectrogram, melToAudio, melToHz, melToStft, meteringCrestFactorDb, meteringDcOffset, meteringDetectClipping, meteringDynamicRange, meteringPeakDb, meteringPhaseScope, meteringRmsDb, meteringSpectrum, meteringStereoCorrelation, meteringStereoWidth, meteringTruePeakDb, meteringVectorscope, mfcc, mfccToAudio, mfccToMel, midiToHz, mixStereo, mixingScenePresetJson, mixingScenePresetNames, momentaryLufs, nnFilter, nnlsChroma, normalize, noteStretch, noteToHz, onsetEnvelope, padCenter, pcen, peakPick, percussive, phaseVocoder, pitchCorrectToMidi, pitchPyin, pitchShift, pitchTuning, pitchYin, plp, polyFeatures, powerToDb, preemphasis, realtimeVoiceChangerPresetConfig, realtimeVoiceChangerPresetJson, realtimeVoiceChangerPresetNames, remix, resample, rmsEnergy, samplesToFrames, scaleCorrectionSemitones, scalePitchClassEnabled, scaleQuantizeMidi, shortTermLufs, spectralBandwidth, spectralCentroid, spectralContrast, spectralFlatness, spectralRolloff, splitSilence, stft, stftDb, tempogram, tempogramRatio, timeStretch, timeToFrames, tonnetz, trim, trimSilence, validateRealtimeVoiceChangerPresetJson, vectorNormalize, version, voiceChange, voiceChangerAbiVersion, voiceCharacterPresetId, vqt, zeroCrossingRate, zeroCrossings };