title: Audio recording and playback with libgdx
body: <p>I was wondering if anyone has any luck with audio recording and playback using libgdx. I'm currently using 0.9.8 and just messing around trying to make a simple voice chat app. </p>
  
  <p>I create my audio device using</p>
  
  <pre><code>int samples = 44100;
  int seconds = 5;
  boolean isMono = true;
  short[] data = new short[samples*seconds];
  
  AudioRecorder recorder = Gdx.audio.newAudioRecorder(samples, isMono);
  AudioDevice player = Gdx.audio.newAudioDevice(samples, isMono);
  </code></pre>
  
  <p>On a button press I kick of a new thread to record the data. (I know this is a messy to kick off a new thread, but i'm only trying to play with audio recording)</p>
  
  <pre><code>new Thread(new Runnable() {
      @Override
      public void run() {
          System.out.println("Record: Start");
          recorder.read(data, 0, data.length);
          System.out.println("Record: End");
      }
  }).start();
  </code></pre>
  
  <p>After the recording I play back the recorded data using </p>
  
  <pre><code>new Thread(new Runnable() {
  @Override
  public void run() {
      System.out.println("Play : Start");
      player.writeSamples(data, samples, data.length);
      System.out.println("Play : End");
  }
  }).start();
  </code></pre>
  
  <p>On my laptop the recording and playback seems to work fine. I can record the data and then playback works great. 
  The problem happens on Android. I've tried it on three devices (Samsung S3, Samsung Galaxy Mini and a Nexus 10). In all cases, the recording works perfectly, the issue occurs when I attempt the playback it just locks up in the player.writeSamples and nothing is played. I've left it 10 min and never prints "Record : End". </p>
  
  <p>Has anyone ever got audio playback working? Am I missing something?</p>