Home > Software design >  Unity play too many audio clips at the same time
Unity play too many audio clips at the same time

Time:01-10

I'm making a rhythm game, and I use 'AudioSource.PlayOneShot()' function to play the hit sound when the player hit the note. And I downloaded a beatmap from Osu!Mania to test my game. I found when there's too many audio clips playing at the same time(20 audio clips or more per second), the audio output becomes stuttered, disorder, and most of the time the audio clips played earlier will temporarily lose sound until the number of simultaneous audio is cut down to a certain amount... It's common in difficult levels of rhythm games (play many audio clips at the same time), 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.

I have no idea about solving this problem and found nothing on the Internet... The expected performance is playing many audio clips at the same time fluently.

CodePudding user response:

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

  • Related