edimuj / cordova-plugin-audioinput

This iOS/Android Cordova/PhoneGap plugin enables audio capture from the device microphone, by in near real-time forwarding audio to the web layer of your application. A typical usage scenario for this plugin would be to use the captured audio as source for a web audio node chain, where it then can be analyzed, manipulated and/or played.

Home Page:https://github.com/edimuj/app-audioinput-demo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Multiple game breakers on Android

Lingomat opened this issue · comments

Plugin basically doesn't work using with events. AudioInputCapture.java has this in initialize and start:

String fileUrlString = args.getString(5);
if (fileUrlString != null) {
   this.fileUrl = new URI(fileUrlString);
  // ensure it's a file URL
   new File(this.fileUrl);
 }

I don't know much about Java but that's clear broken. This seems to work:

 if (!args.isNull(5)) {
   String fileUrlString = args.getString(5);
   this.fileUrl = new URI(fileUrlString);
   // ensure it's a file URL
   new File(this.fileUrl);
}

I'd PR it but even with the fix the window audioinput event only fires once and not repeatedly as expected.

Thanks for the suggestion, it's part of the fix, which I've just pushed to https://github.com/nzilbb/cordova-plugin-audioinput
A pull request has been created.

Ooo, thanks for that. Your PR makes other changes which looks like it might address the fire-once thing too? I guess I should try figure out how to debug java so I can contribute directly when possible.

Confirmed, works great.

commented

The PR has been merged. Thanks for the quick fix @robertfromont and thanks for telling us about the problem @Lingomat