Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The AudioContext was not allowed to start #41

Open
nielstanghe opened this issue Jul 20, 2023 · 6 comments
Open

The AudioContext was not allowed to start #41

nielstanghe opened this issue Jul 20, 2023 · 6 comments

Comments

@nielstanghe
Copy link

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
Copy link

Firu115 commented Jul 26, 2023

Same here!

@ibnusyawall
Copy link

up, same here!

@Fusseldieb
Copy link

Same here.

@aqordeon
Copy link

aqordeon commented Feb 4, 2024

Have you guys found out how to trick this warning?

@Fusseldieb
Copy link

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
Copy link

Nrosa01 commented Apr 29, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants