getusermedia

getUserMedia constraints ignored on Safari 12

房东的猫 提交于 2020-06-11 17:04:42
问题 For some reason Safari 12 (haven't tried on other versions) is completely ignoring getUserMedia constraints. My code looks something like this navigator.mediaDevices.getUserMedia({ video: { facingMode: 'environment', width: { min: 640, ideal: 1280 } }, audio: true }) .then(userStream)//Safari on Mac ignores constraints and ends up executing here .catch(fallback)//Chrome on Mac raises and error and ends up executing here On Chrome when I do stream.getVideoTracks()[0].getConstraints() I get

IBM Watson Speech-to-Text “unable to transcode data stream audio/webm -> audio/x-float-array” media MIME types

拜拜、爱过 提交于 2020-03-25 12:30:42
问题 I'm recording short audio files (a few seconds) in Chrome using mediaDevices.getUserMedia() , saving the file to Firebase Storage, and then trying to send the files to IBM Watson Speech-to-Text. I'm getting back this error message: unable to transcode data stream audio/webm -> audio/x-float-array In the browser I set up the microphone: navigator.mediaDevices.getUserMedia({ audio: true, video: false }) .then(stream => { var options = { audioBitsPerSecond : 128000, mimeType : 'audio/webm' };

Google Cloud Speech-to-Text: “INVALID_ARGUMENT: Invalid recognition 'config': bad encoding..” codec audio encoding error

柔情痞子 提交于 2020-03-25 12:30:36
问题 I'm recording short audio files (a few seconds) in Chrome using mediaDevices.getUserMedia() , saving the file to Firebase Storage, and then trying to send the files to Google Cloud Speech-to-Text from a Firebase Cloud Function. I'm getting back this error message: INVALID_ARGUMENT: Invalid recognition 'config': bad encoding. Google's documentation says that this error message means Your audio data might not be encoded correctly or is encoded with a codec different than what you've declared in

Check if browser/platform support screen capturing via `getDisplayMedia`

回眸只為那壹抹淺笑 提交于 2020-02-03 04:34:09
问题 We can request a media stream to a screen or windows via navigator.mediaDevices.getDisplayMedia() . However, this immediately prompts the user to decide which kind of capturing to use. I need to check if the browser/platform even support screen capturing. Of course, it is possible to check for 'getDisplayMedia' in navigator.mediaDevices , but this just tells us if the API is supported by the browser. In particular, on FF and Chrome on Android, the API is defined and I can call getDisplayMedia

How to stop wavesurfer microphone / `this.stop.stream` is not a function

房东的猫 提交于 2020-01-24 12:05:48
问题 I'm running this wavesurfer microphone instance and i'm running into a problem called this.stop.stream is not a function whenever i'm trying to stop the microphone after starting it. This mic does not record anything - it's just visualizing. But in chrome the mic just stays open until reload. Which is not fun for users. And m. I have found why that happens here => https://wavesurfer-js.org/api/file/src/plugin/microphone.js.html#lineNumber199 all the methods that are called after starting the

How to record audio from Audio Element using javascript

六月ゝ 毕业季﹏ 提交于 2020-01-13 05:12:27
问题 I am making an audio recorder using HTML5 and Javascript and do not want to include any third party API, I reached at my first step by creating an audio retriever and player using <audio> tag and navigator.webkitGetUserMedia Function which get audio from my microphone and play in through <audio> element but I am not able to get the audio data in an array at this point I don't know what to do which function to use. 回答1: simple just create a audio node, below is tweaked code from MattDiamond's

What is a TrackStartError?

Deadly 提交于 2020-01-11 08:37:08
问题 I am running audio only sessions using the constraints: var constraints = { audio: { mandatory: { echoCancellation: false }, optional: [{ sourceId: audioSource }] }, video: false }; I am noticing that in a very small number of sessions I am receiving a TrackStartError from the getUserMedia request. I cannot see any correlation between browser/browser version/OS/devices available. Some computers continually get this error, some once and then after a new getUserMedia request no problem and some

Stop / kill WebRTC media stream

[亡魂溺海] 提交于 2020-01-11 04:58:08
问题 How to completely kill the WebRTC media stream? MediaStream.stop() is not working anymore. Testing in Chrome 47, Mac OS 10.11. 回答1: Use stream.getTracks().forEach(track => track.stop()); . stream.stop() was deprecated. 回答2: For all browsers if (microphone_data.media_stream) { microphone_data.media_stream.getTracks().forEach(function (track) { track.stop(); }); } 来源: https://stackoverflow.com/questions/34966809/stop-kill-webrtc-media-stream

Why the difference in native camera resolution -vs- getUserMedia on iPad / iOS?

限于喜欢 提交于 2020-01-10 05:04:47
问题 I've built this web app for iPads that uses getUserMedia and streams the resulting video through to a video element on a website. The model I'm using is an iPad Air with a rear-camera resolution of 1936x2592. Currently the constraints for the getUserMedia method are: video: { facingMode: 'environment', width: { ideal: 1936 }, height: { ideal: 2592 } } However, when I pull in the video it looked fairly grainy. Digging through the console log to grab the stream, video track, and then settings

Saving desktopCapturer to video file from Electron app

梦想的初衷 提交于 2020-01-10 03:28:44
问题 Basing on electron api and this question I'm trying to save recorded user screen to .webm file in videos folder in root app folder. Actually it's almost working because it save .webm file but the file which is saved is empty, it weigh 0B.. I don't know what I'm missing here. So it looks like it's somehow not recording correctly because file is empty.. edit when debbuging I discovered that recording is probably working correctly because blobs which I console log has value inside, after