HTML5 Audio pool exhausted
See original GitHub issueSo I have a website where you can hover on div and this starts to play a song. There are maaany of these divs there and I had a lot of bugs along the way, but I finally got to the point where the site is not that buggy. Actually, there is just one bug now. When I play a few songs by hovering over different divs and then I reload the page, it sometimes happens that the sound is not played until I clear cache or hard-refresh the page. The browser says:
HTML5 Audio pool exhausted, returning potentially locked audio object.
Here is my code:
$(this).hover(
function() {
$("#spinner-loading-voice").css("display", "block");
if (sound != null) {
if (sound.playing()) {
sound.stop();
sound.unload();
}
}
sound = new Howl({
src: voice["mp3_local_path"],
format: "mp3",
html5: true,
onload: function() {
if (sound != null) {
if (!sound.playing()) {
sound.play();
} else {
sound.stop();
sound.unload();
sound.play();
}
}
$("#spinner-loading-voice").css("display", "none");
},
onplayerror: function() {
sound.once('unlock', function() {
sound.play();
});
}
});
},
function() {
sound.unload();
$("#spinner-loading-voice").css("display", "none");
}
);
For now, let’s ignore how messy the code is. My question is - can I somehow clear the Audio pool?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:31
- Comments:42 (1 by maintainers)
Top Results From Across the Web
How to fix 'HTML 5 Audio pool exhausted, returning potentially ...
I have tried not using objects and directly defining all key press events inside keyDown function using if..else and it works but it...
Read more >Warn HTML5 Audio pool exhausted
'warn HTML5 Audio pool exhausted, returning potentially locked audio object' It happens when the user (WebRTC) of Genesys App was ...
Read more >HTML5 Audio pool exhausted - Bountysource
Coming soon: A brand new website interface for an even better experience!
Read more >Howler.js - JavaScripting
It defaults to Web Audio API and falls back to HTML5 Audio. This makes working with audio ... We keep a pool of...
Read more >Cross-browser audio basics - Developer guides | MDN
The code below is an example of a basic audio implementation using HTML5: <audio controls> <source src="audiofile.mp3" type="audio/mpeg" ...
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
I was facing the same problem after reviewing my code I noticed that I was getting the error due to empty Howler src. I’m using Vue Js so the URL src comes from the store and it gets from external API. When the upload for the first milliseconds the src is empty.
My Solution: Make sure that the howler src is not empty