VR系列——Oculus Audio sdk文档:六、FMOD Oculus Spatializer集成指南(2)——如何使用FMOD Studio

如何使用FMOD Studio(How to Use in FMOD Studio)

  1. 创建一个事件(Create a new event)


    这里写图片描述

  2. 选择主轨道(Select the master track)


    这里写图片描述

  3. 删除3D panner(Delete the 3D panner)


    这里写图片描述

  4. 加入Oculus Spatializer插件(Add the Oculus Spatializer plugin)


    这里写图片描述


笔记和最佳实践(Notes and Best Practices)


这里写图片描述

  多达64个声线贯穿总线会被空间化。
  Up to 64 sounds running through the bus may be spatialized.

  确保你的项目在FMOD Studio中的输出格式设置为立体声 (Edit→Preferences→Format→Stereo)。
  Make sure that your Project Output Format is set to stereo in FMOD Studio (Edit→Preferences→Format→Stereo).

  请注意,这个理论室是用于计算反射遵循听者的位置并以听者的方向旋转。早期反思的未来实施将会允许听者在一个静止的房间自由走动。
  Note that the theoretical room used to calculate reflections follows the listener’s position and rotates with the listener’s orientation. Future implementation of early reflections will allow for the listener to freely walk around a static room.

  当使用早期反射时,一定要设置非对称的空间维度。一个完美的立方体房间可以重新执行回声这会导致声音被差劲的空间化。房间大小应大致匹配游戏中房间的大小,因为游戏中音频会强化视觉效果。鞋盒模型模拟房间效果最好。对于大空间和室外区域,它是一个值得被称赞的单独的混响。
  When using early reflections, be sure to set non-symmetrical room dimensions. A perfectly cubical room may create re-enforcing echoes that can cause sounds to be poorly spatialized. The room size should roughly match the size of the room in the game so the audio reinforces the visuals. The shoebox model works best when simulating rooms. For large spaces and outdoor areas, it should be complimented with a separate reverb.

参数

声音的特性
Sound Properties
选择单声道声音和/或设置主声道输入格式为单声道(通过右键点击左侧的计量栏)。
Prefer mono sounds and/or set the master track input format to mono (by right-clicking on the metering bars on the left side).
衰减
Attenuation
使内部距离衰减模型。如果被禁用,您可以使用一个距离参数的体积自动化创建自定义衰减曲线。
Enables the internal distance attenuation model. If attenuation is disabled, you can create a custom attenuation curve using a volume automation on a distance parameter.
最大范围
Range Max
距离衰减和反射的最大距离。
Maximum range for distance attenuation and reflections.
最小范围
Range Min
最小距离衰减和反射范围。
Minimum range for distance attenuation and reflections.
禁用回声
Disable Reflections
如果设置为真,这个声音实例将不计算反射/混响。把这用于声音,不需要启用反射。反射占用额外的处理器,所以这是一个很好的方式来降低整体音频处理器成本。注意,如果反射在全球范围内的OSP FMOD API被禁用,此设置将不起作用。
If set to true, this sound instance will not calculate reflections/reverberation. Use this for sounds that do not need to have reflections enabled. Reflections take up extra CPU, so this is a good way to reduce the overall audio CPU cost. Note that if reflections are disabled globally with OSP FMOD API, this setting will have no effect.

在应用中整合Oculus Spatializer(Integrating the Oculus Spatializer in the Application)

  这部分是为程序员在应用程序代码库中结合FMOD运行库和插件注册。
  This section is for programmers who are integrating FMOD runtime libraries and plugin registration within their application code base.

  1. 把OculusFMODSpatializersettings .h列入到你的项目中。
  2. 复制ovrfmod.dll(Windows)或libovrfmod.dylib(OS X)到你的应用程序目录下。
  3. 链接项目到ovrfmod.lib。
  1. Include the OculusFMODSpatializerSettings.h in your project.
  2. Copy ovrfmod.dll (Windows) or libovrfmod.dylib (OS X) to your application directory.
  3. Link project to ovrfmod.lib.

