@WorkerThread public synchronized boolean prepareRecord(int audioSource,int outputFormat,int audioEncoder,int sampleRate,int bitRate,File outputFile){
  stopRecord();
  mRecorder=new MediaRecorder();
  mRecorder.setAudioSource(audioSource);
  mRecorder.setOutputFormat(outputFormat);
  mRecorder.setAudioSamplingRate(sampleRate);
  mRecorder.setAudioEncodingBitRate(bitRate);
  mRecorder.setAudioEncoder(audioEncoder);
  mRecorder.setOutputFile(outputFile.getAbsolutePath());
  try {
    mRecorder.prepare();
  }
 catch (  IOException exception) {
    Log.w(TAG,"startRecord fail, prepare fail: " + exception.getMessage());
    setError(ERROR_INTERNAL);
    mRecorder.reset();
    mRecorder.release();
    mRecorder=null;
    return false;
  }
  mState=STATE_PREPARED;
  return true;
}

@ WorkerThread public synchronized boolean prepareRecord ( int audioSource , int outputFormat , int audioEncoder , int sampleRate , int bitRate , File outputFile ) { stopRecord ( ) ; mRecorder = new MediaRecorder ( ) ; mRecorder . setAudioSource ( audioSource ) ; mRecorder . setOutputFormat ( outputFormat ) ; mRecorder . setAudioSamplingRate ( sampleRate ) ; mRecorder . setAudioEncodingBitRate ( bitRate ) ; mRecorder . setAudioEncoder ( audioEncoder ) ; mRecorder . setOutputFile ( outputFile . getAbsolutePath ( ) ) ; try { mRecorder . prepare ( ) ; } catch ( IOException exception ) { Log . w ( TAG , "startRecord fail, prepare fail: " + exception . getMessage ( ) ) ; setError ( ERROR_INTERNAL ) ; mRecorder . reset ( ) ; mRecorder . release ( ) ; mRecorder = null ; return false ; } mState = STATE_PREPARED ; return true ; }
prepare for a new audio record .
