API reference

FMODPluginInterface Class

Fields

Name of the binary this interface wraps.
This value can be used in [DllImport(binaryName)] decorators and tells Unity what the binary name is for the FMOD plug-in.

Properties

IntPtr context[Get]

Member Functions

Get the handle to the current context, creating one if necessary.
Note that Unity's editor, player, and standalone builds will have different contexts.
Parameters
context
The returned handle to the context.
Returns
Returns an ovrResult indicating success or failure.
Set global shoebox room reverberation parameters.
These parameters are used for reverberation/early reflections if SIMPLE_ROOM_MODELING is enabled. If SIMPLE_ROOM_MODELING is disabled, these values can still be specified and will be cached. Upon enabling room modelling, the cached values will be applied.Note, it's easiest to the MetaXRAudioRoomAcousticProperties MonoBehavior instead of calling this function directly.
Parameters
widthheightdepth
Dimensions of shoebox room in meters. Should be > 0.
lockToListenerPosition
If true, room is centered on listener. If false, room center is specified by RoomPosition coordinates
position
Desired position of room's origin which is in the center of the room. Ignored if lockToListenerPosition is true.
wallMaterials
Reflection coefficients (in the range of [0.0, 1.0f]) for room materials for each wall. It is a packed array the refletion coefficients for the right, left, ceiling, floor, front and back walls in that order, each wall having 4 frequency-dependent reflection coefficients in order of increasing frequency.
Returns
ovrResult indicating success (0) or failure (1)
Sets the clutter factor for the global room simulation.
This parameter is meant to simulate effect furniture and other objects have on reverberation. Higher values simulate more furniture and other objects in the room and reduce the T60 of the reverberator (moreso in the higher frequencies than the low). Lower values simulate an emptier room.
Parameters
clutterFactor
An array of clutter values for each audio band, [0,1]. 0.0 represents an empty room for that frequency and 1.0 is the maximum T60 reduction for that band.
Returns
Returns an ovrResult indicating success or failure
Set the level of the global reverb.
Sets the linear gain applied to the output of the reverberation. Lower values effectively make all objects drier.
Parameters
linearLevel
Linear gain to be applied to the output of the reverberator. In the range of [0,+Inf)
Returns
ovrResult indicating success (0) or failure (1)
Enable/disable options in the audio context.
Parameters
feature
Meta::XR::Audio::EnableFlag specifying which feature to enable/disable.
enabled
If true, enable the specified feature. If false, disable the specified feature.
Returns
Returns an ovrResult indicating success or failure
int SetEnabled
( EnableFlag feature,
bool enabled )
Set the number of dynamic rays cast per second.
More rays mean more accurate and responsive modelling but at the expense of increased CPU usage.
Parameters
RaysPerSecond
The number of rays cast per second. [0,8192], Default = 256
Returns
Returns an ovrResult indicating success or failure
Set the interpolation speed of the dynamic room model.
Higher values will cause the reverb to update more quickly but less smoothly.
Parameters
InterpSpeed
The speed with which to interpolate between the old and new dynamic room model. [0, 1.0], Default = 0.9
Returns
Returns an ovrResult indicating success or failure.
Set the maximum distance a cast ray can travel in a dynamic simulation.
Larger values allows one to simulate larger rooms but unnecessarily increases CPU usage for smaller rooms.
Parameters
MaxWallDistance
Max distance, in meters, a project ray can travel before being ignored. [0, 250], Default = 50
Returns
Returns an ovrResult indicating success or failure.
Set the size of the cache that holds the history of cast rays.
A larger value will mean reverb parameters are calculated using more rays/samples (and thus the simulation will be more stable) at the expense of making the reverb less responsive to geometry changes and increasing runtime memory usage.
Parameters
RayCacheSize
The number of rays held in the cache. [64,8192], Default = 512
Returns
Returns an ovrResult indicating success or failure.
Get the current dimensions, reflection coefficients and position of the shoebox room.
Note, it's easiest to the MetaXRAudioRoomAcousticProperties MonoBehavior instead of calling this function directly.
Parameters
roomDimensions
The dimensions of the shoebox room in meters. [Width, Height, Depth]
reflectionsCoefs
The reflection coefficients of the shoebox room. [Left, Right, Up, Down, Front Back], each being 4-vector of frequency-dependent reflection coefficients from lowest to highest frequency
position
The position of the shoebox room in Unity world space coordinates. [X,Y,Z]
Returns
Returns an ovrResult indicating success or failure.
Retrieves the cache of ray cast hits that are being used to estimate the room.
This is useful for debugging/visualization.
Parameters
points
Array of 3D positions where rays were found to intersect scene geoemtry. The length of this array will be equal to the size of the cache.
normals
Array of 3D normal vectors corresponding to the intersections listed in points
length
Corresponding length of the rays that originate at the listener and terminate at the intersections listed in points.
Returns
Returns an ovrResult indicating success or failure
Did you find this page helpful?
Thumbs up icon
Thumbs down icon