question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Provide better error messages if the maximum number of audiocontexts are reached/will be reached

See original GitHub issue

Hi 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:closed
  • Created 7 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
thijstriemstracommented, Feb 26, 2017

Perhaps a meaningful error should be thrown when this maximum is (about to be) reached (if possible?).

0reactions
mspaecommented, Mar 8, 2017

@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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found