()
| 2528 | |
| 2529 | |
| 2530 | function pause() { |
| 2531 | console.log("In pause()", stream); |
| 2532 | paused = true; |
| 2533 | recording = false; |
| 2534 | if (healthCheckHandle) { |
| 2535 | clearInterval(healthCheckHandle); |
| 2536 | healthCheckHandle = null; |
| 2537 | } |
| 2538 | if (stream) { |
| 2539 | stream.getTracks().forEach(function(track) { |
| 2540 | console.log("Disabling track", track); |
| 2541 | track.enabled = false; |
| 2542 | }); |
| 2543 | |
| 2544 | if (audioInput) { |
| 2545 | audioInput.disconnect(); |
| 2546 | audioInput = null; |
| 2547 | } |
| 2548 | if (audioNode) { |
| 2549 | |
| 2550 | audioNode.disconnect(); |
| 2551 | audioNode = null; |
| 2552 | } |
| 2553 | |
| 2554 | if (audioCtx) { |
| 2555 | |
| 2556 | var thisCtx = audioCtx; |
| 2557 | audioCtx.close().then(function() { |
| 2558 | //console.log("Finished closing context ", thisCtx); |
| 2559 | }); |
| 2560 | audioCtx = null; |
| 2561 | } |
| 2562 | |
| 2563 | |
| 2564 | if (isSafari || (isIOS() && !isIPad())) { |
| 2565 | if (stream) { |
| 2566 | stream.getTracks().forEach(function(track) { |
| 2567 | //console.log("Stopping track", track); |
| 2568 | track.stop(); |
| 2569 | }); |
| 2570 | if (stream.close) { |
| 2571 | stream.close(); |
| 2572 | } |
| 2573 | if (stream.stop) { |
| 2574 | stream.stop(); |
| 2575 | } |
| 2576 | stream = null; |
| 2577 | } |
| 2578 | } |
| 2579 | } |
| 2580 | |
| 2581 | |
| 2582 | } |
| 2583 | |
| 2584 | function setupAudioProcessing(audioNode, audioCtx, notAllowedCallback, blockRecordCallback) { |
| 2585 | var pipe = {success:false}; |
no test coverage detected