在应用程序启动(At application start up)

  1. 调用OSP_FMOD_Initialize时使用getdspbuffersize和getsoftwareformat作为参数。
  2. 为了回声调用OSP_FMOD_SetSimpleBoxRoomParameters配置房间大小。
  3. 在加载任何堆之前调用FMOD::System::loadPlugin注册FMOD插件。


  1. Call OSP_FMOD_Initialize. Use getDSPBufferSize and getSoftwareFormat for the parameters.
  2. Call OSP_FMOD_SetSimpleBoxRoomParameters to configure the room size for reflections.
  3. Call the FMOD::System::loadPlugin to register the plugin with FMOD before loading any banks.


    启动代码示例:Windows 32位应用程序(Start up code example: Windows 32-bit application)

    FMOD::Studio::System* system;
    ERRCHECK( FMOD::Studio::System::create(&system) );
    
    FMOD::System* lowLevelSystem;
    ERRCHECK( system->getLowLevelSystem(&lowLevelSystem) );
    
    int sampleRate = 0;
    ERRCHECK(lowLevelSystem->getSoftwareFormat(&rate, NULL, NULL));
    
    unsigned int bufferSize = 0;
    ERRCHECK(lowLevelSystem->getDSPBufferSize(&bufferSize, NULL));
    
    OSP_FMOD_Initialize(sampleRate, bufferSize);
    OSP_FMOD_SetSimpleBoxRoomParameters(5.0f, 2.1f, 3.7f, 0.75f, 0.65f, 0.55f, 0.25f, 0.65f, 0.65f);
    
    ERRCHECK( system->initialize(32, FMOD_STUDIO_INIT_NORMAL, FMOD_INIT_NORMAL, extraDriverData) );
    
    ERRCHECK( lowLevelSystem->loadPlugin("ovrfmod.dll", NULL) );

    OSP FMOD相关接口(OSP FMOD API)

    OSP_FMOD_Initialize初始化插件。用来指定样本率和块大小。
    Initializes the plugin. Use this to specify the sample rate and block size.
    OSP_FMOD_SetEarlyReflectionsEnabled根据空间大小启用前期反射。能够动态切换,但在转换过程中可能会出现轻微的故障。默认是关闭状态。
    Enables early reflection, based on the room size. This may be toggled dynamically, but a slight hitch in performance may occur during the transition. Default is off.
    OSP_FMOD_SetLateReverberationEnabled根据空间大小启用后期反射。能够动态切换,但在转换过程中可能会出现轻微的故障。默认是关闭状态。Enables late reverberations, based on room size. This may be toggled dynamically, but a slight hitch in performance may occur during the transition. Default is off.
    :要让后期反射起作用,前期反射也必须启用。
    Note: Early reflections must also be enabled for this to work
    OSP_FMOD_SetGlobalScale将游戏单元中的比例系数设置为米。例如,如果游戏单元的单位为“英尺”,则全局比例为0.3048。默认值为1。
    Sets the scaling factor meters to game units. For example, if the game units are described in feet, the global scale would be 0.3048. Default value is 1.0.
    OSP_FMOD_SetSimpleBoxRoomParameters设置反射空间大小。以米为单位,默认为8x3x5。
    Sets the size of the room for reflections. Size is in meters, default is 8x3x5.
    反射: 0.0 =完全消声(即无反射),1.0=完全反射,但我们上限值为0.95。默认值为0.25。
    Reflections: 0.0 = fully anechoic (i.e., no reflection), 1.0 = fully reflective, but we cap at 0.95. Default is 0.25.
    适当更新应用使得侦听器和声源可正常使用,在OSP总线上进行声源设置,将获得更佳的3D表现感。
    Provided that the listener and sounds are properly updated within the application, sounds set to the OSP bus will have a greater sense of 3D presence.
    OSP_FMOD_SetBypass绕过所有的声音处理。
    Bypasses all processing for all sounds.
    OSP_FMOD_SetGain为所有的声音设置全局增益。
    Sets the global gain for all sounds.
    • 0
      点赞
    • 0
      收藏
      觉得还不错? 一键收藏
    • 0
      评论

    “相关推荐”对你有帮助么?

    • 非常没帮助
    • 没帮助
    • 一般
    • 有帮助
    • 非常有帮助
    提交
    评论
    添加红包

    请填写红包祝福语或标题

    红包个数最小为10个

    红包金额最低5元

    当前余额3.43前往充值 >
    需支付:10.00
    成就一亿技术人!
    领取后你会自动成为博主和红包主的粉丝 规则
    hope_wisdom
    发出的红包
    实付
    使用余额支付
    点击重新获取
    扫码支付
    钱包余额 0

    抵扣说明:

    1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
    2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

    余额充值