【发布时间】:2021-11-30 09:25:43
【问题描述】:
我想录制音频 3gp 并将其保存到 app/src/main/python 文件夹,以使用此文件处理 python 代码。但是当我用上面的路径保存文件时,python目录下没有这个文件。我该怎么办?
这是我的代码记录3gp文件
String path = "app/src/main/python/myrecording.3gp";
MediaRecorder recorder = new MediaRecorder();
recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
recorder.setMaxDuration(1000);
recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
recorder.setOutputFile(path);
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
try {
recorder.prepare();
recorder.start();
} catch (IllegalStateException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
【问题讨论】: