I have a problem with a Android app that call ACRCloud. For the work that I need to do, I want to save the recording in a MP3 file but I don't know why it doesn't work.
That's my code :
File f = null;
try {
f = createAudioFile();
} catch (IOException e) {
e.printStackTrace();
}
byte[] data = acrCloudResult.getRecordDataPCM();
if(f.exists()){
String path = f.getPath();
FileOutputStream stream = null;
try {
stream = new FileOutputStream(path);
} catch (FileNotFoundException e) {
e.printStackTrace();
}
try {
stream.write(data);
} catch (IOException e) {
e.printStackTrace();
}
}