emscripten-core / emscripten-core/emscripten

Audio does not start after a touch event

Open
#19,763 2 comments 1 reaction 0 assignees View on GitHub
Dominant language
C++
Stars
27.6k
Forks
3.6k
Avg merge
1d 6h
Merged PRs (30d)
109

Description

We have an application that wants to play audio. We are using the OpenAL interface as provided by emscripten.

The web audio autoplay policy blocks playback when the application loads, as expected. The user needs to interact with the application to enable sound. This works as it is supposed to for keyboard and mouse input, but fails for touch input. This is especially problematic on mobile devices, where touch is the only input available in most cases.

This is not browser or platform specific. We have checked Chrome and Firefox on Android, and Firefox on desktop, and they all behave consistently.

```
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.41-git (71634e036d20209a5d81c2b2171e145b44de1e12)
clang version 17.0.0 (/startdir/llvm-project 88421ea973916e60c34beb26597a5fc33f83dd8f)
```

(This also happens on 3.1.30.)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.