版本
Before deciding on the playback behaviors for the objects in your project hierarchy, review the following sections. They provide tips and best practices that can help get the results you want.
Generally, the best practice is to stream sounds that are too large to store in memory, for example music, ambient room tones, and even voices, if there are many of them. 但决定哪个选项最适用时,需要考虑很多因素。
At the beginning of your project, we recommend that you speak to the development team to determine the following:
音频可以使用多少播放流?
每条播放流的带宽是多少?
这些播放流是否会共享?
可以同时使用多少播放流?
从哪里进行流播放?是平台硬盘、光盘,还是从远程服务器?
通过这些信息以及声音的采样率和压缩格式,您可以进行计算,然后就是否使用流播放声音做出决策。
The more streams you have playing concurrently, the more prefetch time will be required. You can start out using a short prefetch time, but as the number of concurrent streams increases over the course of your project, you might need to increase it.
将 Random Container(随机容器)范围设置为“Global”(全局)来避免声音重复 —— 使用 Random Container 的 Shuffle 模式进行连续播放,目的是为了避免声音重复。If, however, your container has a limited number of sounds and you have many instances of this container playing back, you might experience some repetition. 要避免这样的现象,请确保该容器内声音对象的数量至少为播放实例数量的两倍。For example, if you have three playback instances of the same Random Container, we recommend that your Container contain at least six different sound objects to avoid repetition.
CPU usage: be aware that when you play a Blend Container, all the objects in it will play simultaneously and can therefore use up a large amount of memory. You can use the virtual voices settings to reduce CPU use, but this might result in glitches if crossfades are short and frequent. 有关使用虚声部的详细信息,请参阅 “Volume threshold and virtual voices”一节。
Deciding between Switches and Blend Containers: during gameplay, both Switch Containers and Blend Containers can be used with RTPCs and produce similar results. According to your requirements, consider the following:
如果您希望在不同时间播放不同的对象,而且不需要交叉淡变,那么请使用切换容器。
如果希望一直播放所有对象,而且需要交叉淡变,则应使用混合容器。