Provide better error messages if the maximum number of audiocontexts are reached/will be reached
See original GitHub issueHi there, I have a question.
I am getting this error below when I am creating multiple waveforms
Uncaught DOMException: Failed to construct ‘AudioContext’: The number of hardware contexts provided (6) is greater than or equal to the maximum bound (6).
here’s my code
for(var i =0; i < 10; i++){
var wavesurfer = WaveSurfer.create({
container: '#waveform-0',
waveColor: 'red',
progressColor: 'purple',
hideScrollbar: true
});
wavesurfer.load('audio.mp3');
}
And My guess was it’s because I am creating multiple instance but I found that it occurs error when I use the newest version (1.3.2) and it works without error when I use an old one(1.0.52)
If it’s not a bug, can someone let me know how to create multiple waveforms in a right way ??
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (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() - Web APIs - MDN Web Docs - Mozilla
The AudioContext() constructor creates a new AudioContext object which ... doesn't indicate a maximum or minimum number of audio contexts ...
Read more >AudioContext Error when having more than 6 storyline in one ...
Uncaught DOMException: Failed to construct 'AudioContext': The number of hardware contexts provided (6) is greater than or equal to the ...
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 FreeTop 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
Top GitHub Comments
Perhaps a meaningful error should be thrown when this maximum is (about to be) reached (if possible?).
@CYDP0127 The limit should not be reached anymore with the new changes merged into master (see above) – This should be fixed with the next release.