question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Question] How to get the mic mediaStream?

See original GitHub issue

Sorry, for the noob question. I came across this lib while trying to find an alternative for navigator.mediaDevices.getUserMedia({ audio: true }) which does not work with cordova-android 6.4.0 for me because of “NotReadableError - Could not start source” even with the mic permission enabled. I’ve been trying to figure out how get the recording mic’s mediaSteam from audioinput. Any suggestions?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

6reactions
edimujcommented, Apr 5, 2018

There is actually a way: If you need a MediaStream, you should be able to connect the audioinput to a MediaStreamAudioDestinationNode as you see in the example there, an oscillator node is connected to such a node, but in this case you would do something like this instead:

audioinput.start({streamToWebAudio: true}); // Start the capture
var dest = audioinput.getAudioContext().createMediaStreamDestination(); // Create the node
audioinput.connect(dest); // Connect the plugin to the node

And now you should be able to reference the MediaStream by using dest.stream

So the MediaStreamAudioDestinationNode basically converts the data coming from Web Audio (which this plugin is using) into a MediaStream with a single AudioMediaStreamTrack.

1reaction
Bobisbackcommented, Nov 24, 2018

This is gold thanks for the input!!!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can a MediaStream (microphone)… - Apple Developer
In my webapp I use a MediaStream (microphone) to convert the spoken word into text ... So I get the visualisation styled and...
Read more >
javascript - Microphone activity level of WebRTC MediaStream
I would like some advice on how best to get the microphone activity level of an audio MediaStreamTrack javascript object in Chrome/Canary.
Read more >
MediaStream - Web APIs - MDN Web Docs - Mozilla
Chrome Edge MediaStream Full support. Chrome55. more. Toggle history Full support. Edge... MediaStream() constructor Full support. Chrome55. more. Toggle history Full support. Edge... active Full support....
Read more >
Media Capture and Streams - W3C
This document defines APIs for requesting access to local multimedia devices, such as microphones or video cameras. This document also defines ...
Read more >
Web API WebRTC.getUserMedia() Method - GeeksforGeeks
Using the MediaStream received from the getUserMedia(): If the user gives permission to access the camera and the microphone, then this method ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found