title: Separate channels in java
body: <p>This software records sounds of PC (with targetdataline) but I can't separate both channels (stereo) in Java...</p>
  
  <p>For exemple: I connect to my PC one ipode and one iphone with one audio cable (stereo) ipode is on the right channel and iphone on the left channel. So I want to be able to record the right channel or the left channel. For the moment when I record I have the two sounds on the same audio file.</p>
  
  <p>My AudioFormat </p>
  
  <pre><code>float sampleRate = 8000.0F; // 8000,11025,16000,22050,44100  int
  sampleSizeInBits = 16; // 8,16  int channels = 2; // 1,2 boolean
  signed = true; // true,false  boolean bigEndian = false; // true,false
  return new AudioFormat(sampleRate, sampleSizeInBits, channels,
    signed,bigEndian);
  </code></pre>
  
  <p>And write my file with "TargetDataLine" For exemple : </p>
  
  <pre><code>targetDataLine.open(audioFormat);  
  targetDataLine.start();
  AudioSystem.write(new AudioInputStream(targetDataLine), fileType,
    audioFile);
  </code></pre>
  
  <p>Does anyone have an idea?</p>