title: How to use audiorecorder on all devices
body: <p>I tried to record sound using audiorecorder method like below, it is fine on some devices but on the others it works just for first time when I want to use again it throws <code>Error code -20 when initializing native AudioRecord object</code> what is wrong?</p>
  
  <pre><code>final int RECORDER_BPP = 16;
  int RECORDER_SAMPLERATE = 16000;
  int RECORDER_CHANNELS = AudioFormat.CHANNEL_IN_MONO;
  int RECORDER_AUDIO_ENCODING = AudioFormat.ENCODING_PCM_16BIT;
  int bufferSizeInBytes = AudioRecord
          .getMinBufferSize(RECORDER_SAMPLERATE, RECORDER_CHANNELS,
                  RECORDER_AUDIO_ENCODING);
  // Initialize Audio Recorder.
  AudioRecord audioRecorder = new AudioRecord(
          MediaRecorder.AudioSource.MIC, RECORDER_SAMPLERATE,
          RECORDER_CHANNELS, RECORDER_AUDIO_ENCODING, bufferSizeInBytes);
  
  audioRecorder.startRecording();
  </code></pre>