@libraz/libsonare 1.7.1 → 1.8.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/NOTICE +178 -0
- package/README.md +26 -170
- package/dist/_chain_config.d.ts +14 -0
- package/dist/_chain_config.d.ts.map +1 -0
- package/dist/_effects_common.d.ts +6 -0
- package/dist/_effects_common.d.ts.map +1 -0
- package/dist/_feature_validation.d.ts +8 -0
- package/dist/_feature_validation.d.ts.map +1 -0
- package/dist/_fft_options.d.ts +24 -0
- package/dist/_fft_options.d.ts.map +1 -0
- package/dist/align_take.d.ts +50 -0
- package/dist/align_take.d.ts.map +1 -0
- package/dist/analysis.d.ts +29 -5837
- package/dist/analysis.d.ts.map +1 -0
- package/dist/analysis.js +873 -722
- package/dist/analysis.js.map +1 -1
- package/dist/analysis_helpers.d.ts +9 -0
- package/dist/analysis_helpers.d.ts.map +1 -0
- package/dist/audio.d.ts +163 -0
- package/dist/audio.d.ts.map +1 -0
- package/dist/clip_page_streamer.d.ts +133 -0
- package/dist/clip_page_streamer.d.ts.map +1 -0
- package/dist/codes.d.ts +44 -0
- package/dist/codes.d.ts.map +1 -0
- package/dist/effects_mastering.d.ts +23 -0
- package/dist/effects_mastering.d.ts.map +1 -0
- package/dist/effects_note_ops.d.ts +477 -0
- package/dist/effects_note_ops.d.ts.map +1 -0
- package/dist/effects_percussive.d.ts +185 -0
- package/dist/effects_percussive.d.ts.map +1 -0
- package/dist/effects_separation.d.ts +65 -0
- package/dist/effects_separation.d.ts.map +1 -0
- package/dist/effects_spectral.d.ts +28 -0
- package/dist/effects_spectral.d.ts.map +1 -0
- package/dist/effects_timepitch.d.ts +129 -0
- package/dist/effects_timepitch.d.ts.map +1 -0
- package/dist/effects_voice_change.d.ts +53 -0
- package/dist/effects_voice_change.d.ts.map +1 -0
- package/dist/errors.d.ts +51 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/feature_core.d.ts +341 -0
- package/dist/feature_core.d.ts.map +1 -0
- package/dist/feature_decompose.d.ts +278 -0
- package/dist/feature_decompose.d.ts.map +1 -0
- package/dist/feature_inverse.d.ts +128 -0
- package/dist/feature_inverse.d.ts.map +1 -0
- package/dist/feature_loudness.d.ts +66 -0
- package/dist/feature_loudness.d.ts.map +1 -0
- package/dist/feature_music.d.ts +307 -0
- package/dist/feature_music.d.ts.map +1 -0
- package/dist/feature_pitch.d.ts +108 -0
- package/dist/feature_pitch.d.ts.map +1 -0
- package/dist/feature_resample.d.ts +16 -0
- package/dist/feature_resample.d.ts.map +1 -0
- package/dist/feature_spectral.d.ts +137 -0
- package/dist/feature_spectral.d.ts.map +1 -0
- package/dist/feature_spectrogram.d.ts +198 -0
- package/dist/feature_spectrogram.d.ts.map +1 -0
- package/dist/features.d.ts +10 -0
- package/dist/features.d.ts.map +1 -0
- package/dist/hrtf/default.shrf +0 -0
- package/dist/index.d.ts +74 -7329
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3816 -1359
- package/dist/index.js.map +1 -1
- package/dist/instrument_types.d.ts +517 -0
- package/dist/instrument_types.d.ts.map +1 -0
- package/dist/live_audio.d.ts +35 -0
- package/dist/live_audio.d.ts.map +1 -0
- package/dist/mastering_chain.d.ts +213 -0
- package/dist/mastering_chain.d.ts.map +1 -0
- package/dist/mastering_core.d.ts +457 -0
- package/dist/mastering_core.d.ts.map +1 -0
- package/dist/mastering_dynamics.d.ts +80 -0
- package/dist/mastering_dynamics.d.ts.map +1 -0
- package/dist/metering.d.ts +287 -0
- package/dist/metering.d.ts.map +1 -0
- package/dist/mixer.d.ts +464 -0
- package/dist/mixer.d.ts.map +1 -0
- package/dist/mixing_assistant.d.ts +62 -0
- package/dist/mixing_assistant.d.ts.map +1 -0
- package/dist/mixing_oneshot.d.ts +40 -0
- package/dist/mixing_oneshot.d.ts.map +1 -0
- package/dist/module_state.d.ts +15 -0
- package/dist/module_state.d.ts.map +1 -0
- package/dist/opfs_clip_pages.d.ts +28 -0
- package/dist/opfs_clip_pages.d.ts.map +1 -0
- package/dist/playback_renderer.d.ts +128 -0
- package/dist/playback_renderer.d.ts.map +1 -0
- package/dist/polyphony.d.ts +202 -0
- package/dist/polyphony.d.ts.map +1 -0
- package/dist/project.d.ts +8 -0
- package/dist/project.d.ts.map +1 -0
- package/dist/project_class.d.ts +562 -0
- package/dist/project_class.d.ts.map +1 -0
- package/dist/project_internal.d.ts +194 -0
- package/dist/project_internal.d.ts.map +1 -0
- package/dist/project_synth.d.ts +74 -0
- package/dist/project_synth.d.ts.map +1 -0
- package/dist/project_types.d.ts +652 -0
- package/dist/project_types.d.ts.map +1 -0
- package/dist/public_types.d.ts +185 -0
- package/dist/public_types.d.ts.map +1 -0
- package/dist/public_types_acoustic.d.ts +215 -0
- package/dist/public_types_acoustic.d.ts.map +1 -0
- package/dist/public_types_mastering.d.ts +510 -0
- package/dist/public_types_mastering.d.ts.map +1 -0
- package/dist/public_types_mixing.d.ts +436 -0
- package/dist/public_types_mixing.d.ts.map +1 -0
- package/dist/public_types_music.d.ts +619 -0
- package/dist/public_types_music.d.ts.map +1 -0
- package/dist/public_types_playback.d.ts +164 -0
- package/dist/public_types_playback.d.ts.map +1 -0
- package/dist/public_types_realtime.d.ts +174 -0
- package/dist/public_types_realtime.d.ts.map +1 -0
- package/dist/public_types_repair.d.ts +424 -0
- package/dist/public_types_repair.d.ts.map +1 -0
- package/dist/public_types_spectral.d.ts +697 -0
- package/dist/public_types_spectral.d.ts.map +1 -0
- package/dist/quick_analysis.d.ts +445 -0
- package/dist/quick_analysis.d.ts.map +1 -0
- package/dist/realtime_engine.d.ts +850 -0
- package/dist/realtime_engine.d.ts.map +1 -0
- package/dist/realtime_voice_changer.d.ts +158 -0
- package/dist/realtime_voice_changer.d.ts.map +1 -0
- package/dist/repair_dereverb.d.ts +187 -0
- package/dist/repair_dereverb.d.ts.map +1 -0
- package/dist/repair_impulsive.d.ts +186 -0
- package/dist/repair_impulsive.d.ts.map +1 -0
- package/dist/repair_noise.d.ts +239 -0
- package/dist/repair_noise.d.ts.map +1 -0
- package/dist/repair_trim.d.ts +123 -0
- package/dist/repair_trim.d.ts.map +1 -0
- package/dist/sample_bank.d.ts +84 -0
- package/dist/sample_bank.d.ts.map +1 -0
- package/dist/scale.d.ts +10 -0
- package/dist/scale.d.ts.map +1 -0
- package/dist/schemas/mixer-scene.schema.json +393 -0
- package/dist/schemas/playback-renderer-config.schema.json +392 -0
- package/dist/sonare-analysis.d.ts +8 -0
- package/dist/sonare-analysis.js +2 -2
- package/dist/sonare-analysis.wasm +0 -0
- package/dist/sonare.d.ts +3909 -0
- package/dist/sonare.js +2 -2
- package/dist/sonare.wasm +0 -0
- package/dist/stream_analyzer.d.ts +163 -0
- package/dist/stream_analyzer.d.ts.map +1 -0
- package/dist/stream_types.d.ts +214 -0
- package/dist/stream_types.d.ts.map +1 -0
- package/dist/streaming_mixing.d.ts +6 -0
- package/dist/streaming_mixing.d.ts.map +1 -0
- package/dist/streaming_processors.d.ts +335 -0
- package/dist/streaming_processors.d.ts.map +1 -0
- package/dist/transcribe.d.ts +77 -0
- package/dist/transcribe.d.ts.map +1 -0
- package/dist/validation.d.ts +140 -0
- package/dist/validation.d.ts.map +1 -0
- package/dist/web_midi.d.ts +77 -0
- package/dist/web_midi.d.ts.map +1 -0
- package/dist/worker.d.ts +5 -48
- package/dist/worker.d.ts.map +1 -0
- package/dist/worker.js +94 -41
- package/dist/worker.js.map +1 -1
- package/dist/worker_client.d.ts +96 -0
- package/dist/worker_client.d.ts.map +1 -0
- package/dist/worker_protocol.d.ts +43 -0
- package/dist/worker_protocol.d.ts.map +1 -0
- package/dist/worklet/audio_types.d.ts +21 -0
- package/dist/worklet/audio_types.d.ts.map +1 -0
- package/dist/worklet/engine-automation.d.ts +29 -0
- package/dist/worklet/engine-automation.d.ts.map +1 -0
- package/dist/worklet/engine-capture-facade.d.ts +35 -0
- package/dist/worklet/engine-capture-facade.d.ts.map +1 -0
- package/dist/worklet/engine-clips.d.ts +23 -0
- package/dist/worklet/engine-clips.d.ts.map +1 -0
- package/dist/worklet/engine-markers.d.ts +40 -0
- package/dist/worklet/engine-markers.d.ts.map +1 -0
- package/dist/worklet/engine-mixer-facade.d.ts +128 -0
- package/dist/worklet/engine-mixer-facade.d.ts.map +1 -0
- package/dist/worklet/engine-node.d.ts +81 -0
- package/dist/worklet/engine-node.d.ts.map +1 -0
- package/dist/worklet/engine-offline.d.ts +81 -0
- package/dist/worklet/engine-offline.d.ts.map +1 -0
- package/dist/worklet/engine-options.d.ts +12 -0
- package/dist/worklet/engine-options.d.ts.map +1 -0
- package/dist/worklet/engine-parameter-facade.d.ts +106 -0
- package/dist/worklet/engine-parameter-facade.d.ts.map +1 -0
- package/dist/worklet/engine-processor.d.ts +68 -0
- package/dist/worklet/engine-processor.d.ts.map +1 -0
- package/dist/worklet/engine-register.d.ts +2 -0
- package/dist/worklet/engine-register.d.ts.map +1 -0
- package/dist/worklet/engine-strips.d.ts +73 -0
- package/dist/worklet/engine-strips.d.ts.map +1 -0
- package/dist/worklet/engine-sync.d.ts +37 -0
- package/dist/worklet/engine-sync.d.ts.map +1 -0
- package/dist/worklet/engine-tempo-facade.d.ts +48 -0
- package/dist/worklet/engine-tempo-facade.d.ts.map +1 -0
- package/dist/worklet/engine.d.ts +397 -0
- package/dist/worklet/engine.d.ts.map +1 -0
- package/dist/worklet/guards.d.ts +47 -0
- package/dist/worklet/guards.d.ts.map +1 -0
- package/dist/worklet/messages.d.ts +710 -0
- package/dist/worklet/messages.d.ts.map +1 -0
- package/dist/worklet/mixer-processor.d.ts +46 -0
- package/dist/worklet/mixer-processor.d.ts.map +1 -0
- package/dist/worklet/playback-processor.d.ts +62 -0
- package/dist/worklet/playback-processor.d.ts.map +1 -0
- package/dist/worklet/protocol.d.ts +323 -0
- package/dist/worklet/protocol.d.ts.map +1 -0
- package/dist/worklet/voice-changer-processor.d.ts +41 -0
- package/dist/worklet/voice-changer-processor.d.ts.map +1 -0
- package/dist/worklet.d.ts +16 -2142
- package/dist/worklet.d.ts.map +1 -0
- package/dist/worklet.js +2889 -466
- package/dist/worklet.js.map +1 -1
- package/package.json +23 -12
- package/src/_effects_common.ts +17 -0
- package/src/_feature_validation.ts +34 -0
- package/src/_fft_options.ts +39 -0
- package/src/align_take.ts +64 -0
- package/src/analysis.ts +56 -3
- package/src/analysis_helpers.ts +7 -0
- package/src/audio.ts +106 -3
- package/src/codes.ts +39 -2
- package/src/effects_mastering.ts +97 -22
- package/src/effects_note_ops.ts +635 -0
- package/src/effects_percussive.ts +217 -0
- package/src/effects_separation.ts +150 -0
- package/src/effects_spectral.ts +60 -0
- package/src/effects_timepitch.ts +377 -0
- package/src/errors.ts +23 -1
- package/src/feature_core.ts +127 -2
- package/src/feature_decompose.ts +633 -0
- package/src/feature_inverse.ts +454 -0
- package/src/feature_loudness.ts +125 -0
- package/src/feature_music.ts +107 -14
- package/src/feature_pitch.ts +96 -1
- package/src/feature_spectral.ts +16 -611
- package/src/feature_spectrogram.ts +63 -450
- package/src/features.ts +36 -22
- package/src/index.ts +285 -30
- package/src/instrument_types.ts +645 -0
- package/src/live_audio.ts +27 -1
- package/src/mastering_chain.ts +184 -0
- package/src/mastering_core.ts +346 -32
- package/src/mastering_dynamics.ts +22 -11
- package/src/metering.ts +67 -24
- package/src/mixer.ts +212 -3
- package/src/mixing_assistant.ts +138 -0
- package/src/mixing_oneshot.ts +10 -5
- package/src/module_state.ts +24 -2
- package/src/playback_renderer.ts +252 -0
- package/src/polyphony.ts +279 -0
- package/src/project.ts +64 -24
- package/src/project_class.ts +502 -29
- package/src/project_internal.ts +151 -42
- package/src/project_synth.ts +67 -1
- package/src/project_types.ts +302 -270
- package/src/public_types.ts +122 -3
- package/src/public_types_acoustic.ts +112 -3
- package/src/public_types_mastering.ts +254 -73
- package/src/public_types_mixing.ts +363 -1
- package/src/public_types_music.ts +312 -2
- package/src/public_types_playback.ts +195 -0
- package/src/public_types_realtime.ts +39 -7
- package/src/public_types_repair.ts +446 -0
- package/src/public_types_spectral.ts +487 -1
- package/src/quick_analysis.ts +203 -26
- package/src/realtime_engine.ts +750 -28
- package/src/realtime_voice_changer.ts +55 -1
- package/src/repair_dereverb.ts +299 -0
- package/src/repair_impulsive.ts +395 -0
- package/src/repair_noise.ts +425 -0
- package/src/repair_trim.ts +226 -0
- package/src/sample_bank.ts +113 -0
- package/src/sonare.js.d.ts +1125 -30
- package/src/stream_analyzer.ts +36 -4
- package/src/stream_types.ts +37 -0
- package/src/streaming_mixing.ts +1 -1
- package/src/streaming_processors.ts +212 -10
- package/src/transcribe.ts +89 -0
- package/src/validation.ts +285 -11
- package/src/web_midi.ts +1 -6
- package/src/worker.ts +18 -2
- package/src/worklet/audio_types.ts +37 -0
- package/src/worklet/engine-mixer-facade.ts +444 -10
- package/src/worklet/engine-node.ts +85 -28
- package/src/worklet/engine-offline.ts +14 -8
- package/src/worklet/engine-parameter-facade.ts +21 -0
- package/src/worklet/engine-processor.ts +307 -71
- package/src/worklet/engine-register.ts +32 -18
- package/src/worklet/engine-strips.ts +280 -9
- package/src/worklet/engine-sync.ts +14 -6
- package/src/worklet/engine.ts +365 -31
- package/src/worklet/guards.ts +140 -44
- package/src/worklet/messages.ts +239 -2
- package/src/worklet/mixer-processor.ts +109 -47
- package/src/worklet/playback-processor.ts +300 -0
- package/src/worklet/protocol.ts +53 -3
- package/src/worklet/voice-changer-processor.ts +17 -11
- package/src/worklet.ts +22 -0
- package/src/effects_transform.ts +0 -718
- package/src/mastering_repair.ts +0 -273
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import type { MasteringChainConfig, MasteringChainResult, MasteringChainStereoResult, MasteringPreset } from './public_types';
|
|
2
|
+
import type { ProgressCallback } from './sonare.js';
|
|
3
|
+
import type { ValidateOptions } from './validation';
|
|
4
|
+
export type NormalizeMode = 'peak' | 'rms';
|
|
5
|
+
export interface NormalizeRequest extends ValidateOptions {
|
|
6
|
+
samples: Float32Array;
|
|
7
|
+
sampleRate?: number;
|
|
8
|
+
targetDb?: number;
|
|
9
|
+
mode?: NormalizeMode;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Normalize audio to a target peak or RMS level.
|
|
13
|
+
*
|
|
14
|
+
* @param samples - Audio samples (mono, float32)
|
|
15
|
+
* @param sampleRate - Sample rate in Hz (default: 22050)
|
|
16
|
+
* @param targetDb - Finite target at or below 0 dBFS (default: 0 dB = full scale).
|
|
17
|
+
* For `mode: 'peak'`, this is the peak target; for `mode: 'rms'`, this is the RMS target.
|
|
18
|
+
* @param mode - Normalization mode: `'peak'` (default) or `'rms'`.
|
|
19
|
+
* @returns Normalized audio
|
|
20
|
+
*/
|
|
21
|
+
export declare function normalize(request: NormalizeRequest): Float32Array;
|
|
22
|
+
export declare function normalize(samples: Float32Array, sampleRate: number, targetDb?: number, options?: ValidateOptions): Float32Array;
|
|
23
|
+
export declare function normalize(samples: Float32Array, sampleRate: number, targetDb?: number, mode?: NormalizeMode, options?: ValidateOptions): Float32Array;
|
|
24
|
+
export interface NormalizeStereoRequest extends ValidateOptions {
|
|
25
|
+
left: Float32Array;
|
|
26
|
+
right: Float32Array;
|
|
27
|
+
sampleRate?: number;
|
|
28
|
+
targetDb?: number;
|
|
29
|
+
mode?: NormalizeMode;
|
|
30
|
+
}
|
|
31
|
+
/** A normalized channel pair and the gain both channels were moved by. */
|
|
32
|
+
export interface NormalizeStereoResult {
|
|
33
|
+
left: Float32Array;
|
|
34
|
+
right: Float32Array;
|
|
35
|
+
/**
|
|
36
|
+
* One figure rather than a pair: the gain is one decision shared by both
|
|
37
|
+
* channels. Silence leaves the pair untouched and reports 0.
|
|
38
|
+
*/
|
|
39
|
+
appliedGainDb: number;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Normalize a stereo pair on a gain measured across both channels.
|
|
43
|
+
*
|
|
44
|
+
* Normalizing the two channels separately lifts the quieter one until the peaks
|
|
45
|
+
* match, which changes the balance rather than the level. The level here is read
|
|
46
|
+
* from the pair and the resulting gain goes to both channels, so the image is
|
|
47
|
+
* preserved: for `mode: 'peak'` the louder channel reaches `targetDb` and the
|
|
48
|
+
* other keeps its distance from it; for `mode: 'rms'` the quantity driven to
|
|
49
|
+
* `targetDb` is the root mean square over both channels' samples together — the
|
|
50
|
+
* quadratic mean of the per-channel figures, not their average — and the output
|
|
51
|
+
* is hard-clipped to [-1, 1].
|
|
52
|
+
*
|
|
53
|
+
* @param request.left - Left channel samples (float32)
|
|
54
|
+
* @param request.right - Right channel samples, same length as `left`
|
|
55
|
+
* @param request.sampleRate - Sample rate in Hz (default: 22050)
|
|
56
|
+
* @param request.targetDb - Finite target at or below 0 dBFS. Defaults to 0 for
|
|
57
|
+
* `mode: 'peak'` and -20 for `mode: 'rms'`, matching the library and the other
|
|
58
|
+
* language surfaces.
|
|
59
|
+
* @param request.mode - `'peak'` (default) or `'rms'`
|
|
60
|
+
* @returns The normalized pair and the shared gain in dB
|
|
61
|
+
* @throws RangeError when the two channels differ in length
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* ```ts
|
|
65
|
+
* const { left, right, appliedGainDb } = normalizeStereo({
|
|
66
|
+
* left: leftSamples,
|
|
67
|
+
* right: rightSamples,
|
|
68
|
+
* sampleRate: 44100,
|
|
69
|
+
* targetDb: -1,
|
|
70
|
+
* });
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
export declare function normalizeStereo(request: NormalizeStereoRequest): NormalizeStereoResult;
|
|
74
|
+
export interface MasteringChainRequest {
|
|
75
|
+
samples: Float32Array;
|
|
76
|
+
sampleRate?: number;
|
|
77
|
+
config?: MasteringChainConfig;
|
|
78
|
+
onProgress?: ProgressCallback;
|
|
79
|
+
cancel?: () => boolean;
|
|
80
|
+
}
|
|
81
|
+
export interface MasteringChainStereoRequest {
|
|
82
|
+
left: Float32Array;
|
|
83
|
+
right: Float32Array;
|
|
84
|
+
sampleRate?: number;
|
|
85
|
+
config?: MasteringChainConfig;
|
|
86
|
+
onProgress?: ProgressCallback;
|
|
87
|
+
cancel?: () => boolean;
|
|
88
|
+
}
|
|
89
|
+
/** Canonical request form for one-shot preset mastering. */
|
|
90
|
+
export interface MasterAudioRequest {
|
|
91
|
+
samples: Float32Array;
|
|
92
|
+
sampleRate?: number;
|
|
93
|
+
preset?: MasteringPreset;
|
|
94
|
+
overrides?: MasteringChainConfig;
|
|
95
|
+
onProgress?: ProgressCallback;
|
|
96
|
+
cancel?: () => boolean;
|
|
97
|
+
}
|
|
98
|
+
/** Canonical request form for one-shot stereo preset mastering. */
|
|
99
|
+
export interface MasterAudioStereoRequest {
|
|
100
|
+
left: Float32Array;
|
|
101
|
+
right: Float32Array;
|
|
102
|
+
sampleRate?: number;
|
|
103
|
+
preset?: MasteringPreset;
|
|
104
|
+
overrides?: MasteringChainConfig;
|
|
105
|
+
onProgress?: ProgressCallback;
|
|
106
|
+
cancel?: () => boolean;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Apply a configurable mastering chain in WASM.
|
|
110
|
+
*
|
|
111
|
+
* @param samples - Audio samples (mono, float32)
|
|
112
|
+
* @param sampleRate - Sample rate in Hz (default: 22050)
|
|
113
|
+
* @param config - Chain stage configuration
|
|
114
|
+
* @returns Processed audio, loudness metadata, and applied stage names
|
|
115
|
+
*/
|
|
116
|
+
export declare function masteringChain(request: MasteringChainRequest): MasteringChainResult;
|
|
117
|
+
export declare function masteringChain(samples: Float32Array, sampleRate?: number, config?: MasteringChainConfig, onProgress?: ProgressCallback): MasteringChainResult;
|
|
118
|
+
/**
|
|
119
|
+
* Apply a configurable stereo mastering chain in WASM.
|
|
120
|
+
*
|
|
121
|
+
* @param left - Left channel samples
|
|
122
|
+
* @param right - Right channel samples
|
|
123
|
+
* @param sampleRate - Sample rate in Hz
|
|
124
|
+
* @param config - Chain stage configuration
|
|
125
|
+
* @returns Processed stereo audio, loudness metadata, and applied stage names
|
|
126
|
+
*/
|
|
127
|
+
export declare function masteringChainStereo(request: MasteringChainStereoRequest): MasteringChainStereoResult;
|
|
128
|
+
export declare function masteringChainStereo(left: Float32Array, right: Float32Array, sampleRate?: number, config?: MasteringChainConfig, onProgress?: ProgressCallback): MasteringChainStereoResult;
|
|
129
|
+
/**
|
|
130
|
+
* Apply a configurable mastering chain in WASM with progress reporting.
|
|
131
|
+
*
|
|
132
|
+
* @param samples - Audio samples (mono, float32)
|
|
133
|
+
* @param sampleRate - Sample rate in Hz (default: 22050)
|
|
134
|
+
* @param config - Chain stage configuration
|
|
135
|
+
* @param onProgress - Progress callback (progress: 0-1, stage: string)
|
|
136
|
+
* @returns Processed audio, loudness metadata, and applied stage names
|
|
137
|
+
*/
|
|
138
|
+
export declare function masteringChainWithProgress(request: MasteringChainRequest & Required<Pick<MasteringChainRequest, 'onProgress'>>): MasteringChainResult;
|
|
139
|
+
export declare function masteringChainWithProgress(samples: Float32Array, sampleRate?: number, config?: MasteringChainConfig, onProgress?: ProgressCallback): MasteringChainResult;
|
|
140
|
+
/**
|
|
141
|
+
* Apply a configurable stereo mastering chain in WASM with progress reporting.
|
|
142
|
+
*
|
|
143
|
+
* @param left - Left channel samples
|
|
144
|
+
* @param right - Right channel samples
|
|
145
|
+
* @param sampleRate - Sample rate in Hz
|
|
146
|
+
* @param config - Chain stage configuration
|
|
147
|
+
* @param onProgress - Progress callback (progress: 0-1, stage: string)
|
|
148
|
+
* @returns Processed stereo audio, loudness metadata, and applied stage names
|
|
149
|
+
*/
|
|
150
|
+
export declare function masteringChainStereoWithProgress(request: MasteringChainStereoRequest & Required<Pick<MasteringChainStereoRequest, 'onProgress'>>): MasteringChainStereoResult;
|
|
151
|
+
export declare function masteringChainStereoWithProgress(left: Float32Array, right: Float32Array, sampleRate?: number, config?: MasteringChainConfig, onProgress?: ProgressCallback): MasteringChainStereoResult;
|
|
152
|
+
/**
|
|
153
|
+
* List built-in mastering preset identifiers.
|
|
154
|
+
*
|
|
155
|
+
* @returns Preset names in display order (e.g. "pop", "edm", "aiMusic")
|
|
156
|
+
*/
|
|
157
|
+
export declare function masteringPresetNames(): MasteringPreset[];
|
|
158
|
+
/**
|
|
159
|
+
* The flat `{key: number|boolean}` params of preset `preset`'s built-in chain
|
|
160
|
+
* configuration, in the same key space {@link masteringAssistantSuggestChain}
|
|
161
|
+
* returns. Passing this straight through as `overrides` to {@link masterAudio}
|
|
162
|
+
* reproduces the preset unchanged, bit for bit in the C++ core.
|
|
163
|
+
*
|
|
164
|
+
* @param preset - Preset identifier from {@link masteringPresetNames}.
|
|
165
|
+
* @throws For an unknown `preset`.
|
|
166
|
+
*/
|
|
167
|
+
export declare function masteringPresetParams(preset: MasteringPreset): Record<string, number | boolean>;
|
|
168
|
+
/**
|
|
169
|
+
* List the delivery targets the mastering assistant accepts as `targetPlatform`.
|
|
170
|
+
*
|
|
171
|
+
* Read from the library rather than from a list kept here, so a target added in
|
|
172
|
+
* the core is discoverable without a binding change.
|
|
173
|
+
*
|
|
174
|
+
* @returns Target names in index order (e.g. "streaming", "broadcast", "club")
|
|
175
|
+
*/
|
|
176
|
+
export declare function masteringPlatformNames(): string[];
|
|
177
|
+
/**
|
|
178
|
+
* Apply a named mastering preset chain to mono audio.
|
|
179
|
+
*
|
|
180
|
+
* @param samples - Audio samples (mono, float32)
|
|
181
|
+
* @param sampleRate - Sample rate in Hz (default: 22050)
|
|
182
|
+
* @param presetName - Preset identifier from {@link masteringPresetNames}
|
|
183
|
+
* @param overrides - Optional nested {@link MasteringChainConfig} applied on top of the preset (e.g. `{ loudness: { targetLufs: -14 } }`). Pass `null` for preset defaults.
|
|
184
|
+
* @param onProgress - Optional per-stage progress callback (progress: 0-1, stage: string).
|
|
185
|
+
* @returns Processed audio, loudness metadata, and applied stage names
|
|
186
|
+
*/
|
|
187
|
+
export declare function masterAudio(request: MasterAudioRequest): MasteringChainResult;
|
|
188
|
+
export declare function masterAudio(samples: Float32Array, sampleRate?: number, presetName?: MasteringPreset, overrides?: MasteringChainConfig, onProgress?: ProgressCallback): MasteringChainResult;
|
|
189
|
+
/**
|
|
190
|
+
* Apply a named mastering preset chain to stereo audio.
|
|
191
|
+
*
|
|
192
|
+
* @param left - Left channel samples
|
|
193
|
+
* @param right - Right channel samples
|
|
194
|
+
* @param sampleRate - Sample rate in Hz
|
|
195
|
+
* @param presetName - Preset identifier from {@link masteringPresetNames}
|
|
196
|
+
* @param overrides - Optional nested {@link MasteringChainConfig} applied on top of the preset (e.g. `{ loudness: { targetLufs: -14 } }`). Pass `null` for preset defaults.
|
|
197
|
+
* @param onProgress - Optional per-stage progress callback (progress: 0-1, stage: string).
|
|
198
|
+
* @returns Processed stereo audio, loudness metadata, and applied stage names
|
|
199
|
+
*/
|
|
200
|
+
export declare function masterAudioStereo(request: MasterAudioStereoRequest): MasteringChainStereoResult;
|
|
201
|
+
export declare function masterAudioStereo(left: Float32Array, right: Float32Array, sampleRate?: number, presetName?: MasteringPreset, overrides?: MasteringChainConfig, onProgress?: ProgressCallback): MasteringChainStereoResult;
|
|
202
|
+
/**
|
|
203
|
+
* Mono `masterAudio` with per-stage progress reporting. `onProgress` is invoked
|
|
204
|
+
* with `(progress, stage)` between each chain stage (progress is in [0,1]).
|
|
205
|
+
*/
|
|
206
|
+
export declare function masterAudioWithProgress(request: MasterAudioRequest & Required<Pick<MasterAudioRequest, 'onProgress'>>): MasteringChainResult;
|
|
207
|
+
export declare function masterAudioWithProgress(samples: Float32Array, sampleRate?: number, presetName?: MasteringPreset, overrides?: MasteringChainConfig | null, onProgress?: ProgressCallback): MasteringChainResult;
|
|
208
|
+
/**
|
|
209
|
+
* Stereo `masterAudio` with per-stage progress reporting.
|
|
210
|
+
*/
|
|
211
|
+
export declare function masterAudioStereoWithProgress(request: MasterAudioStereoRequest & Required<Pick<MasterAudioStereoRequest, 'onProgress'>>): MasteringChainStereoResult;
|
|
212
|
+
export declare function masterAudioStereoWithProgress(left: Float32Array, right: Float32Array, sampleRate?: number, presetName?: MasteringPreset, overrides?: MasteringChainConfig | null, onProgress?: ProgressCallback): MasteringChainStereoResult;
|
|
213
|
+
//# sourceMappingURL=mastering_chain.d.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BAAgB,6BAA6B,CAC3C,OAAO,EAAE,wBAAwB,GAAG,QAAQ,CAAC,IAAI,CAAC,wBAAwB,EAAE,YAAY,CAAC,CAAC,GACzF,0BAA0B,CAAC;AAC9B,wBAAgB,6BAA6B,CAC3C,IAAI,EAAE,YAAY,EAClB,KAAK,EAAE,YAAY,EACnB,UAAU,CAAC,EAAE,MAAM,EACnB,UAAU,CAAC,EAAE,eAAe,EAC5B,SAAS,CAAC,EAAE,oBAAoB,GAAG,IAAI,EACvC,UAAU,CAAC,EAAE,gBAAgB,GAC5B,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,457 @@
|
|
|
1
|
+
import type { LoudnessMatchResult, MasteringAssistantParams, MasteringInsertParamChoice, MasteringInsertSlot, MasteringOptions, MasteringProcessorParams, MasteringResult, MasteringStereoResult, PairAnalysis, PairProcessor, SoloProcessor, StereoAnalysis, StreamingPlatform } from './public_types';
|
|
2
|
+
export type { MasteringInsertParamChoice, MasteringInsertSlot };
|
|
3
|
+
/** Canonical request form for loudness/true-peak mastering. */
|
|
4
|
+
export interface MasteringRequest extends MasteringOptions {
|
|
5
|
+
samples: Float32Array;
|
|
6
|
+
sampleRate?: number;
|
|
7
|
+
}
|
|
8
|
+
export interface MasteringProcessRequest {
|
|
9
|
+
processorName: SoloProcessor;
|
|
10
|
+
samples: Float32Array;
|
|
11
|
+
sampleRate?: number;
|
|
12
|
+
params?: MasteringProcessorParams;
|
|
13
|
+
}
|
|
14
|
+
export interface MasteringProcessStereoRequest {
|
|
15
|
+
processorName: SoloProcessor;
|
|
16
|
+
left: Float32Array;
|
|
17
|
+
right: Float32Array;
|
|
18
|
+
sampleRate?: number;
|
|
19
|
+
params?: MasteringProcessorParams;
|
|
20
|
+
}
|
|
21
|
+
/** Canonical request form for a two-input match processor. */
|
|
22
|
+
export interface MasteringPairProcessRequest {
|
|
23
|
+
processorName: PairProcessor;
|
|
24
|
+
source: Float32Array;
|
|
25
|
+
reference: Float32Array;
|
|
26
|
+
sampleRate?: number;
|
|
27
|
+
params?: MasteringProcessorParams;
|
|
28
|
+
}
|
|
29
|
+
/** Canonical request form for {@link masteringAbMatchLoudness}. */
|
|
30
|
+
export interface MasteringAbMatchLoudnessRequest {
|
|
31
|
+
/** The take to gain-match. */
|
|
32
|
+
source: Float32Array;
|
|
33
|
+
/** The take whose loudness `source` is matched to; returned untouched. */
|
|
34
|
+
reference: Float32Array;
|
|
35
|
+
sampleRate?: number;
|
|
36
|
+
}
|
|
37
|
+
/** Canonical request form for a two-input match analysis. */
|
|
38
|
+
export interface MasteringPairAnalyzeRequest {
|
|
39
|
+
analysisName: PairAnalysis;
|
|
40
|
+
source: Float32Array;
|
|
41
|
+
reference: Float32Array;
|
|
42
|
+
sampleRate?: number;
|
|
43
|
+
params?: MasteringProcessorParams;
|
|
44
|
+
}
|
|
45
|
+
/** Canonical request form for a stereo analysis. */
|
|
46
|
+
export interface MasteringStereoAnalyzeRequest {
|
|
47
|
+
analysisName: StereoAnalysis;
|
|
48
|
+
left: Float32Array;
|
|
49
|
+
right: Float32Array;
|
|
50
|
+
sampleRate?: number;
|
|
51
|
+
params?: MasteringProcessorParams;
|
|
52
|
+
}
|
|
53
|
+
/** Canonical request form for assistant/profile calls. */
|
|
54
|
+
export interface MasteringSamplesParamsRequest {
|
|
55
|
+
samples: Float32Array;
|
|
56
|
+
sampleRate?: number;
|
|
57
|
+
params?: MasteringProcessorParams;
|
|
58
|
+
}
|
|
59
|
+
/** Canonical request form for the assistant, whose params carry a target platform. */
|
|
60
|
+
export interface MasteringAssistantParamsRequest {
|
|
61
|
+
samples: Float32Array;
|
|
62
|
+
sampleRate?: number;
|
|
63
|
+
params?: MasteringAssistantParams;
|
|
64
|
+
}
|
|
65
|
+
/** Canonical request form for streaming-platform preview. */
|
|
66
|
+
export interface MasteringStreamingPreviewRequest {
|
|
67
|
+
samples: Float32Array;
|
|
68
|
+
sampleRate?: number;
|
|
69
|
+
platforms?: StreamingPlatform[];
|
|
70
|
+
}
|
|
71
|
+
/** Canonical request form for the stereo analysis entry points. */
|
|
72
|
+
export interface MasteringStereoParamsRequest {
|
|
73
|
+
left: Float32Array;
|
|
74
|
+
right: Float32Array;
|
|
75
|
+
sampleRate?: number;
|
|
76
|
+
params?: MasteringProcessorParams;
|
|
77
|
+
}
|
|
78
|
+
/** Stereo counterpart of {@link MasteringAssistantParamsRequest}. */
|
|
79
|
+
export interface MasteringAssistantStereoParamsRequest {
|
|
80
|
+
left: Float32Array;
|
|
81
|
+
right: Float32Array;
|
|
82
|
+
sampleRate?: number;
|
|
83
|
+
params?: MasteringAssistantParams;
|
|
84
|
+
}
|
|
85
|
+
/** Canonical request form for the stereo streaming-platform preview. */
|
|
86
|
+
export interface MasteringStreamingPreviewStereoRequest {
|
|
87
|
+
left: Float32Array;
|
|
88
|
+
right: Float32Array;
|
|
89
|
+
sampleRate?: number;
|
|
90
|
+
platforms?: StreamingPlatform[];
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Apply mastering loudness normalization with a true-peak ceiling.
|
|
94
|
+
*
|
|
95
|
+
* @param samples - Audio samples (mono, float32)
|
|
96
|
+
* @param sampleRate - Sample rate in Hz (default: 22050)
|
|
97
|
+
* @param options - Loudness/ceiling settings ({@link MasteringOptions})
|
|
98
|
+
* @returns Processed audio and loudness metadata
|
|
99
|
+
*/
|
|
100
|
+
export declare function mastering(request: MasteringRequest): MasteringResult;
|
|
101
|
+
export declare function mastering(samples: Float32Array, sampleRate?: number, options?: MasteringOptions): MasteringResult;
|
|
102
|
+
export declare function masteringProcessorNames(): SoloProcessor[];
|
|
103
|
+
/**
|
|
104
|
+
* Names of the insert processors the mastering chain can instantiate by name
|
|
105
|
+
* (`mastering::api::insert_factory_names`). Mirrors the C-ABI
|
|
106
|
+
* `sonare_mastering_insert_names` (which joins this list) as a `string[]`.
|
|
107
|
+
*/
|
|
108
|
+
export declare function masteringInsertNames(): string[];
|
|
109
|
+
/**
|
|
110
|
+
* Returns the camelCase parameter names a given insert / FX processor reads, for
|
|
111
|
+
* tooling/validation. Any key NOT in this list is silently ignored by the
|
|
112
|
+
* processor (and would be reported via {@link Mixer.sceneWarnings} when a scene
|
|
113
|
+
* carrying it is loaded). Band/sub-band processors enumerate their indexed
|
|
114
|
+
* `band{i}.<field>` keys. Returns an empty array for an unknown name (or one
|
|
115
|
+
* whose insert needs an unavailable build feature, e.g. FX).
|
|
116
|
+
*
|
|
117
|
+
* @param name - Insert processor name (see {@link masteringInsertNames}).
|
|
118
|
+
*/
|
|
119
|
+
export declare function masteringInsertParamNames(name: string): string[];
|
|
120
|
+
/**
|
|
121
|
+
* One parameter an insert processor's construction reads, whether or not it
|
|
122
|
+
* is realtime-automatable.
|
|
123
|
+
*/
|
|
124
|
+
export interface MasteringInsertParamInfo {
|
|
125
|
+
/** JSON-key parameter name, as used in scene insert params. */
|
|
126
|
+
name: string;
|
|
127
|
+
/**
|
|
128
|
+
* Integer param id for realtime automation lanes / MIDI-CC binding, or null
|
|
129
|
+
* for a construction-only key with no automation target.
|
|
130
|
+
*/
|
|
131
|
+
id: number | null;
|
|
132
|
+
/** Whether the param can be changed live from the audio thread; false when `id` is null. */
|
|
133
|
+
rtSafe: boolean;
|
|
134
|
+
/**
|
|
135
|
+
* The C++ type the processor's config builder reads the key as. `"enum"` is
|
|
136
|
+
* sent as the number in its `choices` entry; `"string"` / `"array"` (an
|
|
137
|
+
* embedded impulse response, a per-band list) is construction-only and
|
|
138
|
+
* reports null for `min`, `max`, `default` and `choices`.
|
|
139
|
+
*/
|
|
140
|
+
type: 'boolean' | 'number' | 'enum' | 'string' | 'array';
|
|
141
|
+
/**
|
|
142
|
+
* Smallest value construction accepts, or null when the catalog states no
|
|
143
|
+
* limit or `choices` is non-null. Measured, so it is a hard constraint
|
|
144
|
+
* rather than a UI range; see {@link CapabilityCatalogParameter} for what a
|
|
145
|
+
* measured bound does and does not promise.
|
|
146
|
+
*/
|
|
147
|
+
min: number | null;
|
|
148
|
+
/** Largest value construction accepts, or null when the catalog states no limit or `choices` is non-null. */
|
|
149
|
+
max: number | null;
|
|
150
|
+
/**
|
|
151
|
+
* Value the processor uses when the key is absent — the config struct's own
|
|
152
|
+
* field initializer, an enum as its number. Null for a param id with no
|
|
153
|
+
* construction key, a `"string"` / `"array"` key, or a construction key with
|
|
154
|
+
* no fallback.
|
|
155
|
+
*/
|
|
156
|
+
default: boolean | number | null;
|
|
157
|
+
/** Physical unit, or null when the parameter is unitless. */
|
|
158
|
+
unit: string | null;
|
|
159
|
+
/**
|
|
160
|
+
* The closed set of values construction accepts, in value order, or null
|
|
161
|
+
* when the accepted values are not a closed set. Non-null only for `"enum"`
|
|
162
|
+
* (every declared enumerator construction accepts) or a `"number"` key
|
|
163
|
+
* whose accepted integers have holes; `min` / `max` are then both null.
|
|
164
|
+
*/
|
|
165
|
+
choices: MasteringInsertParamChoice[] | null;
|
|
166
|
+
/**
|
|
167
|
+
* The {@link MasteringInsertSlot} this key belongs to, or null for a key that
|
|
168
|
+
* always exists.
|
|
169
|
+
*/
|
|
170
|
+
slot: string | null;
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Returns every parameter an insert / FX processor's construction reads,
|
|
174
|
+
* including construction-time-only keys with no realtime automation target.
|
|
175
|
+
* Entries come in two runs: first the processor's realtime automation
|
|
176
|
+
* targets in id order (the keys accepted by
|
|
177
|
+
* {@link RealtimeEngine.setTrackStripInsertParamByName}, `id` non-null); then,
|
|
178
|
+
* sorted by name, every other construction key with `id` null and `rtSafe`
|
|
179
|
+
* false. The name set matches {@link masteringInsertParamNames} plus any
|
|
180
|
+
* automation target construction does not read. Returns an empty array for an
|
|
181
|
+
* unknown name.
|
|
182
|
+
*
|
|
183
|
+
* @param name - Insert processor name (see {@link masteringInsertNames}).
|
|
184
|
+
*/
|
|
185
|
+
export declare function masteringInsertParamInfo(name: string): MasteringInsertParamInfo[];
|
|
186
|
+
/** Latency and tail of one insert instance, in samples. */
|
|
187
|
+
export interface MasteringInsertTiming {
|
|
188
|
+
/** Latency in samples at the queried sample rate. */
|
|
189
|
+
latencySamples: number;
|
|
190
|
+
/** Audible decay tail in samples at the queried sample rate. */
|
|
191
|
+
tailSamples: number;
|
|
192
|
+
}
|
|
193
|
+
/** One built-in amp-sim rig with its resolved starting configuration. */
|
|
194
|
+
export interface MasteringAmpPresetCatalogEntry {
|
|
195
|
+
/** Stable index used by the amp-sim `presetIndex` parameter. */
|
|
196
|
+
index: number;
|
|
197
|
+
/** Canonical preset identifier accepted by the amp-sim insert. */
|
|
198
|
+
name: string;
|
|
199
|
+
/** Effective values from the core preset, before sparse user overrides. */
|
|
200
|
+
params: Record<string, number | boolean>;
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Returns the built-in amp-sim rigs and their resolved control values.
|
|
204
|
+
*
|
|
205
|
+
* The catalog is read-only metadata for hosts such as Studio. Persist only the
|
|
206
|
+
* preset index and explicit overrides in a project so future core updates can
|
|
207
|
+
* continue to define the canonical DSP configuration.
|
|
208
|
+
*/
|
|
209
|
+
export declare function masteringAmpPresetCatalog(): MasteringAmpPresetCatalogEntry[];
|
|
210
|
+
/**
|
|
211
|
+
* Latency and tail of insert `name` built from `params` and prepared at
|
|
212
|
+
* `sampleRate` (`mastering::api::insert_timing`). Answers for the exact
|
|
213
|
+
* instance a scene or strip would build — an oversampled saturation path, a
|
|
214
|
+
* linear-phase crossover, a lookahead all change the reported latency. The
|
|
215
|
+
* capability catalog's `latencySamples` / `tailSamples` are this query at
|
|
216
|
+
* default parameters and 48 kHz. `effects.reverb.convolution` answers for its
|
|
217
|
+
* configuration without an impulse response: its latency is its fixed
|
|
218
|
+
* partition size and does not depend on one.
|
|
219
|
+
*
|
|
220
|
+
* A key `name`'s construction does not read is refused rather than ignored,
|
|
221
|
+
* because an ignored key would answer for a configuration the caller did not
|
|
222
|
+
* ask for.
|
|
223
|
+
*
|
|
224
|
+
* @param name - Insert processor name (see {@link masteringInsertNames}).
|
|
225
|
+
* @param params - Flat parameter values, keyed as in {@link masteringInsertParamInfo}.
|
|
226
|
+
* @param sampleRate - Rate the insert is prepared at.
|
|
227
|
+
* @throws For an unknown `name`, a key the insert does not read, a value its
|
|
228
|
+
* construction or `prepare` refuses, or a `params` value that is not a
|
|
229
|
+
* finite number or boolean.
|
|
230
|
+
*/
|
|
231
|
+
export declare function masteringInsertTiming(name: string, params: Record<string, number | boolean>, sampleRate: number): MasteringInsertTiming;
|
|
232
|
+
/**
|
|
233
|
+
* How a processor handles a buffer with more than two channels (a surround
|
|
234
|
+
* bed). "multichannel" processes every plane in one call; "stereoPairOnly"
|
|
235
|
+
* operates on the front L/R pair and passes any surround planes through dry.
|
|
236
|
+
* "perChannel"/"passthrough" are reserved and unused by the current catalog.
|
|
237
|
+
*/
|
|
238
|
+
export type MasteringChannelPolicy = 'multichannel' | 'stereoPairOnly' | 'perChannel' | 'passthrough';
|
|
239
|
+
/** Coarse algorithmic work estimate for a realtime insert; not a benchmark. */
|
|
240
|
+
export type MasteringRealtimeCost = 'low' | 'moderate' | 'high';
|
|
241
|
+
/**
|
|
242
|
+
* Catalog grouping for a processor picker, derived from the id's prefix
|
|
243
|
+
* ("eq.*" -> "eq", "match.*" -> "reference"); anything unprefixed is "other".
|
|
244
|
+
*/
|
|
245
|
+
export type MasteringProcessorCategory = 'dynamics' | 'effects' | 'eq' | 'final' | 'maximizer' | 'multiband' | 'other' | 'reference' | 'repair' | 'saturation' | 'spectral' | 'stereo' | 'utility';
|
|
246
|
+
/** One processor's realtime/offline/pair classification in the catalog. */
|
|
247
|
+
export interface MasteringProcessorCatalogEntry {
|
|
248
|
+
/** Processor id (the name used for scene inserts / named processors). */
|
|
249
|
+
id: string;
|
|
250
|
+
/**
|
|
251
|
+
* Primary classification, by precedence pair > realtime > offline: "pair" for
|
|
252
|
+
* two-input match.* processors, "realtime" for ids that build as a realtime
|
|
253
|
+
* scene insert, "offline" for whole-file-only processors.
|
|
254
|
+
*/
|
|
255
|
+
kind: 'realtime' | 'offline' | 'pair';
|
|
256
|
+
/** True exactly for ids that always succeed as a realtime scene insert. */
|
|
257
|
+
realtimeInsertable: boolean;
|
|
258
|
+
/** True for processors with no mono implementation (stereo-only). */
|
|
259
|
+
stereoOnly: boolean;
|
|
260
|
+
/**
|
|
261
|
+
* Reported latency for the default 48 kHz / 512-sample probe configuration.
|
|
262
|
+
* Zero for offline processors; configuration-dependent values are estimates.
|
|
263
|
+
*/
|
|
264
|
+
latencySamples: number;
|
|
265
|
+
/**
|
|
266
|
+
* Audible decay length for the same default prepared probe. Zero for
|
|
267
|
+
* offline, dry-only, and no-tail processors.
|
|
268
|
+
*/
|
|
269
|
+
tailSamples: number;
|
|
270
|
+
/** Coarse realtime work estimate, or null when the processor is not an insert. */
|
|
271
|
+
realtimeCost: MasteringRealtimeCost | null;
|
|
272
|
+
/**
|
|
273
|
+
* How the mixer wraps the processor on a >2-channel (surround) bus insert:
|
|
274
|
+
* "multichannel" (one full-buffer call) or "stereoPairOnly" (front L/R pair,
|
|
275
|
+
* surround planes passed through dry).
|
|
276
|
+
*/
|
|
277
|
+
channelPolicy: MasteringChannelPolicy;
|
|
278
|
+
/** Grouping for a processor picker; see {@link MasteringProcessorCategory}. */
|
|
279
|
+
category: MasteringProcessorCategory;
|
|
280
|
+
/**
|
|
281
|
+
* The processor's construction parameters, the same list
|
|
282
|
+
* {@link masteringInsertParamInfo} returns. Empty for entries that are not
|
|
283
|
+
* realtime-insertable.
|
|
284
|
+
*/
|
|
285
|
+
params: MasteringInsertParamInfo[];
|
|
286
|
+
/**
|
|
287
|
+
* The insert's conditional key groups in declaration order, named by each
|
|
288
|
+
* parameter's `slot`. Empty for entries that are not realtime-insertable.
|
|
289
|
+
*/
|
|
290
|
+
slots: MasteringInsertSlot[];
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* Returns the machine-readable classification catalog for every named processor
|
|
294
|
+
* id, merging the offline registry, the realtime insert factory, and the pair
|
|
295
|
+
* registry. Lets a host filter a processor picker by realtime insertability
|
|
296
|
+
* instead of offering ids the realtime strip would reject.
|
|
297
|
+
*/
|
|
298
|
+
export declare function masteringProcessorCatalog(): MasteringProcessorCatalogEntry[];
|
|
299
|
+
export declare function masteringPairProcessorNames(): PairProcessor[];
|
|
300
|
+
export declare function masteringPairAnalysisNames(): PairAnalysis[];
|
|
301
|
+
export declare function masteringStereoAnalysisNames(): StereoAnalysis[];
|
|
302
|
+
export declare function masteringProcess(request: MasteringProcessRequest): MasteringResult;
|
|
303
|
+
export declare function masteringProcess(processorName: SoloProcessor, samples: Float32Array, sampleRate?: number, params?: MasteringProcessorParams): MasteringResult;
|
|
304
|
+
export declare function masteringProcessStereo(request: MasteringProcessStereoRequest): MasteringStereoResult;
|
|
305
|
+
export declare function masteringProcessStereo(processorName: SoloProcessor, left: Float32Array, right: Float32Array, sampleRate?: number, params?: MasteringProcessorParams): MasteringStereoResult;
|
|
306
|
+
/**
|
|
307
|
+
* Apply a two-input `match.*` processor. `source` and `reference` may have
|
|
308
|
+
* independent lengths — the match primitives consume each buffer at its own
|
|
309
|
+
* length.
|
|
310
|
+
*/
|
|
311
|
+
export declare function masteringPairProcess(request: MasteringPairProcessRequest): MasteringResult;
|
|
312
|
+
export declare function masteringPairProcess(processorName: PairProcessor, source: Float32Array, reference: Float32Array, sampleRate?: number, params?: MasteringProcessorParams): MasteringResult;
|
|
313
|
+
/**
|
|
314
|
+
* Analyze a `source` against a `reference` with a two-input analysis. The two
|
|
315
|
+
* buffers may have independent lengths.
|
|
316
|
+
*/
|
|
317
|
+
export declare function masteringPairAnalyze(request: MasteringPairAnalyzeRequest): string;
|
|
318
|
+
export declare function masteringPairAnalyze(analysisName: PairAnalysis, source: Float32Array, reference: Float32Array, sampleRate?: number, params?: MasteringProcessorParams): string;
|
|
319
|
+
/**
|
|
320
|
+
* Gain-match `source` to `reference`'s integrated loudness, so an A/B between
|
|
321
|
+
* the two is not decided by level. `source` and `reference` may have
|
|
322
|
+
* independent lengths.
|
|
323
|
+
*
|
|
324
|
+
* The gain is applied with no upper bound and `matchedTruePeakDbtp` reports
|
|
325
|
+
* where that left the peak, rather than the call capping it: a headroom clamp
|
|
326
|
+
* would return `source` at its own loudness whenever it started near full
|
|
327
|
+
* scale. Both loudness values are non-finite for a silent or below-gate take,
|
|
328
|
+
* and `appliedGainDb` is then 0.
|
|
329
|
+
*
|
|
330
|
+
* @example
|
|
331
|
+
* ```ts
|
|
332
|
+
* const { samples, appliedGainDb, matchedTruePeakDbtp } = masteringAbMatchLoudness({
|
|
333
|
+
* source: take,
|
|
334
|
+
* reference: master,
|
|
335
|
+
* sampleRate: 48000,
|
|
336
|
+
* });
|
|
337
|
+
* ```
|
|
338
|
+
*/
|
|
339
|
+
export declare function masteringAbMatchLoudness(request: MasteringAbMatchLoudnessRequest): LoudnessMatchResult;
|
|
340
|
+
export declare function masteringStereoAnalyze(request: MasteringStereoAnalyzeRequest): string;
|
|
341
|
+
export declare function masteringStereoAnalyze(analysisName: StereoAnalysis, left: Float32Array, right: Float32Array, sampleRate?: number, params?: MasteringProcessorParams): string;
|
|
342
|
+
export declare function masteringAssistantSuggest(request: MasteringAssistantParamsRequest): string;
|
|
343
|
+
export declare function masteringAssistantSuggest(samples: Float32Array, sampleRate?: number, params?: MasteringAssistantParams): string;
|
|
344
|
+
/**
|
|
345
|
+
* Suggest a mastering chain, as the flat `{key: number|boolean}` params map
|
|
346
|
+
* {@link masteringAssistantSuggest}'s `chainConfig` carries, without needing to
|
|
347
|
+
* pull it out of the full assistant document. The returned map can be passed
|
|
348
|
+
* straight through as `overrides` to {@link mastering} / {@link masterAudio}.
|
|
349
|
+
*/
|
|
350
|
+
export declare function masteringAssistantSuggestChain(request: MasteringAssistantParamsRequest): Record<string, number | boolean>;
|
|
351
|
+
/**
|
|
352
|
+
* The shape {@link masteringAudioProfile}'s JSON parses to.
|
|
353
|
+
*
|
|
354
|
+
* The profile crosses as a string, so nothing type-checks it on arrival; this
|
|
355
|
+
* declaration is what a conformance check compares against the paths the C++
|
|
356
|
+
* writer publishes, so a field added on one side and not the other fails there
|
|
357
|
+
* rather than reaching a caller as `undefined`.
|
|
358
|
+
*/
|
|
359
|
+
export interface MasteringAudioProfile {
|
|
360
|
+
durationSec: number;
|
|
361
|
+
bpm: number;
|
|
362
|
+
bpmConfidence: number;
|
|
363
|
+
loudness: {
|
|
364
|
+
integratedLufs: number;
|
|
365
|
+
lraLu: number;
|
|
366
|
+
truePeakDb: number;
|
|
367
|
+
crestFactorDb: number;
|
|
368
|
+
};
|
|
369
|
+
spectral: {
|
|
370
|
+
subRmsDb: number;
|
|
371
|
+
lowRmsDb: number;
|
|
372
|
+
lowMidRmsDb: number;
|
|
373
|
+
midRmsDb: number;
|
|
374
|
+
highMidRmsDb: number;
|
|
375
|
+
highRmsDb: number;
|
|
376
|
+
airRmsDb: number;
|
|
377
|
+
centroidHz: number;
|
|
378
|
+
flatness: number;
|
|
379
|
+
rolloffHz: number;
|
|
380
|
+
};
|
|
381
|
+
dynamics: {
|
|
382
|
+
shortTermLufsStd: number;
|
|
383
|
+
attackDensity: number;
|
|
384
|
+
sustainRatio: number;
|
|
385
|
+
};
|
|
386
|
+
/**
|
|
387
|
+
* What the repair detectors measured. `measured` is false when nothing ran —
|
|
388
|
+
* either `detectDefects` was not asked for or the input was too short — and
|
|
389
|
+
* every other field is then at its default rather than a reading.
|
|
390
|
+
*/
|
|
391
|
+
defects: {
|
|
392
|
+
measured: boolean;
|
|
393
|
+
clickCount: number;
|
|
394
|
+
clickRejected: number;
|
|
395
|
+
clickLongestRunSamples: number;
|
|
396
|
+
clickPerSecond: number;
|
|
397
|
+
crackleSampleCount: number;
|
|
398
|
+
crackleSampleFraction: number;
|
|
399
|
+
cracklePerSecond: number;
|
|
400
|
+
clipSampleCount: number;
|
|
401
|
+
clipRunCount: number;
|
|
402
|
+
clipLongestRunSamples: number;
|
|
403
|
+
clipSampleFraction: number;
|
|
404
|
+
clipFlatRunCount: number;
|
|
405
|
+
clipFlatSampleCount: number;
|
|
406
|
+
clipLongestFlatRunSamples: number;
|
|
407
|
+
clipFlatLevel: number;
|
|
408
|
+
noiseFloorDbfs: number;
|
|
409
|
+
noiseBandPeakDbfs: number;
|
|
410
|
+
noiseBandPeakIndex: number;
|
|
411
|
+
humFundamentalHz: number;
|
|
412
|
+
humFundamentalProminence: number;
|
|
413
|
+
humHarmonics: number;
|
|
414
|
+
humFundamentalDbfs: number;
|
|
415
|
+
humPeakHarmonicDbfs: number;
|
|
416
|
+
lateDecayRatioDb: number;
|
|
417
|
+
};
|
|
418
|
+
}
|
|
419
|
+
export declare function masteringAudioProfile(request: MasteringSamplesParamsRequest): string;
|
|
420
|
+
export declare function masteringAudioProfile(samples: Float32Array, sampleRate?: number, params?: MasteringProcessorParams): string;
|
|
421
|
+
export declare function masteringStreamingPreview(request: MasteringStreamingPreviewRequest): string;
|
|
422
|
+
export declare function masteringStreamingPreview(samples: Float32Array, sampleRate?: number, platforms?: StreamingPlatform[]): string;
|
|
423
|
+
/**
|
|
424
|
+
* Suggest a mastering chain for a stereo pair, as shared JSON.
|
|
425
|
+
*
|
|
426
|
+
* Profiles through {@link masteringAudioProfileStereo}, so the loudness stage
|
|
427
|
+
* of the suggestion is built on the channel-summed program rather than a
|
|
428
|
+
* downmix that reads roughly 6 dB low.
|
|
429
|
+
*/
|
|
430
|
+
export declare function masteringAssistantSuggestStereo(request: MasteringAssistantStereoParamsRequest): string;
|
|
431
|
+
/**
|
|
432
|
+
* Stereo counterpart of {@link masteringAssistantSuggestChain}: the flat
|
|
433
|
+
* `{key: number|boolean}` params map without the surrounding assistant
|
|
434
|
+
* document, ready to pass through as `overrides` to {@link masterAudioStereo}.
|
|
435
|
+
*/
|
|
436
|
+
export declare function masteringAssistantSuggestChainStereo(request: MasteringAssistantStereoParamsRequest): Record<string, number | boolean>;
|
|
437
|
+
/**
|
|
438
|
+
* Mastering assistant profile of a stereo pair, as shared JSON.
|
|
439
|
+
*
|
|
440
|
+
* Only the `loudness` block is measured from the two channels: integrated LUFS
|
|
441
|
+
* and LRA come from the channel-summed program and the true peak is the larger
|
|
442
|
+
* of the two. The spectral, dynamics and tempo fields describe shape and timing
|
|
443
|
+
* rather than absolute level and are measured on the downmix, which keeps them
|
|
444
|
+
* comparable with {@link masteringAudioProfile}.
|
|
445
|
+
*/
|
|
446
|
+
export declare function masteringAudioProfileStereo(request: MasteringStereoParamsRequest): string;
|
|
447
|
+
/**
|
|
448
|
+
* Preview streaming-platform normalization for a stereo pair, as shared JSON.
|
|
449
|
+
*
|
|
450
|
+
* Measures the integrated loudness with BS.1770 channel summing and reports the
|
|
451
|
+
* larger of the two channel true peaks. Passing a `0.5 * (left + right)` downmix
|
|
452
|
+
* to {@link masteringStreamingPreview} instead reads roughly 6 dB low on
|
|
453
|
+
* decorrelated material, and both the normalization gain and the ceiling-risk
|
|
454
|
+
* flag follow from that measurement.
|
|
455
|
+
*/
|
|
456
|
+
export declare function masteringStreamingPreviewStereo(request: MasteringStreamingPreviewStereoRequest): string;
|
|
457
|
+
//# sourceMappingURL=mastering_core.d.ts.map
|