WebGL builds have no audio
See original GitHub issueBug description
When building my project on version 2019.4.10f1, the final WebGL build does not play any audio. Can also see some NULL reference exceptions in the browser console when PlayOneShot was called. The audio works when built locally on windows 10.
How to reproduce
- Using the code snippet below to create a WebGL build.
- Hosting the build through github pages
- Testing the build and hearing no audio
- name: Unity - Builder uses: game-ci/unity-builder@v2.0-alpha-6 with: allowDirtyBuild: true projectPath: Phong/ unityVersion: 2019.4.10f1 targetPlatform: WebGL buildsPath: . buildName: WebBuild
Expected behavior
Audio should play in main menu on awake as well as in-game.
Additional details
I did also try Unity versions 2019.3.8f1 and 2019.4.12f1 as well as ubuntu-18.04 and 16.04
Similar issue found on Unity’s issue tracker (has been resolved): https://issuetracker.unity3d.com/issues/audio-no-longer-plays-in-build
Another thread with a similar description: https://forum.unity.com/threads/no-sound-clips-in-webgl-build.1016086/
Null reference exceptions:
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:11 (4 by maintainers)
Top GitHub Comments
Personally I had to make my own dockerfile to get audio to work:
You can reference your own dockerfile in the action yml:
yup @webbertakken
no-recommends
worked for me