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.
https://github.com/edimuj/app-audioinput-demo
MIT License
161 stars 88 forks source link

Add support for cordova browser platform and/or cordova-simulate #13

Closed edimuj closed 6 years ago

edimuj commented 8 years ago

For development purposes, so that the plugin can run in the browser when running in the browser platform: cordova platform add browser

The browser proxy should either provide dummy audio data (i.e. white noise) or rely on getUserMedia if it is supported in the current browser.

Tattomoosa commented 8 years ago

I already made a basic implementation of this in my project with getUserMedia to test in browser. It was pretty trivial to do. Basically, if getUserMedia is supported it uses that instead, and I plug either audioinput or the Media Stream Source into a gain node and deal with signal from the gain node from there on out.

I'm not sure that it's possible to support all the configuration options though. Maybe through some creative use of AudioNodes?

edimuj commented 8 years ago

Sounds really good, Matt! I agree, it it certainly possible to achieve most configuration options using AudioNodes, like mono<->stereo for example using ChannelSplitterNode and ChannelMergerNode.

Right now, 100% support for all parameters is not needed and can be something to implement later on, just a way of smoothly using the plugin when emulated in the Cordova Browser platform would be great. And why not cordova-simulate support as well?

edimuj commented 6 years ago

Fixed by PR #52