unity-game-engineaudioaudio-sourceaudioclip

Unity something went wrong when play too many audio clips simultaneously


I'm making a rhythm game, and I use 'AudioSource.PlayOneShot()' function to play the hit sound when the player hits the note. I downloaded a beatmap from Osu!Mania to test my game.

I found when there's too many audio clips playing simultaneously (20 audio clips or more per second), the audio output becomes stuttered, disorder, and the audio clips played earlier will temporarily be muted until the number of simultaneous audio clips playing is cut down to a certain amount...

It's common in difficult levels of rhythm games (play many audio clips simultaneously), I'm wondering how to solve this problem. The problem exists on Windows whether on the Editor or not, and the FPS is OK when the problem happened.

Sorry for poor English.

The expected performance is playing many audio clips simultaneously fluently.


Solution

  • Okay... I've found the solution myself. Open Edit->Project Settings->Audio, and change the setting 'Max Real Voices' and 'Max Virtual Voices'.