getusermedia

Sending a MediaStream to host Server with WebRTC after it is captured by getUserMedia

人盡茶涼 提交于 2019-11-27 11:19:54
I am capturing audio data using getUserMedia() and I want to send it to my server so I can save it as a Blob in a MySQL field. This is all I am trying to do. I have made several attempts to do this using WebRTC, but I don't even know at this point if this is right or even the best way to do this. Can anybody help me? Here is the code I am using to capture audio from the microphone: navigator.getUserMedia({ video:false, audio:true, },function(mediaStream){ // output mediaStream to speakers: var mediaStreamSource=audioContext.createMediaStreamSource(mediaStream); mediaStreamSource.connect

How to capture audio in javascript?

一世执手 提交于 2019-11-27 10:23:26
问题 I am currently using getUserMedia() , which is only working on Firefox and Chrome, yet it got deprecated and works only on https (in Chrome). Is there any other/better way to get the speech input in javascript that works on all platforms? E.g. how do websites like web.whatsapp.com app record audio? getUserMedia() prompts first-time-users to permit audio recording, whereas the Whatsapp application doesn't require the user's permission. The getUserMedia() I am currently using looks like this:

Converting WAV to any compressed audio format in client-side JavaScript

末鹿安然 提交于 2019-11-27 09:37:24
问题 I am recording audio from getUserMedia({audio:true}); in the browser using Recorder.js and then exporting it as a WAV file because that's the only option the library provides. A 1 minute 20 seconds file is 14.1 MB large. I need to upload the audio to a server and I need to do it fast. How do I convert the WAV audio in any other compressed format to lower the file size? I don't mind converting to: MP3 Opus WebM Ogg FLAC any other format you know of If there is no way as of now to convert to

switch camera using MediaDevices.getUserMedia() in webrtc

自古美人都是妖i 提交于 2019-11-27 07:48:30
问题 I am trying navigator.MediaDevices.getUserMedia() webrtc to switch the device camera during the call. This functionality is working fine on the desktop browser but on mozilla android it is not working. Here is my code that i am using . var front=false; var myConstraints = { video: { facingMode: (front? "user" : "environment")} }; navigator.mediaDevices.getUserMedia(myConstraints).then(function(stream) { } any idea about this?? 回答1: Phone hardware typically doesn't allow opening both the front

Is there a way to choose codecs in WebRTC PeerConnection?

﹥>﹥吖頭↗ 提交于 2019-11-27 07:11:59
问题 Hey I would like to know if there is any way to choose codecs when creating the offer/answer in WebRTC. There are currently not many video codecs to choose from, but there are audio codecs like Opus, PCMU, PCMA etc. 回答1: In general, yes. Here is example of how to prefer Opus codec during establishing conneciton. You should call 'preferOpus' from a callback function for createAnswer or createOffer. var preferOpus = function(sdp) { var sdpLines = sdp.split('\r\n'); for (var i = 0; i < sdpLines

HTML5 getUserMedia record webcam, both audio and video

别说谁变了你拦得住时间么 提交于 2019-11-27 06:41:21
Is it possible to use Chrome to capture video (webcam) and audio (microphone) from the browser and then save the stream as video file? I would like to use this to create a video/photobooth-like application that allows users to record a simple (30 second) message (both video and audio) to files that can later be watched. I have read the documentation but I have not (yet) seen any examples on how to capture both audio & video, also I did not find a way yet to store the results in a video file. Who can help? MediaStreamRecorder is a WebRTC API for recording getUserMedia() streams( still under

Disabling Auto Gain Conctrol with WebRTC App

天涯浪子 提交于 2019-11-27 03:34:00
问题 is there a way to disable the WebRTC "auto gain control feature" by default, by applying some javascript code to the app files? i am using simplewebrtc. 回答1: You can turn off audio processing using constraints (use https fiddle for Chrome): var constraints = { audio: { echoCancellation: false, noiseSuppression: false, autoGainControl: false, } }; navigator.mediaDevices.getUserMedia(constraints) .then(stream => audio.srcObject = stream) .catch(e => log(e)); var log = msg => div.innerHTML +=

iOS 11 getUserMedia not working?

南楼画角 提交于 2019-11-27 01:39:16
问题 Apple released a statement that getUserMedia will be fully functional on iOS 11. After installing iOS 11 Beta version 5, I do get a message that my website requests access to my camera and microphone, but it seems that the line: video.src = window.URL.createObjectURL(stream); or: video.srcObject = stream; Does not work. No errors, no exceptions, simply no picture from the phone's camera. Here's my full script: $(function () { video = document.getElementById('vid'); navigator.getUserMedia =

How to keep 1:1 aspect ratio video all the time in WebRTC

∥☆過路亽.° 提交于 2019-11-26 23:36:54
问题 When I use this setting, the video aspect ratio is 1:1. constraints = { audio: false, video: { width: 240, height: 240 } }; However, I want WebRTC choose better resolution if exists. When I changed it to this constraints = { audio: false, video: { width: { min: 240, ideal: 720, max: 1080 }, height: { min: 240, ideal: 720, max: 1080 } } }; The demo jsfiddle In my case, sometimes, it becomes 4:3, which is 640*480. I think it is because both the number 640 and 480 are between 240 and 1080. How

getUserMedia() in chrome 47 without using https

血红的双手。 提交于 2019-11-26 22:16:34
In chrome version 47 they force you to use https to be allow using getUserMedia(). Unfortunately, I can't use https in my whole web, I only use it in the login rest (It a SPA - single page app). So, the address to the web is without https, only the login rest uses ssl. I use this repo with very little changes: https://github.com/Jmlevick/html-recorder My question is if is there any way to use audio recorder in my web app and keep my web address with http and not https? what ideas do you have to overcome this issue? phihag getUserMedia allows you to listen in to the private conversations of the