Yung A
Yung A

Reputation: 239

Codename one, Capture Audio

I'm trying to record audio, I am using this example codename one capture.

I am getting error on this line

 Util.copy(fs.openInputStream(file), fs.openOutputStream(filePath));

Util class cannot find method copy this is my code

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);
    }

Upvotes: 1

Views: 107

Answers (1)

Chen
Chen

Reputation: 3760

Make sure you use the com.codename1.io.Util and not a Util class from a different package

Upvotes: 1

Related Questions