Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR fileUrl incorrect in IOS #94

Open
MmSwd opened this issue Jul 2, 2019 · 3 comments
Open

ERROR fileUrl incorrect in IOS #94

MmSwd opened this issue Jul 2, 2019 · 3 comments
Labels
bug This is an identified bug that should be fixed. help wanted The great thing about open-source is that everyone can contribute!

Comments

@MmSwd
Copy link

MmSwd commented Jul 2, 2019

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: 0

In 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

        _fileUrl = [NSURL URLWithString:url];

now it Works!

Someone has the same problem?
Am I doing something wrong using the plugin?

@pgcan
Copy link

pgcan commented Jul 26, 2019

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?

@edimuj edimuj added bug This is an identified bug that should be fixed. help wanted The great thing about open-source is that everyone can contribute! labels Jul 31, 2019
@Merwan1010
Copy link

Same problem here, no callback for audioinput.stop so no url...

@dhandarbeit-tk
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This is an identified bug that should be fixed. help wanted The great thing about open-source is that everyone can contribute!
Projects
None yet
Development

No branches or pull requests

5 participants