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