sound
sound copied to clipboard
The AudioContext was not allowed to start
Using the vue setup composition api here:
<script setup lang="ts">
import ping from './assets/ping.wav';
import { useSound } from '@vueuse/sound';
const pingSound = useSound(ping);
async function clickTheButton() {
pingSound.play();
}
</script>
Everything works as it should but the console leaves a warning on loading the component (clickTheButton is not yet triggered):
The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page.
Using Vue3.2.45 and Vite 4.1.0
Is there a way to avoid these warnings?
Same here!
up, same here!
Same here.
Have you guys found out how to trick this warning?
Have you guys found out how to trick this warning?
As it seems it's not only a warning. Sometimes the sound doesn't play, and I think it is because of exactly this.
No solution yet, at least from me.
It's even worse for me, sounds get pooled and when I click on the page, all the hover sounds that couldn't play before play at the same time