Open MmSwd opened 5 years ago
Hi @MmSwd, I too got the same issue "error: "Invalid file URL". I tried your fix by changing that one line of code so error is gone but I don't get the callback function 'onStopped' called after stop method call. Did you do any other change in plugin code?
Same problem here, no callback for audioinput.stop so no url...
I copied the plugin, linked it locally and swapped the line.
It seems you get the correct url when you subscribe to the "audioinputfinished" event.
Hi I started using this plugin with great satisfaction on Android; when I tried to use it on IOS, I had problems starting from the example for a simple audio recording.
var captureCfg = { fileUrl : cordova.file.cacheDirectory + "temp.wav" } // Start the capture. audioinput.start(captureCfg); // ...and when we're ready to stop recording. audioinput.stop();
When I try this example in IOS (version 10) , the log is: [INFO] startRecording: 0 [INFO] stop: 0 [INFO] stopped: 0In debug with xcode I saw that there is a line (105-106) in AudioReceiver.m
_fileUrl = [NSURL URLWithString:[url stringByAddingPercentEncodingWithAllowedCharacters:set]];
that transform my path from :
file:///var/mobile/Containers/Data/Application/0C07A5DE-32CD-4498-833A-BBAEC19025D0/Library/Caches/temp.wav
to
"file%3A%2F%2F%2Fvar%2Fmobile%2FContainers%2FData%2FApplication%2F0C07A5DE-32CD-4498-833A-BBAEC19025D0%2FLibrary%2FCaches%2Ftemp.wav"
so the file url is invalid.
I try to comment the line that convert with percent symbols, and using this line
now it Works!
Someone has the same problem? Am I doing something wrong using the plugin?