filter-graph: support inline convolver IRs

Refactor the IR loading code, Make some generic open/load/close
functions and handle the different filenames in the open call.

This makes it possible to reuse some of the delay and alloc code.

It also makes it easier to add new IRs loading code.

Support /IR:<rate>,<value1>,<value2>,... as an inline IR definition.
This commit is contained in:
Wim Taymans 2024-03-15 12:14:37 +01:00
parent f322a8b159
commit fb20b96024
2 changed files with 147 additions and 111 deletions

View file

@ -405,7 +405,7 @@ extern struct spa_handle_factory spa_filter_graph_factory;
* - `/dirac` creates a [Dirac function](https://en.wikipedia.org/wiki/Dirac_delta_function) that
* can be used as gain.
* - A filename to load as the IR. This needs to be a file format supported
* by sndfile.
* by sndfile or be an inline IR with "/ir:<rate>,<value1>,<value2>".
* - [ filename, ... ] an array of filenames. The file with the closest samplerate match
* with the graph samplerate will be used.
* - `offset` The sample offset in the file as the start of the IR.