vueuse / sound

🔊 A Vue composable for playing sound effects
https://sound.vueuse.org
MIT License
500 stars 26 forks source link

The AudioContext was not allowed to start #41

Open nielstanghe opened 1 year ago

nielstanghe commented 1 year ago

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?

Firu115 commented 1 year ago

Same here!

ibnusyawall commented 1 year ago

up, same here!

Fusseldieb commented 10 months ago

Same here.

aqordeon commented 10 months ago

Have you guys found out how to trick this warning?

Fusseldieb commented 10 months ago

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.

Nrosa01 commented 7 months ago

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