-
Notifications
You must be signed in to change notification settings - Fork 25
Home
mhroth edited this page Sep 13, 2010
·
19 revisions
Welcome to the JAsioHost wiki!
The basic design pattern for using JAsioHost
is written below. static
methods in JAsioHost
are used to collect information about the available drivers. getAsioDriver
is called in order to load and instantiate a given driver. The AsioDriver
can then be queried for channel state information. Audio buffers are created using createBuffers
, before start
is called. Callbacks are made from the driver in order to submit input and retrieve output. Always remember to call JAsioHost.shutdownAndUnloadDriver()
before exiting the program. Your system may crash if you do not.
List<String> driverNameList = JAsioHost.getDriverNames();
AsioDriver asioDriver = JAsioHost.getAsioDriver(driverNameList.get(0));
asioDriver.openControlPanel(); // optional, and may not work for all drivers on all platforms
Set<AsioChannelInfo> activeChannels = new HashSet<AsioChannelInfo>();
activeChannels.add(asioDriver.getChannelInfoOutput(0));
activeChannels.add(asioDriver.getChannelInfoOutput(1));
asioDriver.createBuffers(activeChannels, asioDriver.getBufferPreferredSize());
asioDriver.start();
try {
Thread.sleep(1000);
} catch (InterruptedException ie) {
ie.printStackTrace(System.err);
}
JAsioHost.shutdownAndUnloadDriver();