sound icon indicating copy to clipboard operation
sound copied to clipboard

The AudioContext was not allowed to start

Open nielstanghe opened this issue 1 year ago • 6 comments

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?

nielstanghe avatar Jul 20 '23 12:07 nielstanghe

Same here!

Firu115 avatar Jul 26 '23 15:07 Firu115

up, same here!

ibnusyawall avatar Nov 26 '23 19:11 ibnusyawall

Same here.

Fusseldieb avatar Jan 18 '24 17:01 Fusseldieb

Have you guys found out how to trick this warning?

aqordeon avatar Feb 04 '24 08:02 aqordeon

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.

Fusseldieb avatar Feb 04 '24 08:02 Fusseldieb

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

Nrosa01 avatar Apr 29 '24 00:04 Nrosa01