emscripten-core / emscripten-core/emscripten
Audio does not start after a touch event
- 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
Assessment
This issue has not been assessed yet.