Within this blogpost, I’d like to write about QJackAudio, which is actually the result of a personal itch I scratched. I know that others had the same problem as we had, since there have been libraries developed such as QJack, which are abandonend now. But first things first, let me explain what JACK is and why you might need a library like QJackAudio.
JACK is a low-latency sound server that runs on top of the the operating system’s sound architecture. Actually, this is not a new idea, a lot of professional audio software manufacturers introduced such a system in order to make it possible to route audio signals in near-realtime. A practical use-case would be recording audio and being able to monitor your recording via software without a significant delay in your playing and the monitored signal. JACK has evolved to what one might call a standard in the professional GNU/Linux audio world. Practically all DAWs, effects processors and analysis software running on GNU/Linux support JACK.
Due to the fact that all software is able to communicate with the JACK audio server, you can connect any application to another using virtual cables, for example with qjackctl, which is a control application for the JACK server and allows you to draw connections (audio and MIDI) visually. If you launch an application and that application registers at the JACK server, qjackctl will display that unit and all its in- and outputs that you can drag on those of other JACK applications.
Applications that want to use JACK can use libjack, a C-library that you can link against (it’s LGPL). I you are aiming for clean code, you will most probably wrap that C code in C++/Qt classes – and that is where QJackAudio kicks in. I have done that once, and rewritten everything a second time to provide a wrapper in a library that you can make use of. As a plus, I have included a few common digital filters that are common in the audio world, such an EQ, an amplifier, compressor and the the list goes on (and there is more to come). Just create a new project and write your own effects, virtual guitar amps, mixers or anything you might think of, without worrying about hardcore DSP stuff.
In order to demonstrate its capabilities, I have written a demo application called mx2482 that is build on top of QJackAudio. The project is hosted on github, for more information see here: https://github.com/cybercatalyst/qjackaudio