1
我正在嘗試錄製音頻,我正在使用此示例codename one capture。Codename one,Capture Audio
我收到錯誤在這條線
Util.copy(fs.openInputStream(file), fs.openOutputStream(filePath));
的Util類找不到方法copy
這是我的代碼
FileSystemStorage fs = FileSystemStorage.getInstance();
String recordingsDir = fs.getAppHomePath() + "recordings/";
fs.mkdir(recordingsDir);
try {
String file = Capture.captureAudio();
if(file != null) {
SimpleDateFormat sd = new SimpleDateFormat("yyyy-MMM-dd-kk-mm");
String fileName =sd.format(new Date());
String filePath = recordingsDir + fileName;
Util.copy(fs.openInputStream(file), fs.openOutputStream(filePath)); //stuck here
}
}catch(IOException err) {
System.out.println(err);
}