MCPcopy Create free account
hub / github.com/Wscats/chrome-devtools-cli / StereoAudioRecorder

Function StereoAudioRecorder

src/__tests__/MediaStreamRecorder.js:1375–1420  ·  view source on GitHub ↗
(mediaStream)

Source from the content-addressed store, hash-verified

1373// StereoAudioRecorder.js
1374
1375function StereoAudioRecorder(mediaStream) {
1376 // void start(optional long timeSlice)
1377 // timestamp to fire "ondataavailable"
1378 this.start = function(timeSlice) {
1379 timeSlice = timeSlice || 1000;
1380
1381 mediaRecorder = new StereoAudioRecorderHelper(mediaStream, this);
1382
1383 mediaRecorder.record();
1384
1385 timeout = setInterval(function() {
1386 mediaRecorder.requestData();
1387 }, timeSlice);
1388 };
1389
1390 this.stop = function() {
1391 if (mediaRecorder) {
1392 mediaRecorder.stop();
1393 clearTimeout(timeout);
1394 this.onstop();
1395 }
1396 };
1397
1398 this.pause = function() {
1399 if (!mediaRecorder) {
1400 return;
1401 }
1402
1403 mediaRecorder.pause();
1404 };
1405
1406 this.resume = function() {
1407 if (!mediaRecorder) {
1408 return;
1409 }
1410
1411 mediaRecorder.resume();
1412 };
1413
1414 this.ondataavailable = function() {};
1415 this.onstop = function() {};
1416
1417 // Reference to "StereoAudioRecorder" object
1418 var mediaRecorder;
1419 var timeout;
1420}
1421
1422if (typeof MediaStreamRecorder !== 'undefined') {
1423 MediaStreamRecorder.StereoAudioRecorder = StereoAudioRecorder;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected