您的位置:首页 > 移动开发 > Unity3D

VR系列——Oculus Audio sdk文档:三、Oculus对于Unity天然的声场定位技术(3)——空间定位的应用

2016-11-21 10:04 686 查看
  在Assets/OSPNative/script里发现的辅助脚本ONSPAudioSource.cs,安装到一个AudioSource。该脚本可以访问Oculus Native Spatializer所需的扩展参数。请注意,如果空间定位在音频源上启用,那么本机到一个AudioSource所有参数仍然可用,但可以不使用一些值。

  Attach the helper script ONSPAudioSource.cs, found in Assets/OSPNative/scripts, to an AudioSource. This script accesses the extended parameters required by the Oculus Native Spatializer. Note that all parameters native to an AudioSource are still available, though some values may not be used if spatialization is enabled on the audio source.

  在这个例子中,我们可以在‘红球绿球’示例中看见绿球上附加的脚本:

  In this example, we look at the script attached to the green sphere in our sample RedBallGreenBall:



OculusSpatializer用户参数属性(OculusSpatializerUserParams Properties)

启动空间定位(Enable Spatialization)
实际上,对于空间定位省略按钮。一旦禁用,则连接的音频源将不支持空间定位。此设置链接到音源扩展面板的相应参数(在上述捕获中隐藏)。

Effectively, a bypass button for spatialization. If disabled, the attached Audio Source will act as a native audio source without spatialization. This setting is linked to the corresponding parameter in the Audio Source expandable pane (collapsed in the above capture).
禁用反射(Disable Reflections)
选择禁用早期反射和空间环绕音频的混响。要使用早期反射和混响,则必须取消选择此值,并且添加OculusSpatializerReflection插件到当你在音频调音台发送AudioSource时的信道中。请参见下面的音频调音台设置更多的细节。

Select to disable early reflections and reverb for the spatialized audio source. To use early reflections and reverb, you must deselect this value and add an OculusSpatializerReflection plugin to the channel where you send the AudioSource in the Audio Mixer. See Audio Mixer Setup below for more details.
增加(Gain)
增加了高达24 dB的增益到音频源音量(单位为dB),等于0单位增益。

Adds up to 24 dB gain to audio source volume (in db), with 0 equal to unity gain.

平方反比衰减设置(Inverse Square Attenuation Settings)

启动(Enable)
如果选中,音频源将使用由近及远的参数控制的内部衰减曲线。如果取消,衰减将音源观察面板中的统一音量曲线控制。

If selected, the audio source will use an internal attenuation falloff curve controlled by the Near and Far parameters. If deselected, the attenuation falloff will be controlled by the authored Unity Volume curve within the Audio Source Inspector panel.

注意:我们强烈建议启用内部衰减来得到空间定位更精细的呈现。内部曲线匹配所有的干音衰减,以及早期反射和混响如何被模型化。

Note: We strongly recommend enabling internal attenuation falloff for a more accurate rendering of spatialization. The internal curves match both the way the direct audio falloff as well as how the early reflections and reverbs are modelled.
衰减近(Falloff Near)
设置该音频源开始衰减的节点,以米为单位。内部反平方衰减是否已启用,也影响反射/混响系统。当听者距离声源较近时,较大的值会导致不太明显的衰减。

Sets the point at which the audio source starts attenuating, in meters. It also influences the reflection/reverb system, whether or not internal inverse square attenuation is enabled. Larger values will result in less noticeable attenuation when the listener is near the sound source.
衰减远(Falloff
b396
Far)
设置该音频源满音量的节点,以米为单位。内部反平方衰减是否已启用,也影响反射/混响系统。较大的值使我们可以从远处听到“响亮”的声音。

Sets the point at which the audio source reaches full volume attenuation, in meters. It also influences the reflection/reverb system, whether or not internal inverse square attenuation is enabled. Larger values allow for “loud” sounds that can be heard from a distance.

