コード例 #1
0
ファイル: AudioServerIO.java プロジェクト: oletizi/beads
 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);
 }