无法在我的内部存储中找到存储的音频文件

时间:2016-01-27 15:09:06

标签: android audio

我试图录制音频并将此音频存储在我的内部存储空间而不是SD卡中。但在按照教程后,我无法在设备中找到录制的音频

public void record(){

    new CountDownTimer(5000, 1000) { // 5000 = 5 sec

        public void onTick(long millisUntilFinished) {
            startRecording();
            Toast.makeText(HomeActivity.this, R.string.record_audio, Toast.LENGTH_LONG).show();
        }

        public void onFinish() {
            stopRecording();
            Toast.makeText(HomeActivity.this, R.string.record_saved, Toast.LENGTH_LONG).show();
        }
    }.start();


}

public void startRecording(){

    if(mRecorder!=null){
        mRecorder.release();
    }

    File fileOut = new File(File);

    if(fileOut!=null){
        fileOut.delete();
    }
    mRecorder = new MediaRecorder();
    mRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
    mRecorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
    mRecorder.setOutputFile(File);
    mRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);


    try {
        mRecorder.prepare();
    } catch (IOException e) {
        e.printStackTrace();
    }
    mRecorder.start();
}

0 个答案:

没有答案