title: Working with audio in Java
body: <p>I went over Java's tutorial on sounds but somehow it is way too complex for a beginner.<br>
  It is <a href="http://docs.oracle.com/javase/tutorial/sound/accessing.html" rel="nofollow">here</a><br>
  My aim is this:
  <li> Detect all the audio input and output devices </li>
  <li> let the user select a audio <strong>input</strong> device </li>
  <li> capture what the user says </li>
  <li> output it to the <strong>default</strong> audio output device </li></p>
  
  <p>Now how do I go about doing that?<br>
  Is there a better tutorial available?<br>
  <strong>What I have tried:</strong></p>
  
  <pre><code>import javax.sound.sampled.*;
  public class SoundTrial {
      public static void main(String[] args) {
          Mixer.Info[] info = AudioSystem.getMixerInfo();
          int i =0;
          for(Mixer.Info print : info){
  
              System.out.println("Name: "+ i + " " + print.getName());
              i++;
          }
      }
  }  
  </code></pre>
  
  <p><strong>output:</strong>  </p>
  
  <pre><code>Name: 0 Primary Sound Driver
  Name: 1 Speakers and Headphones (IDT High Definition Audio CODEC)
  Name: 2 Independent Headphones (IDT High Definition Audio CODEC
  Name: 3 SPDIF (Digital Out via HP Dock) (IDT High Definition Audio CODEC)
  Name: 4 Primary Sound Capture Driver
  Name: 5 Integrated Microphone Array (ID
  Name: 6 Microphone (IDT High Definition
  Name: 7 Stereo Mix (IDT High Definition
  Name: 8 Port Speakers and Headphones (IDT Hi
  Name: 9 Port SPDIF (Digital Out via HP Dock)
  Name: 10 Port Integrated Microphone Array (ID
  Name: 11 Port Microphone (IDT High Definition
  Name: 12 Port Stereo Mix (IDT High Definition
  Name: 13 Port Independent Headphones (IDT Hi
  </code></pre>