Failed to construct 'AudioContext': The number of hardware contexts provided (6) is greater than or equal to the maximum bound (6)
See original GitHub issueWe use RecordRTC to record the window in a Chrome extension. The recording works fine except when we try to record the same window more continuously, it throws an error
background.js:18632 DOMException: Failed to construct 'AudioContext': The number of hardware contexts provided (6) is greater than or equal to the maximum bound (6).
at getMixedAudioStream (chrome-extension://lfgkmcnkcgpggkkdcblgecnbinfoeipb/scripts/background.js:91194:47)
at MultiStreamsMixer.getMixedStream (chrome-extension://lfgkmcnkcgpggkkdcblgecnbinfoeipb/scripts/background.js:91150:32)
at MultiStreamRecorder.record (chrome-extension://lfgkmcnkcgpggkkdcblgecnbinfoeipb/scripts/background.js:91427:55)
at initRecorder (chrome-extension://lfgkmcnkcgpggkkdcblgecnbinfoeipb/scripts/background.js:86221:23)
at Object.startRecording (chrome-extension://lfgkmcnkcgpggkkdcblgecnbinfoeipb/scripts/background.js:86201:9)
at RecordingManager._callee3$ (chrome-extension://lfgkmcnkcgpggkkdcblgecnbinfoeipb/scripts/background.js:85681:32)
at tryCatch (chrome-extension://lfgkmcnkcgpggkkdcblgecnbinfoeipb/scripts/background.js:39004:40)
at Generator.invoke [as _invoke] (chrome-extension://lfgkmcnkcgpggkkdcblgecnbinfoeipb/scripts/background.js:39238:22)
at Generator.prototype.(anonymous function) [as next] (chrome-extension://lfgkmcnkcgpggkkdcblgecnbinfoeipb/scripts/background.js:39056:21)
at step (chrome-extension://lfgkmcnkcgpggkkdcblgecnbinfoeipb/scripts/background.js:5405:30)
Error throws from
this.$initializeRecordRtc();
this.state.rtc.startRecording(); // this line
$initializeRecordRtc() is something like below
$initializeRecordRtc() {
const config = {
mimeType: 'video/webm',
disableLogs: false,
frameInterval: this.screenInfo.frameInterval,
canvas: {
width: this.screenInfo.width,
height: this.screenInfo.height,
},
video: {
width: this.screenInfo.width,
height: this.screenInfo.height,
},
bufferSize: 16384,
leftChannel: false,
};
if (this.state.rtc) {
this.$stopAndClearRecorder();
}
this.state.rtc = RecordRTC([this.state.tabStream, this.state.audioStream], config);
}
My code which stops the recording is something like this
$stopAndClearRecorder() {
if (!this.state) {
return;
}
try {
if (this.state.rtc) {
const clear = () => {
try {
this.state.rtc.clearRecordedData();
this.state.rtc.destroy();
} catch (e) { this.background.error(e); /* Ignored */ }
this.$cleanStreams();
};
if (this.state.rtc.getState() === 'recording') {
this.state.rtc.stopRecording(clear);
}
clear();
}
} catch (e) {
this.background.log('Could not stop recording', e);
}
}
Thanks in advance !
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (1 by maintainers)
Top Results From Across the Web
Failed to construct 'AudioContext': number of hardware ...
I started calling close() on the audio context instance created in my React component when component was getting unmounted and that resolved the ......
Read more >AudioContext Error when having more than 6 storyline in one ...
The number of hardware contexts provided (6) is greater than or equal to the maximum bound (6).When having more than 6 storyline in...
Read more >308784 - AudioContext not going out of scope. - chromium
Chrome Version : 32.0.1674.0 (Developer Build 229185) ... error says "The number of hardware contexts provided (6) is greater than or equal ......
Read more >Close AudioContext when timeline is complete - Audio & Video
... Failed to construct 'AudioContext': The number of hardware contexts provided (6) is greater than or equal to the maximum bound…
Read more >LayoutTests/webaudio/audiocontext-max-contexts-expected.txt ...
Check that the AudioContext constructor throws when the limit on hardware ... contexts provided (6) is greater than or equal to the maximum...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

destroy useless
You should have only one
AudioContextin the page.