Hey guy, i need to record audio in my app and after record upload it.
I’m doing things good by using cordova.capture. I can record audio and upload it.
But some android device, which did not have a default record UI, i can not use the capture function anymore. After i did some research, i should only use the phonegap media, use media.startRecord() and stopRecord(). By calling this two functions, i didn’t get any error.
var src = “myrecording.mp3”;
var mediaRec = new Media(src, function onSuccess( ){ }, function onError(error){ });
But after that, i want to locate the audio file, and upload it. And i use the src variable, it does’t work.
I have try cordova.file to locate the file and i check if my file in their, by using function
$cordovaFile.checkFile(“file:///android_asset/data/data//cache/”, “myrecording.mp3”)
it give me undefined error, also
$cordovaFile.checkFile(“file:///android_asset/data/data//files/”, “myrecording.mp3”)
$cordovaFile.checkFile(“file:///android_asset/data/data//files/Documents/”, “myrecording.mp3”)
Anyone same problem? How did you guys sloved it?
I would very appreciate for any help. Thank you very much!