예제 #1
0
  public void startRecord() {
    log("startRecord, mRequestedType = " + mRequestedType);
    if (sIsRecording) {
      return;
    }
    if (!RecorderUtils.isExternalStorageMounted()) {
      mSampleInterrupted = true;
      Log.e(TAG, "-----Please insert an SD card----");
    } else if (!RecorderUtils.diskSpaceAvailable(
        PhoneRecorderHandler.PHONE_RECORD_LOW_STORAGE_THRESHOLD)) {
      mSampleInterrupted = true;
      Log.e(TAG, "--------Storage is full-------");
    } else {
      try {
        if (AUDIO_AMR.equals(mRequestedType)) {
          startRecording(MediaRecorder.OutputFormat.RAW_AMR, ".amr");
        } else if (AUDIO_3GPP.equals(mRequestedType)) {
          startRecording(MediaRecorder.OutputFormat.THREE_GPP, ".3gpp");

        } else if (AUDIO_ANY.equals(mRequestedType)) {
          // mRequestedType = AUDIO_3GPP;
          startRecording(MediaRecorder.OutputFormat.THREE_GPP, ".3gpp");
        } else {
          throw new IllegalArgumentException("Invalid output file type requested");
        }

        sIsRecording = true; // start successfully.qintx
      } catch (IOException oe) {
        sIsRecording = false;
      }
    }
  }
예제 #2
0
 /** @return boolean */
 public static boolean sdcardFullFlag() {
   sSDcardFullFlag =
       !RecorderUtils.diskSpaceAvailable(PhoneRecorderHandler.PHONE_RECORD_LOW_STORAGE_THRESHOLD);
   return sSDcardFullFlag;
 }