我写了一段代码来记录音频,并将其保存到以下文件位置。
private String getFilename() {
String filepath = Environment.getExternalStorageDirectory().getPath();
File file = new File(filepath, AUDIO_RECORDER_FOLDER);
if (!file.exists()) {
file.mkdirs();
}
return (file.getAbsolutePath() + "/" + System.currentTimeMillis() + file_exts[currentFormat]);
}
在Logcat中,它给我的文件位置是
/storage/emulated/0/AudioRecorder/1436854479696.mp4
。
我无法在我的SD卡上找到这个文件位置。如何访问该位置?
我的安卓6.0系统允许我在不需要第三方应用程序的情况下浏览实习内存。我只需做这个/*。
1."设置" 2."存储和USB" 3."Intern" 4.4. [让它加载一下......] 5.5. [一直向下滚动] 6."浏览"
词语可能与标准的英文版本不一致,因为我只是从葡萄牙语自由翻译过来的。
注意。至少在我的手机中,/storage/emulated/0
并不对应SD卡,而是对应**内部存储器。这个方法对我的外置卡不起作用,但我从未在其他手机上试过。
希望这对你有帮助!
试试这个
private String getFilename() {
String filepath = Environment.getExternalStorageDirectory().getPath();
File file = new File(filepath + "/AudioRecorder" );
if (!file.exists()) {
file.mkdirs();
}
return (file.getAbsolutePath() + "/" + System.currentTimeMillis() + ".mp4");
}