Using sox low pass filter with jack

Posted on

Problem :

How do I run sox with jack so that sox takes the input from jack, does something (in my case, a low pass filter) and outputs the processed stream to jack.

sox foo.wav bar.wav lowp 1000.0 

Will take an input wav and output to another wav, however I need something like the following:

sox JACK_INPUT JACK_OUTPUT lowp 1000.0 

Where I can use jack to connect any sound source to the JACK_INPUT, and connect the JACK_OUTPUT that sox has applied a low pass filter to any other port in the processing chain in jack.

If this isn’t possible any help with alternative suggestions would be appreciated. Please note that the solution needs to be able to work with jack on linux, allow low pass/high pass filtering and preferably biquad filters like sox. Bonus points if connections can be uniquely named so that a script could launch a separate filter for each speaker.

Many thanks in advance.

Solution :

SoX doesn’t have a JACK driver. It wouldn’t be too difficult to write one, but due to the architecture of SoX, the latency would always be higher than strictly necessary.

If all you need is simple IIR filtering, just use a LADSPA host such as JACK Rack and suitable plugins, such as those by Matthias Nagorni or buttlow_iir/butthigh_iir etc. from Steve Harris’s collection.

Leave a Reply

Your email address will not be published. Required fields are marked *