Function: defineEqualizerPreset()
function defineEqualizerPreset(
id: string,
name: string,
gainsDb: readonly number[]
): EqualizerPreset;
Defined in: packages/player/src/equalizer-presets.ts:209
Build a custom preset from your own band gains.
Use this for a user-designed curve (an in-app slider bank, or something restored from storage): it validates the shape up front, so a corrupt saved profile fails at load with a clear message instead of at playback with mpv's.
Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Stable identifier. Anything you like; it never reaches mpv. |
name | string | Human label. |
gainsDb | readonly number[] | Exactly EQUALIZER_BAND_COUNT gains in dB, low band first. Each must be finite and within ±900 dB (ffmpeg's biquad range); in practice keep them inside ±12. |
Returns
Throws
PlayerErrorException with code invalid-state.
Example
const mine = defineEqualizerPreset('mine', 'My Curve', sliderValues)
player.setAudioFilters(equalizerPresetChain(mine))