音频调音台安装(Audio Mixer Setup)

  注意:在Unity术语里,组(group)是和信道(channel)大致相同的意思。在本章节中,我们使用术语互换。

  Note: In Unity’s terminology, group is roughly the same as channel. In this section, we use the terms interchangeably.

  Unity5 包含了一个灵活的混频器架构来发送音频源。混频器可以让音响工程师添加多个通道,每个都有自己的音量和加工链,并可设置音频源到该通道。有关详细信息,请参见Unity混频器文档章节。

  Unity 5 includes a flexible mixer architecture for routing audio sources. A mixer allows the audio engineer to add multiple channels, each with their own volume and processing chain, and set an audio source to that channel. For detailed information, see Unity’s Mixer documentation.

共享反射/混响(Shared Reflection/Reverb)

  为了让我们的Oculus Spatializer内的共享反射/混响系统许可,你必须创建一个混音通道,并添加OculusSpatializerReflection到该通道。

  To allow for a shared reflection/reverb system within our Oculus Spatializer, you must create a mixer channel and add the OculusSpatializerReflection effect to that channel.

在你的项目视图中选择‘音频混音器’选项卡

在检查窗口选择‘添加效果’

选择OculusSpatializerReflection

你连接的音频源输出设置为Master(空间定位调音台)

设置反射/回响设置以影响空间化的声音

Select the Audio Mixer tab in your Project View.

Select Add Effect in the Inspector window.

Select OculusSpatializerReflection.

Set the Output of your attached Audio Source to Master (SpatializerMixer).

Set reflection/reverberation settings to globally affect spatialized voices.



表1:混音器设置(Mixer Settings)
早期的反射(Early Refl. On)
选择启用早期的反射系统。

Select to enable the early reflection system.
混响功能(Reverb On)
选择启用全局混响。需要启用早起的反射系统。如果空间大小 X/Y/Z或壁反射值参数改变了,混响必须打开,然后再次关闭,以使更改生效(这避免了返工)。

Select to enable global reverb. Requires early reflection (Early Refl. On) to be enabled. If Room Size X/Y/Z or Wall Reflection Values parameters are changed, reverb must be turned on and off again for the changes to take effect (this avoids hitching artifacts).
空间 X/Y/Z(Room X/Y/Z)
设置虚拟房间的尺寸,以米为单位,用来计算反射值。尺寸越大,反射将更远,范围:0 – 200米。

Sets the dimensions of the theoretical room used to calculate reflections, in meters. The greater the dimensions, the further apart the reflections. Range: 0 - 200 m.
壁反射值(Wall Reflection Values)
设置声音在每个墙壁反射的百分比。当为0时,声音完全被吸收。当为1时,声音完全被反射回来没有任何吸收。设置0.97上限来避免反馈。

Sets the percentage of sound reflected by each respective wall. At 0, the reflection is fully absorbed. At 1.0, the reflection bounces from the wall without any absorption. Caps at 0.97 to avoid feedback.
全局比例值(1单位 = 1米)(Global Scale
(1 unit = 1 m))
送入空间定位的位置值的比例单位必须为米,有些应用程序对一个单位有不同的标尺,对于这样的应用,使用该字段来调整空间定位的标尺。Unity默认为每单位1米。

The scale of positional values fed into the spatializer must be set to meters. Some applications have different scale values assigned to a unit. For such applications, use this field to adjust the scale for the spatializer. Unity defaults to 1 meter per unit.

例如:一个单位设置为等于1cm的应用程序,则全局比例值设定为0.01(1毫升=100米)。

Example: for an application with unit set to equal 1 cm, set the Global Scale value to 0.01 (1 cm = 100 m).

RedBallGreenBall示例(RedBallGreenBall Example)

  为了观察RedBallGreenBall是如何工作的,在你的项目视图中,通过选择音频混合器选项卡跳转到音频混合器页面。然后如下图展示的在组中选择Master。

  To see how this works in RedBallGreenBall, access the Audio Mixer by selecting the Audio Mixer tab in your Project View. Then select Master under Groups as shown below.



  在你的场景中选择绿球,需要注意的是所附的音源声道1是被设置输出到我们的Master(声场定位技术混合器):

  Select the green sphere in your Scene View. Note that the Output of the attached Audio Source vocal1 is set to our Master (SpatializerMixer):



  现在你可以设置反射/混响的配置,在全局内影响空间化的声音。

  You can now set reflection/reverberation settings to globally affect spatialized voices.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