public void configure(AudioConfiguration ac) throws Exception { if (config.getSampleRate() != ac.getSampleRate() || config.getInputChannelCount() != ac.getInputChannelCount() || config.getOutputChannelCount() != ac.getOutputChannelCount() || config.getMaxBufferSize() != ac.getMaxBufferSize() || !ac.isFixedBufferSize()) { System.out.println("Unexpected audio configuration"); throw new IllegalArgumentException("Unexpected audio configuration"); } }
public void configure(AudioConfiguration context) throws Exception { float srate = context.getSampleRate(); if (Math.round(srate) != sampleRate.value) { sampleRate.value = Math.round(srate); } period = (long) ((blockSize.value / srate) * 1000000000); }