예제 #1
0
  private void startRecording() {
    setRecordingFile();

    mExtAudioRecorder = ExtAudioRecorder.getInstanse(false);
    mExtAudioRecorder.setOutputFile(mFilePath);
    mExtAudioRecorder.prepare();
    mExtAudioRecorder.start();
  }
예제 #2
0
 // stop recodrding for extaudio class
 private void stopRecording() {
   mExtAudioRecorder.stop();
   mExtAudioRecorder.release();
   mRecordTime.stop();
   //        mRecordTime.setVisibility(View.INVISIBLE);
   showSoundController();
   mIsRecording = false;
   mRecordingTimer.cancel();
 }
예제 #3
0
  public void onFinish() {
    if (mExtAudioRecorder != null) {
      mExtAudioRecorder.release();
      mExtAudioRecorder.stop();
      mExtAudioRecorder = null;
    }
    if (mPlayer != null) {
      mPlayer.release();
      mPlayer = null;
      mIsPlaying = STOP;
      mPlayPause.setImageResource(R.drawable.ic_play);
    }

    super.onDestroy();
  }
예제 #4
0
 public void onPause() {
   super.onPause();
   if (mExtAudioRecorder != null) {
     stopRecording();
     mExtAudioRecorder.release();
     mExtAudioRecorder.stop();
     mExtAudioRecorder = null;
   }
   if (mPlayer != null) {
     mPlayer.release();
     mPlayer = null;
     mIsPlaying = STOP;
     mPlayPause.setImageResource(R.drawable.ic_play);
   }
 }