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

Working with audioinput on ionic2

opened this issue · comments

Hello, I've tried running the audioinput plugin on an ioinic2 app but there is no response or indication that he plugin is working, for example, I did console.log(window.audioinput); but the audioinput object does not print to console log.
Does this plugin work in with another plugin? or will have to write a Web Audio API code to work with the window.audioinput?
or is it completely stand alone?
I would like to see a working demo code with ionic2 or angular2.
Note: I couldnt figure out how to use the example demo code found on the plugin.
Edit: window.audioinput prints undefined in console log.

`import {Component} from '@angular/core';
import {NavController, Platform} from 'ionic-angular';

@component({
templateUrl: 'build/pages/contact/contact.html'
})
export class ContactPage {
//public platform: any;

constructor(private navCtrl: NavController, private platform: Platform) {
platform.ready().then(() => {

    // (<any>window).audioinput is same as window.audioinput
    console.log((<any>window).audioinput); // prints undefined in console
});

}

}
`

commented

Hmm, not quite sure if I understand, this is just a regular Apache Cordova plugin. From your code it doesn't look like the plugin has been installed into your project. How did you perform the actual import/install of the cordova-audioinput-plugin?

I don't use ionic myself, but I've understood that it can be a bit confusing regarding how to use Cordova plugins together with ionic, since you can do it in a number of different ways. This article seems to clarify a lot of things regarding this subject: http://www.joshmorony.com/using-cordova-plugins-in-ionic-2-with-ionic-native

commented

Closing this issue since there's been no response for a month now.

Hello,
I have the same problem,
How you solved this problem?

I found the bug.
Don't run the ionic run with livereload.

cya

commented

@faustofjunqueira thanks for sharing!