返回介绍

AudioSettings.GetDSPBufferSize

发布于 2019-12-18 15:37:23 字数 2246 浏览 1099 评论 0 收藏 0

JavaScript => public static function GetDSPBufferSize(out bufferLength: int, out numBuffers: int): void;
C# => public static void GetDSPBufferSize(out int bufferLength, out int numBuffers);

Parameters 参数

bufferLengthIs the length of each buffer in the ringbuffer.
在环形缓冲器的每个缓冲器的长度。(我也不知道是啥)
numBuffersIs number of buffers.

Description 描述

Get the mixer's buffer size in samples.

For mobiles (iOS devices and Android) the is also settable from the menu 'Audio Settings→Mobile DSP Buffer size'. The software mixer mixes to a ringbuffer. The size of this ringbuffer is determined here. It mixes a block of sound data every 'bufferlength' number of samples, and there are 'numbuffers' number of these blocks that make up the entire ringbuffer. Adjusting these values can lead to extremely low latency performance (smaller values), or greater stability in sound output (larger values). Warning! The 'buffersize' is generally best left alone. Making the granularity smaller will just increase CPU usage (cache misses and DSP network overhead). Making it larger affects how often you hear commands update such as volume/pitch/pan changes. Anything above 20ms will be noticable and sound parameter changes will be obvious instead of smooth. Unity chooses the most optimal size by default for best stability, depending on the output type, and if the drivers are emulated or not (for example DirectSound is emulated using waveOut on NT). It is not recommended changing this value unless you really need to. You may get worse performance than the default settings chosen by Unity. As of version 5.0 setting the DSP buffer size from scripts is no longer supported. This has to be set in the Audio section of the project settings instead.

AudioSettings

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文