How to download a microphone request and save it in real time

I am currently working on a project where I need to work with sound from users. I need to ask the user to connect the microphone so that I can set up his conversation using x-webkit speech - the main problem is that the user needs to click on the button and speak whenever he needs to speak - I want the browser to ask the user whether the website can use a microphone, and if the user accepts the request, x-webkit will work and stay in real time. How can I make x-webkit speech stay alive without forcing the user to click a button?

Thanks!

+6
source share
1 answer

I think you need Webrtc getusermedia`

//get audio navigator.getUserMedia({audio:true}, gotStream); 

.

 //display audio function gotStream(stream) { window.AudioContext = window.AudioContext || window.webkitAudioContext; var audioContext = new AudioContext(); // Create an AudioNode from the stream var mediaStreamSource = audioContext.createMediaStreamSource(stream); // Connect it to destination to hear yourself // or any other node for processing! mediaStreamSource.connect(audioContext.destination); } 

Quick start: http://www.html5rocks.com/en/tutorials/webrtc/basics/

+2
source

Source: https://habr.com/ru/post/954957/


All Articles