Skip to main content

Function: compileAudioFilters()

function compileAudioFilters(filters: readonly AudioFilter[]): string;

Defined in: packages/player/src/filters.ts:245

Compile a filter chain into the string mpv's af property takes.

The output format is mpv's own, reproduced from options/m_option.c: print_obj_settings_list: [@label:][!]name[=key=value[:key=value…]], entries joined with ,, keys and values escaped by escapeAfParam. Reading af back from mpv after setting it returns this string verbatim.

Parameters

ParameterTypeDescription
filtersreadonly AudioFilter[]The chain. An empty list compiles to '', which is how mpv spells "no filters".

Returns

string

The af property value.

Throws

PlayerErrorException with code invalid-state if the chain is malformed (see assertValidAudioFilters).