- Home /
Audio files with more than 2 channels fail to play in Build?
I have an 8-channel .wav which plays in the Unity editor (in the Inspector and in the scene during runtime) but is silent in both Mac and Windows standalone.
My final purpose is to load an 8ch .wav from StreamingAssets using WWW (already working in Editor), split the 8 channels into 8 audio clips (also working in Editor). But, even after importing the 8ch wav into Assets and using various compression settings, it still won't play from a traditional AudioSource in standalone.
I'm stumped. What is different between the Editor and standalone that would prevent the audio clip from playing properly?
Where is it going wrong? I'm assu$$anonymous$$g at some point you open up the .wav and read the sample information from all the channels then create audioclips from that. If it's not working in a build then chances are the problem has to do with that code. Can you share it with us?
@smoggach: You're right, I did read sample data to create audio clips, and I also assumed at first that I was doing something wrong. But the same code works in build with a 2-channel .wav file.
As a further test, I put the 8ch wav into Assets and added the imported AudioClip to an AudioSource, with the same result: plays in Editor, not in builds; no code involved.
I'm not, but I am using the Oculus Unity integration so there could be UnityEditor code in those assets. I'm definitely not treating the audio with any UnityEditor dependent code.