Window event 'audioinput' not being triggered in Ionic 3
See original GitHub issueHi Guys, i’m very happy i found your plugin, i’ve been looking for a plugin with similar API to the web audio API for a long time, but i can’t make the audioinput
event get triggered
I’m emulating IOS/Android in the browser
The plugin was installed correctly.
I used this line on top of my Angular provider to make audioinput
work
declare let audioinput: any;
My initialize function: the callback contains permission stuff and a method that calls audioinput.start()
all permissions work perfectly
let captureCfg = {
sampleRate: 16000,
bufferSize: PROCESSING_BUFFER_LENGTH,
channels: 1,
format: audioinput.FORMAT.PCM_16BIT,
audioSourceType: audioinput.AUDIOSOURCE_TYPE.DEFAULT,
audioContext: this.audioContext
};
audioinput.initialize(captureCfg, () => {...})
But when i call my start function , i’m using streamToWebAudio: true
because i want to receive the data while recording in order to process, the event is never triggered.
audioinput.start({streamToWebAudio : true});
window.addEventListener('audioinput', (event) => {
// THIS EVENT NEVER GETS TRIGGERED
this.onAudioProcess(event);
}, false);
audioinput.connect(audioinput.getAudioContext().destination);
I did some debugging inside the plugin and the exec()
function gets called with all the right properties but audioinput._audioInputEvent()
never gets called, EVER.
What am i doing wrong? help me
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (3 by maintainers)
Top GitHub Comments
Also make sure you have this on your
package.json
Hi @Bobisback , after installing it you need to ensure it was added on
config.xml
if not, add this line<plugin name="cordova-plugin-audioinput" spec="^1.0.1" />
change thespec
value to your version in typescript you need to declare global variables on the top of your files, likeaudioinput
and then just make it listen for the event
this is where i ask for the mic to record
this is where i connect the nodes
p.s. above are my options, go to the docs to see what they mean