Пример #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);
   }
 }