How to locate the audio file after i media.stopRecord()

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!

Tell me which plugin are you initially using to record your media?

Hi Gajotres, i use plugin cordova.plugin.media to record audio in this situation.

Finally i had solved this problem, with help: android - cordova-ionic ngCordova ios or iPhone file read error code 5 ENCODING_ERR - Stack Overflow.

The file path for android are:

myFsRootDirectory1 = ‘file:///storage/emulated/0/’; // path for tablet
myFsRootDirectory2 = ‘file:///storage/sdcard0/’; // path for phone

Hope it can still help some other people.