code: public void startRecording(){
          if (currentAudioState.get() == PREPARED_STATE) {
              currentAudioRecordingThread = new AudioRecorderThread(audioFile.replace(".wav",".temp"), MediaRecorder.AudioSource.MIC, sampleRateInHertz,channelConfig,audioEncoding,maxFileSizeInBytes);
              currentAudioState.set(RECORDING_STATE);
              currentAudioRecordingThread.start();
              onTimeCompletedTimer=new Timer(true);
              onTimeCompletionTimerTask=new MaxTimeTimerTask();
              onTimeCompletedTimer.schedule(onTimeCompletionTimerTask,maxTimeInMillis);
              remainingMaxTimeInMillis=maxTimeInMillis;
              recordingStartTimeMillis=System.currentTimeMillis();
          }
          else{
              Log.w(TAG,"Audio recorder is not in prepared state. Ignoring call.");
          }
      }
docs: Starts the recording if the recorder is in a prepared state. At this time, the complete file path should not have .temp file(as that is where the writing is taking place) and the specified .wav file should not exist as well(as that is where the .temp file will be converted to).
  Does nothing if it is recorder is not in a prepared state.
  @throws IllegalArgumentException If the parameters passed into it are invalid according to {@link AudioRecord}.getMinBufferSize API.