getusermedia

Record Audio Stream from getUserMedia

本秂侑毒 提交于 2019-11-30 05:19:28
In recent days, I tried to use javascript to record audio stream. I found that there is no example code which works. Is there any browser supporting? Here is my code navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia; navigator.getUserMedia({ audio: true }, gotStream, null); function gotStream(stream) { msgStream = stream; msgStreamRecorder = stream.record(); // no method record :( } You could check this site: https://webaudiodemos.appspot.com/AudioRecorder/index.html It stores the audio into a file (.wav) on

Microphone activity level of WebRTC MediaStream

▼魔方 西西 提交于 2019-11-30 03:54:51
I would like some advice on how best to get the microphone activity level of an audio MediaStreamTrack javascript object in Chrome/Canary. The MediaStreamTrack object is an audio track of the MediaStream returned by getUserMedia , as part of the WebRTC javascript API. YumYumYum When microphone has audio the green bar up and down very nice: <script type="text/javascript"> navigator.webkitGetUserMedia({audio:true, video:true}, function(stream){ // audioContext = new webkitAudioContext(); deprecated OLD!! audioContext = new AudioContext(); // NEW!! analyser = audioContext.createAnalyser();

Navigator.mediaDevices.getUserMedia not working on iOS 12 Safari

岁酱吖の 提交于 2019-11-30 01:50:44
问题 As of iOS 12, navigator.mediaDevices.getUserMedia() is returning an error in Safari. To recreate this, open iPhone Web Inspector, then run this snippet in the console: var constraints = { audio: true, video: { width: 1280, height: 720 } }; navigator.mediaDevices.getUserMedia(constraints) .then(function() { console.log('getUserMedia completed successfully.'); }) .catch(function(error) { console.log(error.name + ": " + error.message); }); You'll see that this runs successfully in desktop

Accessing Multiple camera javascript getusermedia

那年仲夏 提交于 2019-11-29 22:03:43
问题 guys i have two cameras that is -the web camera -the laptop camera i want to stream those camera in a website i already have some reference here is some code that is working on jsfiddle here <video id="video" width="640" height="480" autoplay></video> <button id="snap" class="sexyButton">Snap Photo</button> <canvas id="canvas" width="640" height="480"></canvas> <script> // Put event listeners into place window.addEventListener("DOMContentLoaded", function() { // Grab elements, create settings

TypeError: 'getUserMedia' called on an object that does not implement interface MediaDevices

本秂侑毒 提交于 2019-11-29 14:56:50
问题 I'm trying to implement a webcam into a website using a video tag. It works in Chrome, but FireFox and IE return errors in the console. Anyone have any ideas why? Thank you! Code: navigator.getMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mediaDevices.getUserMedia || navigator.msGetUserMedia || OTPlugin.getUserMedia; Firefox error:TypeError: 'getUserMedia' called on an object that does not implement interface MediaDevices. IE error: Unable to get property

HTML5 Microphone capture stops after 5 seconds in Firefox

大兔子大兔子 提交于 2019-11-29 09:12:23
I'm capturing audio input from microphone with getUserMedia() function, works fine in chrome, but in firefox sound dies out after 5 seconds. If I send request for microphone again (without reloading the page) same thing happens. Here is the code (I used http://updates.html5rocks.com/2012/09/Live-Web-Audio-Input-Enabled as guidance): //getting the function depending on browser navigator.getMedia = ( navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia); // success callback when requesting audio input stream function gotAudioStream

WebRTC - Browser doesn't ask for mic access permission for local html file

杀马特。学长 韩版系。学妹 提交于 2019-11-29 07:14:00
I have some simple webRTC code which uses getUserMedia to gain access to user's mic. Now when I load that html file (saved at my localhost) in my browser, the browser doesn't ask for mic access permission and thus get failed to get access. But when I run the same html inside the w3schools.com editor, it asks for mic access permission and upon allowing it to access my mic, it works fine... Why is this strange behaviour? When you open an html file right off the filesystem (file:// prefix), Chrome will auto-block getUserMedia permissions. You have to run a server locally. I started up a sinatra

iOS11 getUserMedia with apple web-app not working

给你一囗甜甜゛ 提交于 2019-11-29 04:54:40
Edit: Duplicate of How to access camera on iOS11 home screen web app? I'm running into a problem with using a apple web-app together with camera access through the getUserMedia API. I have some application that is working fine when accessed through safari, it asks for persmission to use the camera and upon approval I can see the camera feed. But if I save this same page to the home screen as an web-app this does not work anymore. There is no prompt for camera access, which seems to be the problem as it is not enabled by default. The line that gives the problems is a meta tag which enables full

Change sample rate of AudioContext (getUserMedia)

痞子三分冷 提交于 2019-11-28 18:45:07
Im trying to record a 48000Hz recording via getUserMedia. But without luck. The returned audio MediaStream returns 44100Hz. How can i set this to 48000Hz? Here are snippets of my code: var startUsermedia = this.startUsermedia; navigator.getUserMedia({ audio: true, //sampleRate: 48000 }, startUsermedia, function (e) { console.log('No live audio input: ' + e); }); The startUsermedia function: startUsermedia: function (stream) { var input = audio_context.createMediaStreamSource(stream); console.log('Media stream created.'); // Uncomment if you want the audio to feedback directly //input.connect

How to capture audio in javascript?

我的梦境 提交于 2019-11-28 17:05:11
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: navigator.getUserMedia( { "audio": { "mandatory": { "googEchoCancellation": "false",