I had the same problem today. Solved it by releasing a Media object. I'm not sure why this helped, but I have a feeling that the OS is holding onto the Media object instead of saving it, and then after it released it properly saved?
However, 100%. It works without release in other directories in Cordoba (e.g. cordova.file.externalDataDirectory).
Here is my code:
var fileName = randomFileName(); fileName = fileName + ".aac"; var store = cordova.file.dataDirectory; window.resolveLocalFileSystemURL(store, function(dir){ var directoryToSave = dir.nativeURL + fileName; $scope.audioRecording = new Media(directoryToSave, audioRecordingSuccess, audioRecordingFail, audioStatus); $scope.audioRecording.startRecord(); setTimeout(function(){ $scope.audioRecording.stopRecord(); $scope.audioRecording.release(); }, 5000); });
source share