I'm using GetButtonUp to trigger random audio when an interactive game object is clicked. The random audio clips that play are 2D sounds (uncompressed, but small). It seems to work fine when clicking on the interactive object the vast majority of the time, however, about every 20-30 clicks, the audio that plays is extremely choppy.
Has anybody experienced this kind of audio inconsistency within Unity? All of my audio clips play fine within the inspector, just not always in the game itself. I was going to attempt changing the DSP Buffer size, however, I would prefer not to give up performance in an attempt to fix this small inconsistency. Any help/suggestions as to how I can correct this would be greatly appreciated!! Thank you.
1)How do you play the clips? PlayOneShot or Play?
2)Are your clips looped?
3)How long are they? You say small, how small?
4)How quickly do these 30 clicks have to happen before you get the choppiness?
5)Choppy: you mean clicks? Is a previous clip still heard and just the newly played one is choppy?
Sorry for the many questions! It would help to know more...
Gregzo, Sorry for the lack of detail. -I'm using Playmaker. It's a simple fsm that gets a mouse pick event, then sends an event once clicked. -In that (clicked) state, I'm using an "Audio Play" action (it's not set to one shot). -The clips are all set as a 2D sound, and the audio source that they come out of is not set to loop. -The random audio clips are anywhere from .6 to 2.3 seconds and the largest one is 322kb. -These clicks are slow, as it allows for the first audio clip to finish playing before the mouse pick event can be sent again. Therefore, the previous clip is not being heard since it finished. -By choppiness, I mean the opposite of clear... the audio is garbled and distorted... sorry I can't articulate any better than that!
Thank you for your help, I hope this is a bit more clear.
what version of unity are you running? We've experienced some chopping/popping of audio with on-board soundcards and earlier versions of unity. The stuff we experience before may be fixed in newer versions. Also, have you tested the build on multiple machines? what os's, etc.?
We're running version 3.5.1. We have not yet upgraded to 3.5.2 as we're in the middle of a deadline. We've have been testing on multiple machines (all of them alienware or dell) running windows 7.
Are all your clips wav's? All clip import settings set to load in memory and not stream from disk? What is your latency setting? Which platform are ypu building to? And last but not least: how does Playmaker implement "Audio Play " action? If it implements it with PlayOmeShot, that could (emphasis on COULD) be part of the problem.
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
The best place to ask and answer questions about development with Unity.
To help users navigate the site we have posted a user guide.
If you are a new user, check out our FAQ for more information.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
For troubleshooting common problems with Unity 5.x Editor (including Win 10).
Answers and Comments
5 People are following this question.
Buggy Reverb Zones (Reverb with No Dry)
3D Audio Source plays choppy/poping in web player (Video)
Inconsistent ReverbZone / AudioSource.volume behavior
Music Choppy and Weird
Turn camera's sound on/off follow other Gameobject