How to disable multiple sounds during audio streaming? #1651
Unanswered
hafsamubarak
asked this question in
Q&A
Replies: 1 comment
-
Hello, the way I wrote my code to achieve this is to save the ID of the newly played audio, and make sure that no additional sound instances are created. I'm using react, and have written my code like so, but unfortunately, I'm running into an issue where I cannot pause the audio. So I'm not sure if this is the right way to go around it.
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have this simple Howler function that is called on click on play button in my App:
const soundPlay = (src) => {
const sound = new Howl({
src,
format: ["mp3"],
});
sound.play();
};
My issue is: when I click on the play button multiple times then I have multiple sounds streaming at the same time
My question is how to play ONLY one streaming audio on click until it finishes then it can be played again on another click?
Beta Was this translation helpful? Give feedback.
All reactions