private AudioServer createServer(BusClient bus) throws Exception { float srate = sampleRate.value; int buffersize = getBuffersize(); boolean usingDefault = false; LibraryInfo info = libraries.get(audioLib.value); if (info == null) { info = libraries.get(AudioSettings.getLibrary()); if (info == null) { throw new IllegalStateException("Audio library not found"); } usingDefault = true; } LOG.log( Level.FINE, "Found audio library {0}\n{1}", new Object[] {info.provider.getLibraryName(), info.provider.getLibraryDescription()}); Device device = findDevice(info, usingDefault, false); if (device != null) { LOG.log(Level.FINE, "Found device : {0}", device.getName()); } Device inputDevice = null; if (device != null && device.getMaxInputChannels() == 0 && bus.getSourceCount() > 0) { inputDevice = findDevice(info, usingDefault, true); if (inputDevice != null) { LOG.log(Level.FINE, "Found input device : {0}", inputDevice.getName()); } } ClientID clientID = new ClientID("PraxisLIVE-" + getAddress().getRootID()); AudioConfiguration ctxt = new AudioConfiguration( srate, bus.getSourceCount(), bus.getSinkCount(), buffersize, createCheckedExts(device, inputDevice, clientID)); return info.provider.createServer(ctxt, bus); }
private void makeInputConnections() { int count = Math.min(inputClient.getInputCount(), bus.getSourceCount()); for (int i = 0; i < count; i++) { inputClient.getInputSink(i).addSource(bus.getSource(i)); } }