RecorderRTC: Use StereoAudioRecorder BT#18287

After the upgrade of the library here:

c52b41287e

The audio recorder didnt work. Wav files were not created/saved.
Tested with chrome and firefox.
pull/3766/head
Julio 5 years ago
parent e48a836ede
commit e0e8247f6d
  1. 6
      main/inc/lib/javascript/record_audio/record_audio.js
  2. 7
      main/template/default/learnpath/record_voice.tpl

@ -1,8 +1,6 @@
/* For licensing terms, see /license.txt */
window.RecordAudio = (function () {
var isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
function startTimer() {
$("#timer").show();
var timerData = {
@ -126,9 +124,10 @@ window.RecordAudio = (function () {
stopTimer();
startTimer();
recordRTC = RecordRTC(stream, {
recorderType: isSafari ? RecordRTC.StereoAudioRecorder : RecordRTC.MediaStreamRecorder,
recorderType: RecordRTC.StereoAudioRecorder,
type: 'audio',
mimeType: 'audio/wav',
numberOfAudioChannels: 2
});
recordRTC.startRecording();
@ -187,6 +186,7 @@ window.RecordAudio = (function () {
return;
}
console.log('stop');
stopTimer();
recordRTC.stopRecording(function (audioURL) {
btnStart.prop('disabled', false).removeClass('hidden');

@ -31,8 +31,6 @@
<script>
$(function() {
var isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
function startTimer() {
$("#timer").show();
var timerData = {
@ -73,7 +71,7 @@
clearInterval(window.timerInterval);
}
function useRecordRTC(){
function useRecordRTC() {
$('#record-audio-recordrtc').show();
var audioTitle = $('#audio-title-rtc');
@ -93,9 +91,10 @@
stopTimer();
startTimer();
recordRTC = RecordRTC(stream, {
recorderType: isSafari ? RecordRTC.StereoAudioRecorder : RecordRTC.MediaStreamRecorder,
recorderType: RecordRTC.StereoAudioRecorder,
type: 'audio',
mimeType: 'audio/wav',
numberOfAudioChannels: 2
});
recordRTC.startRecording();

Loading…
Cancel
Save