This question is asked before but its accepted answer does not work.
The problem is that I cannot record audio on ios using cordova/ionic 2 application, I have tried the ionic native which fails without error, now trying the cordova-media-plugin which gives the error:"Failed to start recording using AVAudioRecorder code:1".
here is my code
this.file.createFile(this.dir, this.filename, true).then(f => {
this.m = new (<any>window).Media(this.dir + this.filename,function(e){alert('Success');},
function(e){alert('failed'+JSON.stringify(e));});
this.m.startRecord();
}).catch(e=>alert(JSON.stringify(e)));
this.dir has the value of tempDirectory and filename is .wav same result with mp3
Please help, Thanks
It's can be a permisson problem cause on a old version of this plugin (cordova 3.0) the code 1 was :
To be sure you have the permission to record you can used this plugin
An example :