This is a demonstration of using ASIO audio drivers with B4j. If you don't know what ASIO drivers are then you may not need this. But ASIO drivers provide low latency audio input and output.
There is a wrapper for the jasiohost project at github which manages most of it's methods and there is inline java in the ASIOSimpleMixer class in the demo app that is required and manages the callbacks with the ASIO buffers to process. This seemed to be the most stable setup after much testing, I did write a java library while testing it but I think it is better inline for this project.
For the WavRandomAccessFile implementation in this example, I have removed dependence on JavaxSound, so it should work on B4a and maybe B4i as well. There is a a b4xlib for it B4xWavRandomAccessFile-b4xlib, which is not required for the demo app.
To run the demo app, you will need a soundcard with ASIO drivers. Alternatively you could download ASIO4ALL which provides ASIO drivers for most soundcards even ones built in to the computers motherboard.
Try it out
There are two folders with tracks available on my google drive for you to try it out. one with 3 Tracks (my creation) and one with 15 which was downloaded from Then Mixing Secrets and converted with the FFMpegconvert utility (available in the jAudioTrack2-Mixer Full post) . Download either or both, unzip them. Run the app and open the folder. These folders are too large to include within the app so unfortunately you will have to download them separately.
Dependencies
The demo app requires jASIOHost-b4xlib.
jAsioHost.jar and jasiohost64.dll (or the 32 bit version if you really want to) from the jasiohost git hub page. I copied the dll file to my Windows32 folder and it found it. I think you can also put it in the projects working directory (not the code directory).
You will also need the java code from the ASIOSimpleMixer class in the demo if you want to use it in your own projects.
Note: I have moved the library file to the library thread where it should have been in the first place. Download it from there.
I hope you enjoy it. Let me know how you get on.
There is a wrapper for the jasiohost project at github which manages most of it's methods and there is inline java in the ASIOSimpleMixer class in the demo app that is required and manages the callbacks with the ASIO buffers to process. This seemed to be the most stable setup after much testing, I did write a java library while testing it but I think it is better inline for this project.
For the WavRandomAccessFile implementation in this example, I have removed dependence on JavaxSound, so it should work on B4a and maybe B4i as well. There is a a b4xlib for it B4xWavRandomAccessFile-b4xlib, which is not required for the demo app.
To run the demo app, you will need a soundcard with ASIO drivers. Alternatively you could download ASIO4ALL which provides ASIO drivers for most soundcards even ones built in to the computers motherboard.
Try it out
There are two folders with tracks available on my google drive for you to try it out. one with 3 Tracks (my creation) and one with 15 which was downloaded from Then Mixing Secrets and converted with the FFMpegconvert utility (available in the jAudioTrack2-Mixer Full post) . Download either or both, unzip them. Run the app and open the folder. These folders are too large to include within the app so unfortunately you will have to download them separately.
Dependencies
The demo app requires jASIOHost-b4xlib.
jAsioHost.jar and jasiohost64.dll (or the 32 bit version if you really want to) from the jasiohost git hub page. I copied the dll file to my Windows32 folder and it found it. I think you can also put it in the projects working directory (not the code directory).
You will also need the java code from the ASIOSimpleMixer class in the demo if you want to use it in your own projects.
Note: I have moved the library file to the library thread where it should have been in the first place. Download it from there.
I hope you enjoy it. Let me know how you get on.
Attachments
Last edited: