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

audioinput.stop() stream to web problem #80

Open kpwa opened 6 years ago

kpwa commented 6 years ago

one i call audioinput.stop() the next streamtoweb audio will just stop working. Issue happens in ios 11 & 12

edimuj commented 6 years ago

Do you have some code showing how to trigger this issue?

kpwa commented 6 years ago

rec() { audioinput._micGainNode = null; let audioCtx = new (window["AudioContext"] || window["webkitAudioContext"])(); audioinput.start({streamToWebAudio : true, audioContext:audioCtx, concatenateMaxChunks: 1, normalize: true}); // Start the capture var dest = audioinput.getAudioContext().createMediaStreamDestination(); // Create the node audioinput.connect(dest); return (dest.stream); }

stop(){ audioinput.disconnect(); audioinput.stop(); }

i call rec function to start. Everything works ok, my stream goes through perfectly. Then i call stop. Then i call rec function again, but no audio is streamed back also no error is displayed either.

Then when i restart the app, and call rec function, it works, then i call stop and call rec function again, same issue re ocurs.