Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
1.0.0
Description
navigator.mediaDevices.getUserMedia() in Line 426 of the AudioRecorder.js is not working with callbacks anymore, but with promises. See here.
Version 1.0.0 of AudioRecorder.js contains:
var beginAudioCapture = function beginAudioCapture() { // Attempt to retrieve an audio input stream from the browser navigator.mediaDevices.getUserMedia({ 'audio' : true }, function streamReceived(stream) { // Create processing node which receives appropriately-sized audio buffers processor = context.createScriptProcessor(BUFFER_SIZE, format.channels, format.channels); processor.connect(context.destination); // Send blobs when audio buffers are received processor.onaudioprocess = function processAudio(e) { writer.sendData(toSampleArray(e.inputBuffer).buffer); }; // Connect processing node to user's audio input source source = context.createMediaStreamSource(stream); source.connect(processor); // Save stream for later cleanup mediaStream = stream; }, function streamDenied() { // Simply end stream if audio access is not allowed writer.sendEnd(); // Notify of closure if (recorder.onerror) recorder.onerror(); }); };
A possible fix would be:
var beginAudioCapture = function beginAudioCapture() { // Attempt to retrieve an audio input stream from the browser navigator.mediaDevices.getUserMedia({ 'audio' : true }) .then(stream => { // Create processing node which receives appropriately-sized audio buffers processor = context.createScriptProcessor(BUFFER_SIZE, format.channels, format.channels); processor.connect(context.destination); // Send blobs when audio buffers are received processor.onaudioprocess = function processAudio(e) { writer.sendData(toSampleArray(e.inputBuffer).buffer); }; // Connect processing node to user's audio input source source = context.createMediaStreamSource(stream); source.connect(processor); // Save stream for later cleanup mediaStream = stream; }).catch(err => { // Simply end stream if audio access is not allowed writer.sendEnd(); // Notify of closure if (recorder.onerror) recorder.onerror(); });
Attachments
Issue Links
- is duplicated by
-
GUACAMOLE-992 No sound input on Windows 10, microphone always silent
- Closed
-
GUACAMOLE-995 RDP "Enable audio input (microphone)" does NOT work
- Closed
-
GUACAMOLE-1003 I can't input the audio
- Closed