示例#1
0
 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");
   }
 }
示例#2
0
 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);
 }