JAudioLibs

Hi,

I’ve finally got around to releasing some of the audio libraries from Praxis as separate releases. The first two of these are up here - http://code.google.com/p/java-audio-utils/ (or jaudiolibs.org - points to the same place!)

First of these may be of less interest round here, JNAJack is a binding to JACK Audio Connection Kit http://jackaudio.org/. Second is the AudioServers API, with low-latency audio servers based on JNAJack and (possibly more useful around here) JavaSound. The JACK stuff is LGPL, and the JavaSound server is GPL2 w/CPE (mainly because it uses the float conversion tools from Gervill).

The low-latency JavaSound approach is achieved by using a non-blocking write to audio lines. The methodology is cribbed from various blog posts and mailing list comments by people over the years - I’m not assuming much credit for the approach! :slight_smile: I’ve not tested on Windows myself, but on Linux and Mac I’ve had sub-256 sample buffers working.

This code doesn’t do either DSP or software mixing, it offers a basic callback API for processing floatbuffers, and that’s your lot! For the rest you’ll have to wait for me to get the AudioOps and RAPL libraries also exported from Praxis which may take a little more time.

Best wishes, Neil

Hi

Could your source code be useful to implement a low latency software mixer for Paul Lamb Sound Library? Using such a mixer would allow me to work around some bugs (not all) and limitations of JavaSound without using JOAL and OpenALSoft.

Possibly. All the server does is provide you with floatbuffers to read from and write to. I don’t know much about that library, but I don’t think it uses float buffers internally - however software mixing is much easier with floating point so it’s worth converting first. You’d have to either implement your own mixing on top of the server library, or you could extract RAPL from Praxis (that library needs some tidying up and documenting before it’s properly ready for a separate release).

One thing that bothers me about Paul’s library from having a quick look at the source code is the various synchronized methods and multiple threads in the core. This could be a problem - check out the Performance section here (http://code.google.com/p/java-audio-utils/wiki/GettingStarted_AudioServers), and also the article it links to. Basic point - never block your audio thread.

Incidentally, I posted a link to the Praxis source code in Paul’s thread about a software mixer almost a year ago. This code hasn’t changed much since then - I’m just getting around to tidying up, documenting and releasing things from Praxis separately.

If you want to see if the audioservers library will provide you with better performance on your system before you start, you could download Praxis LIVE and its examples. Then -

  • Open example 3 - Audio in the projects tab.
  • Use the popup menu on the project to build the project.
  • Open the audio.pxr file from the project
  • Click on the background of the patcher to select the audio container. Its properties should show in the Properties tab to the right. Notice the buffersize parameter - will be set to 1024
  • Right click the popup menu on the project to run the project and you should hear some audio and get a GUI to manipulate it with.
  • If all is well, use the project menu to clear all, then build again and change the buffersize down (ideally in powers of 2). With the low latency kernel I’m using I can get this down to 64 samples, though higher values are probably more than adequate for you.

If for any reason the audio fails because it picks the wrong mixer (I know you’ve had some issues with this in the past), enter part of the name of the right mixer in the device property of the audio container (this uses String.contains() to find the first match). The next Praxis LIVE release will have a better GUI for selecting audio parameters! :slight_smile:

Best wishes, Neil