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!
Best wishes, Neil