Quantcast
Channel: Questions in topic: "webgl"
Viewing all articles
Browse latest Browse all 2390

"Unable to decode audio data" in webgl build

$
0
0
Hello, I'm relatively new to unity and have just started working on my first project. I'm trying to build something for WebGL and got to the point where I'm now adding sound, but I keep getting this error in my console in my browser: Uncaught (in promise) DOMException: Unable to decode audio data I imported some free sound packages (links in asset store:[UI sfx](https://www.assetstore.unity3d.com/en/#!/content/36989) and [casual game pack](https://www.assetstore.unity3d.com/en/#!/content/54116)). My build target is set to WebGL. When I go to the import settings for one of the sounds immediately after importing, there's a message in the inspector that says "The selection contains different compression formats to the default settings for the current build platform." Then, I check the box that says "Override for WebGL" and hit Apply, and then the warning message about different compression formats goes away. Just as a test, I added an AudioSource to one of the objects in my scene, then dragged and dropped one of the sound files for which I checked the "Override for WebGL" into the AudioClip reference in the AudioSource, and checked "Play On Awake" and "Loop." When I try hitting play in the editor, I can hear the sound looping. When I build and try the project in my browser, though, I get the error above, the Unable to decode audio data one, in the console of my browser. I'm using Chromium (the experimental build of chrome) because I'm making a game that uses VR. For build template, I'm using the template found [here](https://github.com/gtk2k/Unity-WebVR-Assets), which is for handling the VR stuff. For the sounds, I've tried using both .wav files and .mp3 files that I got from those free packages off of the asset store, and still none of them work. For my webserver, I'm using [mongoose](https://www.cesanta.com/products/binary). So, does anyone know how I can do this correctly so that the sound will correctly play when built and run in a browser? Thanks

Viewing all articles
Browse latest Browse all 2390

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>