game-ci / docker

Series of CI-specialised docker images for Unity.
https://hub.docker.com/u/unityci
MIT License
400 stars 124 forks source link

GameCI WebGL builds have no audio. #241

Closed diyang100 closed 6 months ago

diyang100 commented 6 months ago

Bug description

We are previously running our Unity CI builds on Windows, and wanted to run them in an isolated docker container environment for security reasons. The unity version is 2021.3.21f1 and we tried to set up under Ubuntu 22.04. The GameCI image tested is ubuntu-2021.3.21f1-webgl-3.0.1, ubuntu-2021.3.30f1-webgl-3.0.1, and our own Dockerfile based on the Dockerfile by GameCI. Using our own Dockerfile image, we get the error:

Errors during import of AudioClip Assets/AudioPackage/Audio/hhh_ambient.wav:
ffmpeg -i "Temp/fsbankcache/tmpinput_rJqluF.WAV" -f mp4 -codec aac -b:a 192000 -strict experimental -y "Temp/importedAudioTempPrimary"
FSBTool ERROR: Error converting Temp/fsbankcache/tmpinput_rJqluF.WAV: make sure you have avconv or ffmpeg installed
FSBTool ERROR: Failed encoding audio clip '/usr/unitylibs/spatial-unity-environments/package-builder/Assets/AudioPackage/Audio/hhh_ambient.wav' to AAC. Possibly the file is too short. Try to append silence such that the length becomes at least 1024 samples.

The GameCI containers do not show the error, but also no audio is heard. We have ffmpeg installed for all three containers (tried with versions 4.4.2 and 4.4.4) and can run ffmpeg -i "Temp/fsbankcache/tmpinput_rJqluF.WAV" -f mp4 -codec aac -b:a 192000 -strict experimental -y "Temp/importedAudioTempPrimary" manually in the container, which produces a file. The audio files are in .WAV format.

How to reproduce

Expected behavior

The package builds should have audio when run in the browser.

Additional details

diyang100 commented 6 months ago

it seems that modifying the Dockerfile from Game-CI has fixed the issue. for some reason when only building for webgl, our builds have no sound. building for multiple bundles together solved the issue.