( Applies to Wwise 2011.1 and later )
When working with voice limitation system, it is good to know the following:
-
Virtual voices do not count as valid voices.
-
Sounds with the virtual voice setting set to “Continue to play” may cause the limit to be exceeded.
For example, let us suppose you have:
-
A limit on bus set to 4 simultaneous sounds.
-
The “Over limit behavior” on this bus is set to “Use virtual voice behavior”.
-
The Volume threshold is set to -60dB.
-
You have 8 voices playing at this frame in this bus.
|
Sound name |
Priority |
Volume |
Virtual Behavior |
|---|---|---|---|
|
Sound_1 |
100 |
0 dB |
Go Virtual |
|
Sound_2 |
90 |
-90 dB |
Go Virtual |
|
Sound_3 |
80 |
-90 dB |
Continue to play |
|
Sound_4 |
70 |
0 dB |
Go Virtual |
|
Sound_5 |
60 |
0 dB |
Kill voice |
|
Sound_6 |
50 |
0 dB |
Kill voice |
|
Sound_7 |
40 |
0 dB |
Go Virtual |
|
Sound_8 |
30 |
0 dB |
Continue to play |
The result would be:
|
Sound name |
Result |
Reason |
|---|---|---|
|
Sound_1 |
Play (1/4) |
Highest priority and over volume threshold. |
|
Sound_2 |
Will go virtual |
Volume under threshold. |
|
Sound_3 |
Play (2/4) |
Continues to play even when under volume threshold. |
|
Sound_4 |
Play (3/4) |
- |
|
Sound_5 |
Play (4/4) |
- |
|
Sound_6 |
Will be killed |
Over limit, already 4 sounds with higher priority are playing |
|
Sound_7 |
Will go virtual |
Over limit, already 4 sounds with higher priority are playing |
|
Sound_8 |
Play (5/4)* |
*Will play even if the limit is exceeded, this is a special situation where this sound is not allowed to go virtual nor be killed, and is not allowed to take over the 4 sounds already playing with a higher priority. |
FAQ
Q:
The limit does not seem to be working? Why?
A:
Check if the sound’s virtual behavior is not set to “Continue to play”, it is the default value for compatibility reasons. Any sound with this setting will not be kicked nor virtualized when over the limit (unless the over limit behavior was set to kill voice explicitly). Once you start using the “Use Virtual Voice settings” when over the limit, you must set this setting for any sound that would be considered “kickable” or “virtualizable” to start saving some CPU.
Q:
The limit seems to be working most of the time but the profiler sometimes shows values that are over the specified limit even if none of these sounds are set to “Continue to play”.
A:
When sounds are becoming virtual, they stay active for a few ms (one audio frame) to fade out and avoid clicking. For example, if the limit is set to 1 and one sound is already playing, then another sound pops in with a higher priority, the number of active voice will temporarily be to 2 while the first sound is fading out to go virtual.
Q:
Why sending to virtual voices is not the default setting when over limit? Why are all sounds set to continue to play by default?
A:
Some source codec may not be perfectly accurate in virtual mode and/or could require a seek table to be added in the source to be able to work in virtual voice: play from elapsed time. For this reason and to ensure that everything runs fine by default, this is not the default setting. For example, Vorbis will require a seek table to be able to properly adopt a virtual behavior with the From Elapsed time setting.