ValveSoftware / steam-audio

Steam Audio
https://valvesoftware.github.io/steam-audio/
Apache License 2.0
2.28k stars 158 forks source link

Steam Audio behaves very differently in a Unity build as opposed to the Editor when using "one shot" sounds. #373

Open threeheadeddingo opened 3 weeks ago

threeheadeddingo commented 3 weeks ago

System Information

Issue Description I have created a fairly simple "roll your own" pooled audio source system for creating one-shot audio I need to "summon" instantly to a particular position. Physics impacts, footsteps, etc. The prefab is a gameobject with an audio source, a steam audio source, and nothing else. I pool them all at startup (about 10 of them) and call them as one-shots by first moving their position, then setting their clip, then playing them.

This works PERFECTLY in the editor. However, when I make a build, I rarely ever hear my audio playing in this manner. Sometimes I can FAINTLY hear it, or like a subtle echo of a footstep for example. But largely I hear nothing. Very strange.

I DO hear Steam Audio sources that are statically placed in the world already and don't move in any way (like a generator sound, or a cricket, etc.).

achandak commented 3 weeks ago

Are you able to share some minimal repro we can take a look at? This would be ideal.

Otherwise, can you share additional information on your prefab and your script so we can try to repro this behavior on our end.