I have an issue where audio (a hover sound) isn't playing on SOME menus during a build of the game. They play as they should in the editor, though. I've tried using WAV, MP3 and OGG formats. OGG is my default file type for audio.
I have a default sound placed in each scene and assigned in the Scene Manager for each scene, too.
The menus are on the game screen at all times so aren't set to pause anything during gameplay.
I'm not sure what screenshots you may need to see here but I'm using Unity 6.1 and AC 1.83.
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
Is there any pattern to when things play vs don't - i.e. a specific Menu, or condition?
It's the same menus that don't play sounds.
Are the Menus using AC or Unity UI?
Create a new project, import AC, and run the New Game Wizard to create a default set of Managers and a sample scene (2D or 3D depending on your game proper).
Then copy over your regular project's Menu Manager and assign it in the new project's Game Editor window. Also copy over the sounds, and UI prefabs if used, and make sure the Menu with the issue has these files assigned correctly.
Assign a "Default Sound" to the sample scene, and test the sound works in the Editor. Does this issue then occur in the build?
I tried that and the sounds still wouldn't work. However, I've got all sounds working by setting all sound/music assets to "Compressed in Memory". This is the only way they'll play in an actual build for me.
Interestingly, when I created a new project I created a new scene and simply tried to play an audio file via an actionlist's 'Play Music' and it wouldn't work in a build then either, UNLESS I switched the audio file over to "Compressed in Memory".
It turns out that the reason some menu sounds played and some didn't is because of their import settings as mentioned above.
I'm not sure if this is a bug or not.
To test/recreate, you can create a new project, have an audio file set to "Streaming" or "Decompress on Load", assign it to an actionlist's "Play Music" and see if it works in a build. It doesn't for me, unless it's set to "Compressed in Memory".
Thanks for the details, but I'm afraid I have no such issue when repeating those steps on my end. It may be an issue with Unity, as AC is still relying on Unity's AudioSource for playback.