Audio v47 Reference Guide

OVR_Audio.h File

OVR Audio SDK public header file.

Overview

Macros

#define
OVR_RESULT_DEFINED
#define
OVR_SUCCESS_DEFINED
#define
ovrSuccess
#define
OVR_AUDIO_MAJOR_VERSION
#define
OVR_AUDIO_MINOR_VERSION
#define
OVR_AUDIO_PATCH_VERSION

Enumerations

enum
enum
enum
enum
enum
enum
enum
enum
enum
enum
enum
ovrAudioMaterialPreset {
ovrAudioMaterialPreset.ovrAudioMaterialPreset_AcousticTile ,
ovrAudioMaterialPreset.ovrAudioMaterialPreset_Brick ,
ovrAudioMaterialPreset.ovrAudioMaterialPreset_BrickPainted ,
ovrAudioMaterialPreset.ovrAudioMaterialPreset_Carpet ,
ovrAudioMaterialPreset.ovrAudioMaterialPreset_CarpetHeavy ,
ovrAudioMaterialPreset.ovrAudioMaterialPreset_CarpetHeavyPadded ,
ovrAudioMaterialPreset.ovrAudioMaterialPreset_CeramicTile ,
ovrAudioMaterialPreset.ovrAudioMaterialPreset_Concrete ,
ovrAudioMaterialPreset.ovrAudioMaterialPreset_ConcreteRough ,
ovrAudioMaterialPreset.ovrAudioMaterialPreset_ConcreteBlock ,
ovrAudioMaterialPreset.ovrAudioMaterialPreset_ConcreteBlockPainted ,
ovrAudioMaterialPreset.ovrAudioMaterialPreset_Curtain ,
ovrAudioMaterialPreset.ovrAudioMaterialPreset_Foliage ,
ovrAudioMaterialPreset.ovrAudioMaterialPreset_Glass ,
ovrAudioMaterialPreset.ovrAudioMaterialPreset_GlassHeavy ,
ovrAudioMaterialPreset.ovrAudioMaterialPreset_Grass ,
ovrAudioMaterialPreset.ovrAudioMaterialPreset_Gravel ,
ovrAudioMaterialPreset.ovrAudioMaterialPreset_GypsumBoard ,
ovrAudioMaterialPreset.ovrAudioMaterialPreset_PlasterOnBrick ,
ovrAudioMaterialPreset.ovrAudioMaterialPreset_PlasterOnConcreteBlock ,
ovrAudioMaterialPreset.ovrAudioMaterialPreset_Soil ,
ovrAudioMaterialPreset.ovrAudioMaterialPreset_SoundProof ,
ovrAudioMaterialPreset.ovrAudioMaterialPreset_Snow ,
ovrAudioMaterialPreset.ovrAudioMaterialPreset_Steel ,
ovrAudioMaterialPreset.ovrAudioMaterialPreset_Water ,
ovrAudioMaterialPreset.ovrAudioMaterialPreset_WoodThin ,
ovrAudioMaterialPreset.ovrAudioMaterialPreset_WoodThick ,
ovrAudioMaterialPreset.ovrAudioMaterialPreset_WoodFloor ,
ovrAudioMaterialPreset.ovrAudioMaterialPreset_WoodOnConcrete ,
ovrAudioMaterialPreset.ovrAudioMaterialPreset_COUNT
}

Typedefs

int32_t
struct ovrPosef_
struct ovrPoseStatef_
struct ovrAudioSource_
struct ovrAudioContext_ *
struct ovrAudioAmbisonicStream_ *
void *

Functions

ovrResult
void
OVRA_EXPORT const char *
ovrAudio_GetVersion ( int * Major, int * Minor, int * Patch )
OVRA_EXPORT float *
ovrAudio_AllocSamples ( int NumSamples )
OVRA_EXPORT void
ovrAudio_FreeSamples ( float * Samples )
OVRA_EXPORT ovrResult
ovrAudio_CreateContext ( ovrAudioContext * pContext, const ovrAudioContextConfiguration * pConfig )
OVRA_EXPORT ovrResult
ovrAudio_InitializeContext ( ovrAudioContext Context, const ovrAudioContextConfiguration * pConfig )
OVRA_EXPORT void
ovrAudio_DestroyContext ( ovrAudioContext Context )
OVRA_EXPORT ovrResult
ovrAudio_Enable ( ovrAudioContext Context, ovrAudioEnable What, int Enable )
OVRA_EXPORT ovrResult
ovrAudio_IsEnabled ( ovrAudioContext Context, ovrAudioEnable What, int * pEnabled )
OVRA_EXPORT ovrResult
ovrAudio_SetUnitScale ( ovrAudioContext Context, float UnitScale )
OVRA_EXPORT ovrResult
ovrAudio_GetUnitScale ( ovrAudioContext Context, float * UnitScale )
OVRA_EXPORT ovrResult
ovrAudio_SetSimpleBoxRoomParameters ( ovrAudioContext Context, const ovrAudioBoxRoomParameters * Parameters )
OVRA_EXPORT ovrResult
ovrAudio_GetSimpleBoxRoomParameters ( ovrAudioContext Context, ovrAudioBoxRoomParameters * Parameters )
OVRA_EXPORT ovrResult
ovrAudio_SetAdvancedBoxRoomParameters ( ovrAudioContext Context, const ovrAudioAdvancedBoxRoomParameters * Parameters )
OVRA_EXPORT ovrResult
OVRA_EXPORT ovrResult
ovrAudio_SetListenerVectors ( ovrAudioContext Context, float PositionX, float PositionY, float PositionZ, float ForwardX, float ForwardY, float ForwardZ, float UpX, float UpY, float UpZ )
OVRA_EXPORT ovrResult
ovrAudio_GetListenerVectors ( ovrAudioContext Context, float * pPositionX, float * pPositionY, float * pPositionZ, float * pForwardX, float * pForwardY, float * pForwardZ, float * pUpX, float * pUpY, float * pUpZ )
OVRA_EXPORT ovrResult
ovrAudio_ResetAudioSource ( ovrAudioContext Context, int Sound )
OVRA_EXPORT ovrResult
ovrAudio_SetAudioSourcePos ( ovrAudioContext Context, int Sound, float X, float Y, float Z )
OVRA_EXPORT ovrResult
ovrAudio_GetAudioSourcePos ( ovrAudioContext Context, int Sound, float * pX, float * pY, float * pZ )
OVRA_EXPORT ovrResult
ovrAudio_SetAudioSourceRange ( ovrAudioContext Context, int Sound, float RangeMin, float RangeMax )
OVRA_EXPORT ovrResult
ovrAudio_GetAudioSourceRange ( ovrAudioContext Context, int Sound, float * pRangeMin, float * pRangeMax )
OVRA_EXPORT ovrResult
ovrAudio_SetAudioSourceRadius ( ovrAudioContext Context, int Sound, float Radius )
OVRA_EXPORT ovrResult
ovrAudio_GetAudioSourceRadius ( ovrAudioContext Context, int Sound, float * pRadius )
OVRA_EXPORT ovrResult
ovrAudio_SetAudioHrtfIntensity ( ovrAudioContext Context, int Sound, float Intensity )
OVRA_EXPORT ovrResult
ovrAudio_GetAudioHrtfIntensity ( ovrAudioContext Context, int Sound, float * pIntensity )
OVRA_EXPORT ovrResult
ovrAudio_SetAudioReflectionsSendLevel ( ovrAudioContext Context, int Sound, float Level )
OVRA_EXPORT ovrResult
ovrAudio_GetAudioReflectionsSendLevel ( ovrAudioContext Context, int Sound, float * pLevel )
OVRA_EXPORT ovrResult
ovrAudio_SetAudioReverbSendLevel ( ovrAudioContext Context, int Sound, float Level )
OVRA_EXPORT ovrResult
ovrAudio_GetAudioReverbSendLevel ( ovrAudioContext Context, int Sound, float * pLevel )
OVRA_EXPORT ovrResult
ovrAudio_SetAudioSourceFlags ( ovrAudioContext Context, int Sound, uint32_t Flags )
OVRA_EXPORT ovrResult
ovrAudio_GetAudioSourceFlags ( ovrAudioContext Context, int Sound, uint32_t * pFlags )
OVRA_EXPORT ovrResult
ovrAudio_SetAudioSourceAttenuationMode ( ovrAudioContext Context, int Sound, ovrAudioSourceAttenuationMode Mode, float SourceGain )
OVRA_EXPORT ovrResult
ovrAudio_GetAudioSourceAttenuationMode ( ovrAudioContext Context, int Sound, ovrAudioSourceAttenuationMode * pMode, float * pSourceGain )
OVRA_EXPORT ovrResult
ovrAudio_GetAudioSourceOverallGain ( ovrAudioContext Context, int Sound, float * Gain )
OVRA_EXPORT ovrResult
ovrAudio_SpatializeMonoSourceInterleaved ( ovrAudioContext Context, int Sound, uint32_t * OutStatus, float * Dst, const float * Src )
OVRA_EXPORT ovrResult
ovrAudio_SpatializeMonoSourceLR ( ovrAudioContext Context, int Sound, uint32_t * OutStatus, float * DstLeft, float * DstRight, const float * Src )
OVRA_EXPORT ovrResult
ovrAudio_MixInSharedReverbLR ( ovrAudioContext Context, uint32_t * OutStatus, float * DstLeft, float * DstRight )
OVRA_EXPORT ovrResult
ovrAudio_MixInSharedReverbInterleaved ( ovrAudioContext Context, uint32_t * OutStatus, float * DstInterleaved )
OVRA_EXPORT ovrResult
ovrAudio_SetSharedReverbWetLevel ( ovrAudioContext Context, const float Level )
OVRA_EXPORT ovrResult
ovrAudio_GetSharedReverbWetLevel ( ovrAudioContext Context, float * Level )
OVRA_EXPORT ovrResult
ovrAudio_SetHeadRadius ( ovrAudioContext Context, float HeadRadius )
OVRA_EXPORT ovrResult
ovrAudio_GetHeadRadius ( ovrAudioContext Context, float * HeadRadius )
OVRA_EXPORT ovrResult
ovrAudio_GetPerformanceCounter ( ovrAudioContext Context, ovrAudioPerformanceCounter Counter, int64_t * Count, double * TimeMicroSeconds )
OVRA_EXPORT ovrResult
ovrAudio_ResetPerformanceCounter ( ovrAudioContext Context, ovrAudioPerformanceCounter Counter )
OVRA_EXPORT ovrResult
ovrAudio_ProcessQuadBinaural ( const float * ForwardLR, const float * RightLR, const float * BackLR, const float * LeftLR, float LookDirectionX, float LookDirectionY, float LookDirectionZ, int NumSamples, float * Dst )
OVRA_EXPORT ovrResult
ovrAudio_CreateAmbisonicStream ( ovrAudioContext Context, int SampleRate, int AudioBufferLength, ovrAudioAmbisonicFormat format, int ambisonicOrder, ovrAudioAmbisonicStream * pAmbisonicStream )
OVRA_EXPORT ovrResult
ovrAudio_ResetAmbisonicStream ( ovrAudioAmbisonicStream AmbisonicStream )
OVRA_EXPORT ovrResult
ovrAudio_DestroyAmbisonicStream ( ovrAudioAmbisonicStream AmbisonicStream )
OVRA_EXPORT ovrResult
ovrAudio_SetAmbisonicRenderMode ( ovrAudioAmbisonicStream AmbisonicStream, ovrAudioAmbisonicRenderMode Mode )
OVRA_EXPORT ovrResult
ovrAudio_GetAmbisonicRenderMode ( ovrAudioAmbisonicStream AmbisonicStream, ovrAudioAmbisonicRenderMode * Mode )
OVRA_EXPORT ovrResult
ovrAudio_MonoToAmbisonic ( const float * InMono, float DirectionX, float DirectionY, float DirectionZ, ovrAudioAmbisonicFormat Format, int AmbisonicOrder, float * OutAmbisonic, int NumSamples )
OVRA_EXPORT ovrResult
ovrAudio_ProcessAmbisonicStreamInterleaved ( ovrAudioContext Context, ovrAudioAmbisonicStream AmbisonicStream, const float * Src, float * Dst, int NumSamples )
OVRA_EXPORT ovrResult
ovrAudio_SetAmbisonicOrientation ( ovrAudioAmbisonicStream AmbisonicStream, float LookDirectionX, float LookDirectionY, float LookDirectionZ, float UpDirectionX, float UpDirectionY, float UpDirectionZ )
OVRA_EXPORT ovrResult
ovrAudio_GetAmbisonicOrientation ( ovrAudioAmbisonicStream AmbisonicStream, float * pLookDirectionX, float * pLookDirectionY, float * pLookDirectionZ, float * pUpDirectionX, float * pUpDirectionY, float * pUpDirectionZ )
OVRA_EXPORT ovrResult
ovrAudio_SetProfilerEnabled ( ovrAudioContext Context, int Enabled )
OVRA_EXPORT ovrResult
ovrAudio_SetProfilerPort ( ovrAudioContext , int Port )
OVRA_EXPORT ovrResult
ovrAudio_SetReflectionModel ( ovrAudioContext Context, ovrAudioReflectionModel Model )
OVRA_EXPORT ovrResult
ovrAudio_AssignRaycastCallback ( ovrAudioContext Context, OVRA_RAYCAST_CALLBACK Callback, void * pctx )
OVRA_EXPORT ovrResult
ovrAudio_SetDynamicRoomRaysPerSecond ( ovrAudioContext Context, int RaysPerSecond )
OVRA_EXPORT ovrResult
ovrAudio_SetDynamicRoomInterpSpeed ( ovrAudioContext Context, float InterpSpeed )
OVRA_EXPORT ovrResult
ovrAudio_SetDynamicRoomMaxWallDistance ( ovrAudioContext Context, float MaxWallDistance )
OVRA_EXPORT ovrResult
ovrAudio_SetDynamicRoomRaysRayCacheSize ( ovrAudioContext Context, int RayCacheSize )
OVRA_EXPORT ovrResult
ovrAudio_GetRoomDimensions ( ovrAudioContext Context, float RoomDimensions, float ReflectionsCoefs, ovrAudioVector3f * Position )
OVRA_EXPORT ovrResult
ovrAudio_GetRaycastHits ( ovrAudioContext Context, ovrAudioVector3f Points, ovrAudioVector3f Normals, int Length )
OVRA_EXPORT ovrResult
ovrAudio_SetPropagationQuality ( ovrAudioContext context, float quality )
OVRA_EXPORT ovrResult
ovrAudio_SetPropagationThreadAffinity ( ovrAudioContext context, uint64_t cpuMask )
OVRA_EXPORT ovrResult
ovrAudio_CreateAudioGeometry ( ovrAudioContext context, ovrAudioGeometry * geometry )
OVRA_EXPORT ovrResult
ovrAudio_DestroyAudioGeometry ( ovrAudioGeometry geometry )
OVRA_EXPORT ovrResult
ovrAudio_AudioGeometryUploadMesh ( ovrAudioGeometry geometry, const ovrAudioMesh * mesh )
OVRA_EXPORT ovrResult
ovrAudio_AudioGeometryUploadMeshArrays ( ovrAudioGeometry geometry, const void * vertices, size_t verticesByteOffset, size_t vertexCount, size_t vertexStride, ovrAudioScalarType vertexType, const void * indices, size_t indicesByteOffset, size_t indexCount, ovrAudioScalarType indexType, const ovrAudioMeshGroup * groups, size_t groupCount )
OVRA_EXPORT ovrResult
ovrAudio_AudioGeometrySetTransform ( ovrAudioGeometry geometry, const float matrix4x4 )
OVRA_EXPORT ovrResult
ovrAudio_AudioGeometryGetTransform ( const ovrAudioGeometry geometry, float matrix4x4 )
OVRA_EXPORT ovrResult
ovrAudio_AudioGeometryWriteMeshFile ( const ovrAudioGeometry geometry, const char * filePath )
OVRA_EXPORT ovrResult
ovrAudio_AudioGeometryReadMeshFile ( ovrAudioGeometry geometry, const char * filePath )
OVRA_EXPORT ovrResult
ovrAudio_AudioGeometryWriteMeshFileObj ( const ovrAudioGeometry geometry, const char * filePath )
OVRA_EXPORT ovrResult
ovrAudio_CreateAudioMaterial ( ovrAudioContext context, ovrAudioMaterial * material )
OVRA_EXPORT ovrResult
ovrAudio_DestroyAudioMaterial ( ovrAudioMaterial material )
OVRA_EXPORT ovrResult
ovrAudio_AudioMaterialSetFrequency ( ovrAudioMaterial material, ovrAudioMaterialProperty property, float frequency, float value )
OVRA_EXPORT ovrResult
ovrAudio_AudioMaterialGetFrequency ( const ovrAudioMaterial material, ovrAudioMaterialProperty property, float frequency, float * value )
OVRA_EXPORT ovrResult
ovrAudio_AudioMaterialReset ( ovrAudioMaterial material, ovrAudioMaterialProperty property )
OVRA_EXPORT ovrResult
ovrAudio_AudioGeometryWriteMeshData ( const ovrAudioGeometry geometry, const ovrAudioSerializer * serializer )
OVRA_EXPORT ovrResult
ovrAudio_AudioGeometryReadMeshData ( ovrAudioGeometry geometry, const ovrAudioSerializer * serializer )
ovrResult
ovrAudio_GetReflectionBands ( ovrAudioMaterialPreset Preset, AudioBands Bands )

Details

Macros

#define OVR_RESULT_DEFINED
Result type used by the OVRAudio API.
#define OVR_SUCCESS_DEFINED
Success is zero, while all error types are non-zero values.
#define ovrSuccess
No description available.
#define OVR_AUDIO_MAJOR_VERSION
No description available.
#define OVR_AUDIO_MINOR_VERSION
No description available.
#define OVR_AUDIO_PATCH_VERSION
No description available.

Member Enumerations

enum OVR_Audio.h.ovrAudioError
Enumerates error codes that can be returned by OVRAudio.
Enumerator
ovrError_AudioUnknown
An unknown error has occurred.
ovrError_AudioInvalidParam
An invalid parameter, e.g. NULL pointer or out of range variable, was passed.
ovrError_AudioBadSampleRate
An unsupported sample rate was declared.
ovrError_AudioMissingDLL
The DLL or shared library could not be found.
ovrError_AudioBadAlignment
Buffers did not meet 16b alignment requirements.
ovrError_AudioUninitialized
audio function called before initialization
ovrError_AudioHRTFInitFailure
HRTF provider initialization failed.
ovrError_AudioBadVersion
Mismatched versions between header and libs.
ovrError_AudioSymbolNotFound
Couldn't find a symbol in the DLL.
ovrError_SharedReverbDisabled
Late reverberation is disabled.
ovrError_AudioNoAvailableAmbisonicInstance
= 2017
ovrError_AudioMemoryAllocFailure
= 2018
ovrError_AudioUnsupportedFeature
Unsupported feature.
ovrError_AudioInternalEnd
Internal errors used by Audio SDK defined down towards public errors NOTE: Since we do not define a beginning range for Internal codes, make sure not to hard-code range checks (since that can vary based on build)
enum OVR_Audio.h.ovrAudioInitFlags
Audio context initialization flags.
Enumerator
ovrAudioInitFlag_Default
= 0x0000
ovrAudioInitFlag_ThreadUnsafe
= 0x0010
enum OVR_Audio.h.ovrAudioSourceFlag
Audio source flags.
Enumerator
ovrAudioSourceFlag_None
= 0x0000
ovrAudioSourceFlag_WideBand_HINT
Wide band signal (music, voice, noise, etc.)
ovrAudioSourceFlag_NarrowBand_HINT
Narrow band signal (pure waveforms, e.g sine)
ovrAudioSourceFlag_BassCompensation_DEPRECATED
Compensate for drop in bass from HRTF (deprecated)
ovrAudioSourceFlag_DirectTimeOfArrival
Time of arrival delay for the direct signal.
ovrAudioSourceFlag_ReflectionsDisabled
Disable reflections and reverb for a single AudioSource.
ovrAudioSourceFlag_DisableResampling_RESERVED
Disable resampling IR to output rate, INTERNAL USE ONLY.
enum OVR_Audio.h.ovrAudioSourceAttenuationMode
Audio source attenuation mode.
Enumerator
ovrAudioSourceAttenuationMode_None
Sound is not attenuated, e.g. middleware handles attenuation.
ovrAudioSourceAttenuationMode_Fixed
Sound has fixed attenuation (passed to ovrAudio_SetAudioSourceAttenuationMode)
ovrAudioSourceAttenuationMode_InverseSquare
Sound uses internally calculated attenuation based on inverse square.
ovrAudioSourceAttenuationMode_COUNT
enum OVR_Audio.h.ovrAudioEnable
Global boolean flags.
Enumerator
ovrAudioEnable_None
None.
ovrAudioEnable_SimpleRoomModeling
Enable/disable simple room modeling globally, default: disabled.
ovrAudioEnable_LateReverberation
Late reverbervation, requires simple room modeling enabled.
ovrAudioEnable_RandomizeReverb
Randomize reverbs to diminish artifacts. Default: enabled.
ovrAudioEnable_PerformanceCounters
Randomize reverbs to diminish artifacts. Default: enabled.
ovrAudioEnable_COUNT
enum OVR_Audio.h.ovrAudioReflectionModel
Explicit override to select reflection and reverb system.
Enumerator
ovrAudioReflectionModel_StaticShoeBox
Room controlled by ovrAudioBoxRoomParameters.
ovrAudioReflectionModel_DynamicRoomModeling
Room automatically calculated by raycasting using OVRA_RAYCAST_CALLBACK.
ovrAudioReflectionModel_PropagationSystem
Sound propgated using game geometry.
ovrAudioReflectionModel_Automatic
Automatically select highest quality (if geometry is set the propagation system will be active, otherwise if the callback is set dynamic room modeling is enabled, otherwise fallback to the static shoe box)
ovrAudioReflectionModel_COUNT
enum OVR_Audio.h.ovrAudioSpatializationStatus
Status mask returned by spatializer APIs.
Enumerator
ovrAudioSpatializationStatus_None
Nothing to report.
ovrAudioSpatializationStatus_Finished
Buffer is empty and sound processing is finished.
ovrAudioSpatializationStatus_Working
Data still remains in buffer (e.g. reverberation tail)
enum OVR_Audio.h.ovrAudioPerformanceCounter
Performance counter enumerants.
Enumerator
ovrAudioPerformanceCounter_Spatialization
Retrieve profiling information for spatialization.
ovrAudioPerformanceCounter_SharedReverb
Retrieve profiling information for shared reverb.
ovrAudioPerformanceCounter_COUNT
enum OVR_Audio.h.ovrAudioAmbisonicFormat
Ambisonic formats.
Enumerator
ovrAudioAmbisonicFormat_FuMa
standard B-Format, channel order = WXYZ (W channel is -3dB)
ovrAudioAmbisonicFormat_AmbiX
ACN/SN3D standard, channel order = WYZX.
enum OVR_Audio.h.ovrAudioAmbisonicRenderMode
Ambisonic rendering modes.
Enumerator
ovrAudioAmbisonicRenderMode_SphericalHarmonics
(default) Uses a spherical harmonic representation of HRTF
ovrAudioAmbisonicRenderMode_Mono
Plays the W (omni) channel through left and right with no spatialization.
enum OVR_Audio.h.ovrAudioMaterialPreset
Enumerator
ovrAudioMaterialPreset_AcousticTile
ovrAudioMaterialPreset_Brick
ovrAudioMaterialPreset_BrickPainted
ovrAudioMaterialPreset_Carpet
ovrAudioMaterialPreset_CarpetHeavy
ovrAudioMaterialPreset_CarpetHeavyPadded
ovrAudioMaterialPreset_CeramicTile
ovrAudioMaterialPreset_Concrete
ovrAudioMaterialPreset_ConcreteRough
ovrAudioMaterialPreset_ConcreteBlock
ovrAudioMaterialPreset_ConcreteBlockPainted
ovrAudioMaterialPreset_Curtain
ovrAudioMaterialPreset_Foliage
ovrAudioMaterialPreset_Glass
ovrAudioMaterialPreset_GlassHeavy
ovrAudioMaterialPreset_Grass
ovrAudioMaterialPreset_Gravel
ovrAudioMaterialPreset_GypsumBoard
ovrAudioMaterialPreset_PlasterOnBrick
ovrAudioMaterialPreset_PlasterOnConcreteBlock
ovrAudioMaterialPreset_Soil
ovrAudioMaterialPreset_SoundProof
ovrAudioMaterialPreset_Snow
ovrAudioMaterialPreset_Steel
ovrAudioMaterialPreset_Water
ovrAudioMaterialPreset_WoodThin
ovrAudioMaterialPreset_WoodThick
ovrAudioMaterialPreset_WoodFloor
ovrAudioMaterialPreset_WoodOnConcrete
ovrAudioMaterialPreset_COUNT

Typedef

typedef int32_t ovrResult ( )
No description available.
typedef struct ovrPosef_ ovrPosef ( )
No description available.
typedef struct ovrPoseStatef_ ovrPoseStatef ( )
No description available.
typedef struct ovrAudioSource_ ovrAudioSource ( )
Opaque type definitions for audio source and context.
ae5b4b080b446a4b18f435af24ccf981c
No description available.
typedef struct ovrAudioAmbisonicStream_* ovrAudioAmbisonicStream ( )
No description available.
typedef void* ovrAudioSpectrumAnalyzer ( )
No description available.

Member Functions

ovrResult ovrAudio_Initialize ( void)
DEPRECATED Initialize OVRAudio.
void ovrAudio_Shutdown ( void)
DEPRECATED Shutdown OVRAudio.
OVRA_EXPORT const char* ovrAudio_GetVersion ( int * Major, int * Minor, int * Patch )
Return library's built version information.
Can be called any time.
Parameters
Major
pointer to integer that accepts major version number
Minor
pointer to integer that accepts minor version number
Patch
pointer to integer that accepts patch version number
Returns a string with human readable build information
OVRA_EXPORT float* ovrAudio_AllocSamples ( int NumSamples )
Allocate properly aligned buffer to store samples.
Helper function that allocates 16-byte aligned sample data sufficient for passing to the spatialization APIs.
Parameters
NumSamples
number of samples to allocate
Returns pointer to 16-byte aligned float buffer, or NULL on failure
OVRA_EXPORT void ovrAudio_FreeSamples ( float * Samples )
Free previously allocated buffer.
Helper function that frees 16-byte aligned sample data previously allocated by ovrAudio_AllocSamples.
Parameters
Samples
pointer to buffer previously allocated by ovrAudio_AllocSamples
OVRA_EXPORT ovrResult ovrAudio_CreateContext ( ovrAudioContext * pContext, const ovrAudioContextConfiguration * pConfig )
Create an audio context for spatializing incoming sounds.
Creates an audio context with the given configuration.
Parameters
pContext[out]
pointer to store address of context. NOTE: pointer must be pointing to NULL!
pConfig[in]
pointer to configuration struct describing the desired context attributes
Returns an ovrResult indicating success or failure
OVRA_EXPORT ovrResult ovrAudio_InitializeContext ( ovrAudioContext Context, const ovrAudioContextConfiguration * pConfig )
No definition found.
OVRA_EXPORT void ovrAudio_DestroyContext ( ovrAudioContext Context )
Destroy a previously created audio context.
Parameters
Context
a valid audio context
OVRA_EXPORT ovrResult ovrAudio_Enable ( ovrAudioContext Context, ovrAudioEnable What, int Enable )
Enable/disable options in the audio context.
Parameters
Context
context to use
What
specific property to enable/disable
Enable
0 to disable, 1 to enable
Returns an ovrResult indicating success or failure
OVRA_EXPORT ovrResult ovrAudio_IsEnabled ( ovrAudioContext Context, ovrAudioEnable What, int * pEnabled )
Query option status in the audio context.
Parameters
Context
context to use
What
specific property to query
pEnabled
addr of variable to receive the queried property status
Returns an ovrResult indicating success or failure
OVRA_EXPORT ovrResult ovrAudio_SetUnitScale ( ovrAudioContext Context, float UnitScale )
Set the unit scale of game units relative to meters.
(e.g. for centimeters set UnitScale = 0.01)
Parameters
UnitScale[in]
unit scale value relative to meters
OVRA_EXPORT ovrResult ovrAudio_GetUnitScale ( ovrAudioContext Context, float * UnitScale )
Get the unit scale of game units relative to meters.
Parameters
UnitScale[out]
unit scale value value relative to meters
OVRA_EXPORT ovrResult ovrAudio_SetSimpleBoxRoomParameters ( ovrAudioContext Context, const ovrAudioBoxRoomParameters * Parameters )
Set box room parameters for reverberation.
These parameters are used for reverberation/early reflections if ovrAudioEnable_SimpleRoomModeling is enabled.
Parameters
Context[in]
context to use
Parameters[in]
pointer to ovrAudioBoxRoomParameters describing box
Returns an ovrResult indicating success or failure
See Also:
OVRA_EXPORT ovrResult ovrAudio_GetSimpleBoxRoomParameters ( ovrAudioContext Context, ovrAudioBoxRoomParameters * Parameters )
Get box room parameters for current reverberation.
Parameters
Context[in]
context to use
Parameters[out]
pointer to returned ovrAudioBoxRoomParameters box description
Returns an ovrResult indicating success or failure
See Also:
OVRA_EXPORT ovrResult ovrAudio_SetAdvancedBoxRoomParameters ( ovrAudioContext Context, const ovrAudioAdvancedBoxRoomParameters * Parameters )
Set advanced box room parameters for reverberation.
These parameters are used for reverberation/early reflections if ovrAudioEnable_SimpleRoomModeling is enabled.
Parameters
Context[in]
context to use
LockToListenerPosition[in]
1 - room is centered on listener, 0 - room center is specified by RoomPosition coordinates
RoomPositionX[in]
desired X coordinate of room (if not locked to listener)
RoomPositionY[in]
desired Y coordinate of room (if not locked to listener)
RoomPositionZ[in]
desired Z coordinate of room (if not locked to listener)
WallMaterials[in]
absorption coefficients for room materials
Returns an ovrResult indicating success or failure
See Also:
OVRA_EXPORT ovrResult ovrAudio_GetAdvancedBoxRoomParameters ( ovrAudioContext Context, ovrAudioAdvancedBoxRoomParameters * Parameters )
Get advanced box room parameters for reverberation.
These parameters are used for reverberation/early reflections if ovrAudioEnable_SimpleRoomModeling is enabled.
Parameters
Context[in]
context to use
LockToListenerPosition[out]
1 - room is centered on listener, 0 - room center is specified by RoomPosition coordinates
RoomPositionX[out]
desired X coordinate of room (if not locked to listener)
RoomPositionY[out]
desired Y coordinate of room (if not locked to listener)
RoomPositionZ[out]
desired Z coordinate of room (if not locked to listener)
WallMaterials[out]
absorption coefficients for room materials
Returns an ovrResult indicating success or failure
See Also:
OVRA_EXPORT ovrResult ovrAudio_SetListenerVectors ( ovrAudioContext Context, float PositionX, float PositionY, float PositionZ, float ForwardX, float ForwardY, float ForwardZ, float UpX, float UpY, float UpZ )
Sets the listener's pose state as vectors, position is in game units (unit scale will be applied)
If this is not set then the listener is always assumed to be facing into the screen (0,0,-1) at location (0,0,0) and that all spatialized sounds are in listener-relative coordinates.
Parameters
Context[in]
context to use
PositionX[in]
X position of listener on X axis
PositionY[in]
Y position of listener on X axis
PositionZ[in]
Z position of listener on X axis
ForwardX[in]
X component of listener forward vector
ForwardY[in]
Y component of listener forward vector
ForwardZ[in]
Z component of listener forward vector
UpX[in]
X component of listener up vector
UpY[in]
Y component of listener up vector
UpZ[in]
Z component of listener up vector
Returns an ovrResult indicating success or failure
OVRA_EXPORT ovrResult ovrAudio_GetListenerVectors ( ovrAudioContext Context, float * pPositionX, float * pPositionY, float * pPositionZ, float * pForwardX, float * pForwardY, float * pForwardZ, float * pUpX, float * pUpY, float * pUpZ )
Gets the listener's pose state as vectors.
Parameters
Context[in]
context to use
pPositionX[in]
addr of X position of listener on X axis
pPositionY[in]
addr of Y position of listener on X axis
pPositionZ[in]
addr of Z position of listener on X axis
pForwardX[in]
addr of X component of listener forward vector
pForwardY[in]
addr of Y component of listener forward vector
pForwardZ[in]
addr of Z component of listener forward vector
pUpX[in]
addr of X component of listener up vector
pUpY[in]
addr of Y component of listener up vector
pUpZ[in]
addr of Z component of listener up vector
Returns an ovrResult indicating success or failure
OVRA_EXPORT ovrResult ovrAudio_ResetAudioSource ( ovrAudioContext Context, int Sound )
Reset an audio source's state.
Sometimes you need to reset an audio source's internal state due to a change in the incoming sound or parameters. For example, removing any reverb tail since the incoming waveform has been swapped.
Parameters
Context
context to use
Sound
index of sound (0..NumSources-1)
Returns an ovrResult indicating success or failure
OVRA_EXPORT ovrResult ovrAudio_SetAudioSourcePos ( ovrAudioContext Context, int Sound, float X, float Y, float Z )
Sets the position of an audio source in game units (unit scale will be applied).
Use "OVR" coordinate system (same as pose).
Parameters
Context
context to use
Sound
index of sound (0..NumSources-1)
X
position of sound on X axis
Y
position of sound on Y axis
Z
position of sound on Z axis
Returns an ovrResult indicating success or failure
See Also:
ovrAudio_SetListenerPoseStatef
OVRA_EXPORT ovrResult ovrAudio_GetAudioSourcePos ( ovrAudioContext Context, int Sound, float * pX, float * pY, float * pZ )
Gets the position of an audio source.
Use "OVR" coordinate system (same as pose).
Parameters
Context
context to use
Sound
index of sound (0..NumSources-1)
pX
address of position of sound on X axis
pY
address of position of sound on Y axis
pZ
address of position of sound on Z axis
Returns an ovrResult indicating success or failure
See Also:
ovrAudio_SetListenerPoseStatef
OVRA_EXPORT ovrResult ovrAudio_SetAudioSourceRange ( ovrAudioContext Context, int Sound, float RangeMin, float RangeMax )
Sets the min and max range of the audio source.
Parameters
Context
context to use
Sound
index of sound (0..NumSources-1)
RangeMin
min range in meters (full gain)
RangeMax
max range in meters
Returns an ovrResult indicating success or failure
See Also:
ovrAudio_SetListenerPoseStatef
OVRA_EXPORT ovrResult ovrAudio_GetAudioSourceRange ( ovrAudioContext Context, int Sound, float * pRangeMin, float * pRangeMax )
Gets the min and max range of the audio source.
Parameters
Context
context to use
Sound
index of sound (0..NumSources-1)
pRangeMin
addr of variable to receive the returned min range parameter (in meters).
pRangeMax
addr of variable to receive the returned max range parameter (in meters).
Returns an ovrResult indicating success or failure
See Also:
ovrAudio_SetListenerPoseStatef
OVRA_EXPORT ovrResult ovrAudio_SetAudioSourceRadius ( ovrAudioContext Context, int Sound, float Radius )
Sets the radius of the audio source for volumetric sound sources.
Set a radius of 0 to make it a point source.
Parameters
Context
context to use
Sound
index of sound (0..NumSources-1)
Radius
source radius in meters
Returns an ovrResult indicating success or failure
See Also:
ovrAudio_SetListenerPoseStatef
OVRA_EXPORT ovrResult ovrAudio_GetAudioSourceRadius ( ovrAudioContext Context, int Sound, float * pRadius )
Gets the radius of the audio source for volumetric sound sources.
Parameters
Context
context to use
Sound
index of sound (0..NumSources-1)
pRadiusMin
addr of variable to receive the returned radius parameter (in meters).
Returns an ovrResult indicating success or failure
See Also:
ovrAudio_SetListenerPoseStatef
OVRA_EXPORT ovrResult ovrAudio_SetAudioHrtfIntensity ( ovrAudioContext Context, int Sound, float Intensity )
Sets HRTF intensity for audio source.
Parameters
Context
context to use
Sound
index of sound (0..NumSources-1)
intensity
in linear scale (0.0f to 1.0f)
Returns an ovrResult indicating success or failure
OVRA_EXPORT ovrResult ovrAudio_GetAudioHrtfIntensity ( ovrAudioContext Context, int Sound, float * pIntensity )
Gets HRTF intensity for audio source.
Parameters
Context
context to use
Sound
index of sound (0..NumSources-1)
pIntensity
addr of variable to receive the currently set intensity
Returns an ovrResult indicating success or failure
OVRA_EXPORT ovrResult ovrAudio_SetAudioReflectionsSendLevel ( ovrAudioContext Context, int Sound, float Level )
Sets the reflections send level for audio source.
Parameters
Context
context to use
Sound
index of sound (0..NumSources-1)
Level
send level in linear scale (0.0f to 1.0f)
Returns an ovrResult indicating success or failure
See Also:
ovrAudio_SetListenerPoseStatef
OVRA_EXPORT ovrResult ovrAudio_GetAudioReflectionsSendLevel ( ovrAudioContext Context, int Sound, float * pLevel )
Gets the the reflections send level for audio source.
Parameters
Context
context to use
Sound
index of sound (0..NumSources-1)
pLevel
addr of variable to receive the currently set send level
Returns an ovrResult indicating success or failure
See Also:
ovrAudio_SetListenerPoseStatef
OVRA_EXPORT ovrResult ovrAudio_SetAudioReverbSendLevel ( ovrAudioContext Context, int Sound, float Level )
Sets the reverb send level for audio source.
Parameters
Context
context to use
Sound
index of sound (0..NumSources-1)
Level
send level in linear scale (0.0f to 1.0f)
Returns an ovrResult indicating success or failure
See Also:
ovrAudio_SetListenerPoseStatef
OVRA_EXPORT ovrResult ovrAudio_GetAudioReverbSendLevel ( ovrAudioContext Context, int Sound, float * pLevel )
Gets the the reverb send level for audio source.
Parameters
Context
context to use
Sound
index of sound (0..NumSources-1)
pLevel
addr of variable to receive the currently set send level
Returns an ovrResult indicating success or failure
See Also:
ovrAudio_SetListenerPoseStatef
OVRA_EXPORT ovrResult ovrAudio_SetAudioSourceFlags ( ovrAudioContext Context, int Sound, uint32_t Flags )
Sets an audio source's flags.
Parameters
Context
context to use
Sound
index of sound (0..NumSources-1)
Flags
a logical OR of ovrAudioSourceFlag enumerants
Returns an ovrResult indicating success or failure
OVRA_EXPORT ovrResult ovrAudio_GetAudioSourceFlags ( ovrAudioContext Context, int Sound, uint32_t * pFlags )
Gets an audio source's flags.
Parameters
Context
context to use
Sound
index of sound (0..NumSources-1)
pFlags
addr of returned flags (a logical OR of ovrAudioSourceFlag enumerants)
Returns an ovrResult indicating success or failure
OVRA_EXPORT ovrResult ovrAudio_SetAudioSourceAttenuationMode ( ovrAudioContext Context, int Sound, ovrAudioSourceAttenuationMode Mode, float SourceGain )
Set the attenuation mode for a sound source.
Sounds can have their volume attenuated by distance based on different methods.
Parameters
Context
context to use
Sound
index of sound (0..NumSources-1)
Mode
attenuation mode to use
FixedScale
attenuation constant used for fixed attenuation mode
Returns an ovrResult indicating success or failure
OVRA_EXPORT ovrResult ovrAudio_GetAudioSourceAttenuationMode ( ovrAudioContext Context, int Sound, ovrAudioSourceAttenuationMode * pMode, float * pSourceGain )
Get the attenuation mode for a sound source.
Sounds can have their volume attenuated by distance based on different methods.
Parameters
Context
context to use
Sound
index of sound (0..NumSources-1)
pMode
addr of returned attenuation mode in use
pFixedScale
addr of returned attenuation constant used for fixed attenuation mode
Returns an ovrResult indicating success or failure
OVRA_EXPORT ovrResult ovrAudio_GetAudioSourceOverallGain ( ovrAudioContext Context, int Sound, float * Gain )
Get the overall gain for a sound source.
The gain after all attenatuation is applied, this can be used for voice prioritization and virtualization
Parameters
Context
context to use
Sound
index of sound (0..NumSources-1)
pMode
addr of returned attenuation mode in use
pFixedScale
addr of returned attenuation constant used for fixed attenuation mode
Returns an ovrResult indicating success or failure
OVRA_EXPORT ovrResult ovrAudio_SpatializeMonoSourceInterleaved ( ovrAudioContext Context, int Sound, uint32_t * OutStatus, float * Dst, const float * Src )
Spatialize a mono audio source to interleaved stereo output.
Parameters
Context[in]
context to use
Sound[in]
index of sound (0..NumSources-1)
OutStatus[out]
bitwise OR of flags indicating status of currently playing sound
Dst[out]
pointer to stereo interleaved floating point destination buffer
Src[in]
pointer to mono floating point buffer to spatialize
Returns an ovrResult indicating success or failure
OVRA_EXPORT ovrResult ovrAudio_SpatializeMonoSourceLR ( ovrAudioContext Context, int Sound, uint32_t * OutStatus, float * DstLeft, float * DstRight, const float * Src )
Spatialize a mono audio source to separate left and right output buffers.
Parameters
Context[in]
context to use
Sound[in]
index of sound (0..NumSources-1)
OutStatus[out]
bitwise OR of flags indicating status of currently playing sound
DstLeft[out]
pointer to floating point left channel buffer
DstRight[out]
pointer to floating point right channel buffer
Src[in]
pointer to mono floating point buffer to spatialize
Returns an ovrResult indicating success or failure
OVRA_EXPORT ovrResult ovrAudio_MixInSharedReverbLR ( ovrAudioContext Context, uint32_t * OutStatus, float * DstLeft, float * DstRight )
Mix shared reverb into buffer.
Parameters
Context[in]
context to use
OutStatus[out]
bitwise OR of flags indicating status of currently playing sound
OutLeft[out]
pointer to floating point left channel buffer to mix into (MUST CONTAIN VALID AUDIO OR SILENCE)
OutRight[out]
pointer to floating point right channel buffer to mix into (MUST CONTAIN VALID AUDIO OR SILENCE)
Returns an ovrResult indicating success or failure
OVRA_EXPORT ovrResult ovrAudio_MixInSharedReverbInterleaved ( ovrAudioContext Context, uint32_t * OutStatus, float * DstInterleaved )
Mix shared reverb into interleaved buffer.
Parameters
Context[in]
context to use
OutStatus[out]
bitwise OR of flags indicating status of currently playing sound
DstInterleaved[out]
pointer to interleaved floating point left&right channels buffer to mix into (MUST CONTAIN VALID AUDIO OR SILENCE)
Returns an ovrResult indicating success or failure
OVRA_EXPORT ovrResult ovrAudio_SetSharedReverbWetLevel ( ovrAudioContext Context, const float Level )
Set shared reverb wet level.
Parameters
Context[in]
context to use
Level[out]
linear value to scale global reverb level by
Returns an ovrResult indicating success or failure
OVRA_EXPORT ovrResult ovrAudio_GetSharedReverbWetLevel ( ovrAudioContext Context, float * Level )
Get shared reverb wet level.
Parameters
Context[in]
context to use
Level[out]
linear value currently set to scale global reverb level by
Returns an ovrResult indicating success or failure
OVRA_EXPORT ovrResult ovrAudio_SetHeadRadius ( ovrAudioContext Context, float HeadRadius )
Set user headRadius.
NOTE: This API is intended to let you set user configuration parameters that may assist with spatialization.
Parameters
Context[in]
context to use
Config[in]
configuration state
OVRA_EXPORT ovrResult ovrAudio_GetHeadRadius ( ovrAudioContext Context, float * HeadRadius )
Set user configuration.
NOTE: This API is intended to let you set user configuration parameters that may assist with spatialization.
Parameters
Context[in]
context to use
Config[in]
configuration state
OVRA_EXPORT ovrResult ovrAudio_GetPerformanceCounter ( ovrAudioContext Context, ovrAudioPerformanceCounter Counter, int64_t * Count, double * TimeMicroSeconds )
Retrieve a performance counter.
Parameters
Context[in]
context to use
Counter[in]
the counter to retrieve
Count[out]
destination for count variable (number of times that counter was updated)
TimeMicroSeconds
destination for total time spent in that performance counter
Returns an ovrResult indicating success or failure
OVRA_EXPORT ovrResult ovrAudio_ResetPerformanceCounter ( ovrAudioContext Context, ovrAudioPerformanceCounter Counter )
Reset a performance counter.
Parameters
Context[in]
context to use
Counter[in]
the counter to retrieve
OVRA_EXPORT ovrResult ovrAudio_ProcessQuadBinaural ( const float * ForwardLR, const float * RightLR, const float * BackLR, const float * LeftLR, float LookDirectionX, float LookDirectionY, float LookDirectionZ, int NumSamples, float * Dst )
Quad-binaural spatialization.
Parameters
ForwardLR[in]
pointer to stereo interleaved floating point binaural audio for the forward direction (0 degrees)
RightLR[in]
pointer to stereo interleaved floating point binaural audio for the right direction (90 degrees)
BackLR[in]
pointer to stereo interleaved floating point binaural audio for the backward direction (180 degrees)
LeftLR[in]
pointer to stereo interleaved floating point binaural audio for the left direction (270 degrees)
LookDirectionX[in]
X component of the listener direction vector
LookDirectionY[in]
Y component of the listener direction vector
LookDirectionZ[in]
Z component of the listener direction vector
NumSamples[in]
size of audio buffers (in samples)
Dst[out]
pointer to stereo interleaved floating point destination buffer
OVRA_EXPORT ovrResult ovrAudio_CreateAmbisonicStream ( ovrAudioContext Context, int SampleRate, int AudioBufferLength, ovrAudioAmbisonicFormat format, int ambisonicOrder, ovrAudioAmbisonicStream * pAmbisonicStream )
Create an ambisonic stream instance for spatializing B-format ambisonic audio.
Parameters
SampleRate[in]
sample rate of B-format signal (16000 to 48000, but 44100 and 48000 are recommended for best quality)
AudioBufferLength[in]
size of audio buffers
pContext[out]
pointer to store address of stream.
OVRA_EXPORT ovrResult ovrAudio_ResetAmbisonicStream ( ovrAudioAmbisonicStream AmbisonicStream )
Reset a previously created ambisonic stream for re-use.
Parameters
Context
a valid ambisonic stream
OVRA_EXPORT ovrResult ovrAudio_DestroyAmbisonicStream ( ovrAudioAmbisonicStream AmbisonicStream )
Destroy a previously created ambisonic stream.
Parameters
Context
a valid ambisonic stream
OVRA_EXPORT ovrResult ovrAudio_SetAmbisonicRenderMode ( ovrAudioAmbisonicStream AmbisonicStream, ovrAudioAmbisonicRenderMode Mode )
Sets the render mode for the ambisonic stream.
Parameters
Context
a valid ambisonic stream
OVRA_EXPORT ovrResult ovrAudio_GetAmbisonicRenderMode ( ovrAudioAmbisonicStream AmbisonicStream, ovrAudioAmbisonicRenderMode * Mode )
Sets the render mode for the ambisonic stream.
Parameters
Context
a valid ambisonic stream
OVRA_EXPORT ovrResult ovrAudio_MonoToAmbisonic ( const float * InMono, float DirectionX, float DirectionY, float DirectionZ, ovrAudioAmbisonicFormat Format, int AmbisonicOrder, float * OutAmbisonic, int NumSamples )
Spatialize a mono in ambisonics.
Parameters
InMono[in]
Mono audio buffer to spatialize
DirectionX[in]
X component of the direction vector
DirectionY[in]
Y component of the direction vector
DirectionZ[in]
Z component of the direction vector
Format[in]
ambisonic format (AmbiX or FuMa)
AmbisonicOrder[in]
order of ambisonics (1 or 2)
OutAmbisonic[out]
Buffer to write interleaved ambisonics to (4 channels for 1st order, 9 channels for second order)
NumSamples[in]
Length of the buffer in frames (InMono is this length, OutAmbisonic is either 4 or 9 times this length depending on 1st or 2nd order)
OVRA_EXPORT ovrResult ovrAudio_ProcessAmbisonicStreamInterleaved ( ovrAudioContext Context, ovrAudioAmbisonicStream AmbisonicStream, const float * Src, float * Dst, int NumSamples )
Spatialize ambisonic stream.
Parameters
Src[in]
pointer to interleaved floating point ambisonic buffer to spatialize
Dst[out]
pointer to stereo interleaved floating point destination buffer
OVRA_EXPORT ovrResult ovrAudio_SetAmbisonicOrientation ( ovrAudioAmbisonicStream AmbisonicStream, float LookDirectionX, float LookDirectionY, float LookDirectionZ, float UpDirectionX, float UpDirectionY, float UpDirectionZ )
Set orientation for ambisonic stream.
Parameters
LookDirectionX[in]
X component of the source direction vector
LookDirectionY[in]
Y component of the source direction vector
LookDirectionZ[in]
Z component of the source direction vector
UpDirectionX[in]
X component of the source up vector
UpDirectionY[in]
Y component of the source up vector
UpDirectionZ[in]
Z component of the source up vector
OVRA_EXPORT ovrResult ovrAudio_GetAmbisonicOrientation ( ovrAudioAmbisonicStream AmbisonicStream, float * pLookDirectionX, float * pLookDirectionY, float * pLookDirectionZ, float * pUpDirectionX, float * pUpDirectionY, float * pUpDirectionZ )
Get orientation for ambisonic stream.
Parameters
pLookDirectionX[in]
address of the X component of the source direction vector
pLookDirectionY[in]
address of the Y component of the source direction vector
pLookDirectionZ[in]
address of the Z component of the source direction vector
pUpDirectionX[in]
address of the X component of the source up vector
pUpDirectionY[in]
address of the Y component of the source up vector
pUpDirectionZ[in]
address of the Z component of the source up vector
OVRA_EXPORT ovrResult ovrAudio_SetProfilerEnabled ( ovrAudioContext Context, int Enabled )
Enable the Oculus Audio profiler to connect to the game and monitor the CPU usage live.
Parameters
Context[in]
context to use
Enabled[in]
whether the profiler is enabled
OVRA_EXPORT ovrResult ovrAudio_SetProfilerPort ( ovrAudioContext , int Port )
Set the network port for the Oculus Audio profiler.
Parameters
Context[in]
context to use
Port[in]
port number to use in the range 0 - 65535 (default is 2121)
OVRA_EXPORT ovrResult ovrAudio_SetReflectionModel ( ovrAudioContext Context, ovrAudioReflectionModel Model )
Explicitly set the reflection model, this can be used to A/B test the algorithms.
Parameters
Context[in]
context to use
Model[in]
The reflection model to use (default is Automatic)
OVRA_EXPORT ovrResult ovrAudio_AssignRaycastCallback ( ovrAudioContext Context, OVRA_RAYCAST_CALLBACK Callback, void * pctx )
Assign a callback for raycasting into the game geometry.
Parameters
Context[in]
context to use
Callback[in]
pointer to an implementation of OVRA_RAYCAST_CALLBACK
pctx[in]
address of user data pointer to be passed into the callback
OVRA_EXPORT ovrResult ovrAudio_SetDynamicRoomRaysPerSecond ( ovrAudioContext Context, int RaysPerSecond )
Set the number of ray casts per second are used for dynamic modeling, more rays mean more accurate and responsive modelling but will reduce performance.
Parameters
Context[in]
context to use
RaysPerSecond[in]
number of ray casts per second, default = 256
OVRA_EXPORT ovrResult ovrAudio_SetDynamicRoomInterpSpeed ( ovrAudioContext Context, float InterpSpeed )
Set the speed which the dynamic room interpolates, higher values will update more quickly but less smooth.
Parameters
Context[in]
context to use
InterpSpeed[in]
speed which it interpolates (0.0 - 1.0) default = 0.9
OVRA_EXPORT ovrResult ovrAudio_SetDynamicRoomMaxWallDistance ( ovrAudioContext Context, float MaxWallDistance )
Set the maximum distance to the wall for dynamic room modeling to constrain the size.
Parameters
Context[in]
context to use
MaxWallDistance[in]
distance to wall in meters, default = 50
OVRA_EXPORT ovrResult ovrAudio_SetDynamicRoomRaysRayCacheSize ( ovrAudioContext Context, int RayCacheSize )
Set the size of the cache which holds a history of the rays cast, a larger value will have more points making it more stable but less responsive.
Parameters
Context[in]
context to use
RayCacheSize[in]
number of rays to cache, default = 512
OVRA_EXPORT ovrResult ovrAudio_GetRoomDimensions ( ovrAudioContext Context, float RoomDimensions, float ReflectionsCoefs, ovrAudioVector3f * Position )
Retrieves the dimensions of the dynamic room moel.
Parameters
Context[in]
context to use
RoomDimensions[out]
X, Y, and Z dimensions of the room
ReflectionsCoefs[out]
the reflection coefficients of the walls
Position[out]
the world position of the center of the room
OVRA_EXPORT ovrResult ovrAudio_GetRaycastHits ( ovrAudioContext Context, ovrAudioVector3f Points, ovrAudioVector3f Normals, int Length )
Retrieves the cache of ray cast hits that are being used to estimate the room, this is useful for debugging rays hitting the wrong objects.
Parameters
Context[in]
context to use
Points[out]
array of points where the rays hit geometry
Normals[out]
array of normals
Length[int]
the length of the points and normals array (both should be the same length)
OVRA_EXPORT ovrResult ovrAudio_SetPropagationQuality ( ovrAudioContext context, float quality )
No definition found.
OVRA_EXPORT ovrResult ovrAudio_SetPropagationThreadAffinity ( ovrAudioContext context, uint64_t cpuMask )
No definition found.
OVRA_EXPORT ovrResult ovrAudio_CreateAudioGeometry ( ovrAudioContext context, ovrAudioGeometry * geometry )
No definition found.
OVRA_EXPORT ovrResult ovrAudio_DestroyAudioGeometry ( ovrAudioGeometry geometry )
No definition found.
OVRA_EXPORT ovrResult ovrAudio_AudioGeometryUploadMesh ( ovrAudioGeometry geometry, const ovrAudioMesh * mesh )
No definition found.
OVRA_EXPORT ovrResult ovrAudio_AudioGeometryUploadMeshArrays ( ovrAudioGeometry geometry, const void * vertices, size_t verticesByteOffset, size_t vertexCount, size_t vertexStride, ovrAudioScalarType vertexType, const void * indices, size_t indicesByteOffset, size_t indexCount, ovrAudioScalarType indexType, const ovrAudioMeshGroup * groups, size_t groupCount )
No definition found.
OVRA_EXPORT ovrResult ovrAudio_AudioGeometrySetTransform ( ovrAudioGeometry geometry, const float matrix4x4 )
No definition found.
OVRA_EXPORT ovrResult ovrAudio_AudioGeometryGetTransform ( const ovrAudioGeometry geometry, float matrix4x4 )
No definition found.
OVRA_EXPORT ovrResult ovrAudio_AudioGeometryWriteMeshFile ( const ovrAudioGeometry geometry, const char * filePath )
No definition found.
OVRA_EXPORT ovrResult ovrAudio_AudioGeometryReadMeshFile ( ovrAudioGeometry geometry, const char * filePath )
No definition found.
OVRA_EXPORT ovrResult ovrAudio_AudioGeometryWriteMeshFileObj ( const ovrAudioGeometry geometry, const char * filePath )
No definition found.
OVRA_EXPORT ovrResult ovrAudio_CreateAudioMaterial ( ovrAudioContext context, ovrAudioMaterial * material )
No definition found.
OVRA_EXPORT ovrResult ovrAudio_DestroyAudioMaterial ( ovrAudioMaterial material )
No definition found.
OVRA_EXPORT ovrResult ovrAudio_AudioMaterialSetFrequency ( ovrAudioMaterial material, ovrAudioMaterialProperty property, float frequency, float value )
No definition found.
OVRA_EXPORT ovrResult ovrAudio_AudioMaterialGetFrequency ( const ovrAudioMaterial material, ovrAudioMaterialProperty property, float frequency, float * value )
No definition found.
OVRA_EXPORT ovrResult ovrAudio_AudioMaterialReset ( ovrAudioMaterial material, ovrAudioMaterialProperty property )
No definition found.
OVRA_EXPORT ovrResult ovrAudio_AudioGeometryWriteMeshData ( const ovrAudioGeometry geometry, const ovrAudioSerializer * serializer )
No definition found.
OVRA_EXPORT ovrResult ovrAudio_AudioGeometryReadMeshData ( ovrAudioGeometry geometry, const ovrAudioSerializer * serializer )
No definition found.
ovrResult ovrAudio_GetReflectionBands ( ovrAudioMaterialPreset Preset, AudioBands Bands )
No definition found.

Code Sample

// (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary./********************************************************************************/#ifndef OVR_Audio_h#define OVR_Audio_h#include <stdint.h>#include "OVR_Audio_DynamicRoom.h"#include "OVR_Audio_Propagation.h"#ifdef __cplusplusextern"C" {#endif#ifndef OVR_RESULT_DEFINED#define OVR_RESULT_DEFINEDtypedef int32_t ovrResult;#endif#ifndef OVR_SUCCESS_DEFINED#define OVR_SUCCESS_DEFINED#define ovrSuccess 0#endiftypedefenum {ovrError_AudioUnknown = 2000, ovrError_AudioInvalidParam = 2001, ovrError_AudioBadSampleRate = 2002, ovrError_AudioMissingDLL = 2003, ovrError_AudioBadAlignment = 2004, ovrError_AudioUninitialized = 2005, ovrError_AudioHRTFInitFailure = 2006, ovrError_AudioBadVersion = 2007, ovrError_AudioSymbolNotFound = 2008, ovrError_SharedReverbDisabled = 2009, ovrError_AudioNoAvailableAmbisonicInstance = 2017,ovrError_AudioMemoryAllocFailure = 2018,ovrError_AudioUnsupportedFeature = 2019, ovrError_AudioInternalEnd = 2099, } ovrAudioError;#ifndef OVR_CAPI_htypedefstruct ovrPosef_ ovrPosef;typedefstruct ovrPoseStatef_ ovrPoseStatef;#endif#define OVR_AUDIO_MAJOR_VERSION 1#define OVR_AUDIO_MINOR_VERSION 79#define OVR_AUDIO_PATCH_VERSION 0#ifdef _WIN32#define OVRA_EXPORT __declspec(dllexport)#define FUNC_NAME __FUNCTION__#elif defined(__ANDROID__)#define OVRA_EXPORT __attribute__((visibility("default")))#define FUNC_NAME __func__#elif defined __APPLE__#define OVRA_EXPORT __attribute__((visibility("default")))#define FUNC_NAME __func__#elif defined __linux__#define OVRA_EXPORT __attribute__((visibility("default")))#define FUNC_NAME __func__#else#error not implemented#endiftypedefenum {ovrAudioInitFlag_Default = 0x0000,ovrAudioInitFlag_ThreadUnsafe = 0x0010, } ovrAudioInitFlags;typedefenum {ovrAudioSourceFlag_None = 0x0000,ovrAudioSourceFlag_WideBand_HINT = 0x0010, ovrAudioSourceFlag_NarrowBand_HINT = 0x0020, ovrAudioSourceFlag_BassCompensation_DEPRECATED = 0x0040, ovrAudioSourceFlag_DirectTimeOfArrival = 0x0080, ovrAudioSourceFlag_ReflectionsDisabled = 0x0100, #if defined(OVR_INTERNAL_CODE)ovrAudioSourceFlag_Stereo = 0x0200, #endifovrAudioSourceFlag_DisableResampling_RESERVED = 0x8000, } ovrAudioSourceFlag;typedefenum {ovrAudioSourceAttenuationMode_None = 0, ovrAudioSourceAttenuationMode_Fixed = 1, ovrAudioSourceAttenuationMode_InverseSquare = 2, ovrAudioSourceAttenuationMode_COUNT} ovrAudioSourceAttenuationMode;typedefenum {ovrAudioEnable_None = 0, ovrAudioEnable_SimpleRoomModeling = 2, ovrAudioEnable_LateReverberation = 3, ovrAudioEnable_RandomizeReverb = 4, ovrAudioEnable_PerformanceCounters = 5, ovrAudioEnable_COUNT} ovrAudioEnable;typedefenum {ovrAudioReflectionModel_StaticShoeBox = 0, ovrAudioReflectionModel_DynamicRoomModeling = 1, ovrAudioReflectionModel_PropagationSystem = 2, ovrAudioReflectionModel_Automatic =3, ovrAudioReflectionModel_COUNT} ovrAudioReflectionModel;typedefenum {ovrAudioSpatializationStatus_None = 0x00, ovrAudioSpatializationStatus_Finished = 0x01, ovrAudioSpatializationStatus_Working = 0x02, } ovrAudioSpatializationStatus;typedefenum {ovrAudioPerformanceCounter_Spatialization = 0, ovrAudioPerformanceCounter_SharedReverb = 1, ovrAudioPerformanceCounter_COUNT} ovrAudioPerformanceCounter;typedefenum {ovrAudioAmbisonicFormat_FuMa, ovrAudioAmbisonicFormat_AmbiX } ovrAudioAmbisonicFormat;typedefenum {ovrAudioAmbisonicRenderMode_SphericalHarmonics = -1, ovrAudioAmbisonicRenderMode_Mono = -2 } ovrAudioAmbisonicRenderMode;typedefstruct ovrAudioSource_ ovrAudioSource;typedefstruct ovrAudioContext_* ovrAudioContext;typedefstruct ovrAudioAmbisonicStream_* ovrAudioAmbisonicStream;typedefvoid* ovrAudioSpectrumAnalyzer;inline ovrResult ovrAudio_Initialize(void) {return ovrSuccess;}inlinevoid ovrAudio_Shutdown(void) {}OVRA_EXPORT constchar* ovrAudio_GetVersion(int* Major, int* Minor, int* Patch);OVRA_EXPORT float* ovrAudio_AllocSamples(int NumSamples);OVRA_EXPORT void ovrAudio_FreeSamples(float* Samples);typedefstruct _ovrAudioContextConfig {uint32_t acc_Size; uint32_t acc_MaxNumSources; uint32_t acc_SampleRate; uint32_t acc_BufferLength; uint32_t acc_InitFlags; } ovrAudioContextConfiguration;OVRA_EXPORT ovrResult ovrAudio_CreateContext(ovrAudioContext* pContext, const ovrAudioContextConfiguration* pConfig);OVRA_EXPORT ovrResult ovrAudio_InitializeContext(ovrAudioContext Context, const ovrAudioContextConfiguration* pConfig);OVRA_EXPORT void ovrAudio_DestroyContext(ovrAudioContext Context);OVRA_EXPORT ovrResult ovrAudio_Enable(ovrAudioContext Context, ovrAudioEnable What, int Enable);OVRA_EXPORT ovrResult ovrAudio_IsEnabled(ovrAudioContext Context, ovrAudioEnable What, int* pEnabled);OVRA_EXPORT ovrResult ovrAudio_SetUnitScale(ovrAudioContext Context, float UnitScale);OVRA_EXPORT ovrResult ovrAudio_GetUnitScale(ovrAudioContext Context, float* UnitScale);typedefstruct _ovrAudioBoxRoomParameters {uint32_t brp_Size; float brp_ReflectLeft, brp_ReflectRight; float brp_ReflectUp, brp_ReflectDown; float brp_ReflectBehind, brp_ReflectFront; float brp_Width, brp_Height, brp_Depth; } ovrAudioBoxRoomParameters;OVRA_EXPORT ovrResult ovrAudio_SetSimpleBoxRoomParameters(ovrAudioContext Context, const ovrAudioBoxRoomParameters* Parameters);OVRA_EXPORT ovrResult ovrAudio_GetSimpleBoxRoomParameters(ovrAudioContext Context, ovrAudioBoxRoomParameters* Parameters);typedefstruct _ovrAudioAdvancedBoxRoomParameters {uint32_t abrp_Size; AudioBands abrp_ReflectLeft, abrp_ReflectRight; AudioBands abrp_ReflectUp, abrp_ReflectDown; AudioBands abrp_ReflectBehind, abrp_ReflectFront; float abrp_Width, abrp_Height, abrp_Depth; int abrp_LockToListenerPosition; ovrAudioVector3f abrp_RoomPosition;} ovrAudioAdvancedBoxRoomParameters;OVRA_EXPORT ovrResult ovrAudio_SetAdvancedBoxRoomParameters(ovrAudioContext Context, const ovrAudioAdvancedBoxRoomParameters* Parameters);OVRA_EXPORT ovrResult ovrAudio_GetAdvancedBoxRoomParameters(ovrAudioContext Context, ovrAudioAdvancedBoxRoomParameters* Parameters);OVRA_EXPORT ovrResult ovrAudio_SetListenerVectors(ovrAudioContext Context,float PositionX,float PositionY,float PositionZ,float ForwardX,float ForwardY,float ForwardZ,float UpX,float UpY,float UpZ);OVRA_EXPORT ovrResult ovrAudio_GetListenerVectors(ovrAudioContext Context,float* pPositionX,float* pPositionY,float* pPositionZ,float* pForwardX,float* pForwardY,float* pForwardZ,float* pUpX,float* pUpY,float* pUpZ);OVRA_EXPORT ovrResult ovrAudio_ResetAudioSource(ovrAudioContext Context, int Sound);OVRA_EXPORT ovrResult ovrAudio_SetAudioSourcePos(ovrAudioContext Context, int Sound, float X, float Y, float Z);OVRA_EXPORT ovrResult ovrAudio_GetAudioSourcePos(ovrAudioContext Context, int Sound, float* pX, float* pY, float* pZ);OVRA_EXPORT ovrResult ovrAudio_SetAudioSourceRange(ovrAudioContext Context, int Sound, float RangeMin, float RangeMax);OVRA_EXPORT ovrResult ovrAudio_GetAudioSourceRange(ovrAudioContext Context, int Sound, float* pRangeMin, float* pRangeMax);OVRA_EXPORT ovrResult ovrAudio_SetAudioSourceRadius(ovrAudioContext Context, int Sound, float Radius);OVRA_EXPORT ovrResult ovrAudio_GetAudioSourceRadius(ovrAudioContext Context, int Sound, float* pRadius);OVRA_EXPORT ovrResult ovrAudio_SetAudioHrtfIntensity(ovrAudioContext Context, int Sound, float Intensity);OVRA_EXPORT ovrResult ovrAudio_GetAudioHrtfIntensity(ovrAudioContext Context, int Sound, float* pIntensity);OVRA_EXPORT ovrResult ovrAudio_SetAudioReflectionsSendLevel(ovrAudioContext Context, int Sound, float Level);OVRA_EXPORT ovrResult ovrAudio_GetAudioReflectionsSendLevel(ovrAudioContext Context, int Sound, float* pLevel);OVRA_EXPORT ovrResult ovrAudio_SetAudioReverbSendLevel(ovrAudioContext Context, int Sound, float Level);OVRA_EXPORT ovrResult ovrAudio_GetAudioReverbSendLevel(ovrAudioContext Context, int Sound, float* pLevel);OVRA_EXPORT ovrResult ovrAudio_SetAudioSourceFlags(ovrAudioContext Context, int Sound, uint32_t Flags);OVRA_EXPORT ovrResult ovrAudio_GetAudioSourceFlags(ovrAudioContext Context, int Sound, uint32_t* pFlags);OVRA_EXPORT ovrResultovrAudio_SetAudioSourceAttenuationMode(ovrAudioContext Context, int Sound, ovrAudioSourceAttenuationMode Mode, float SourceGain);OVRA_EXPORT ovrResultovrAudio_GetAudioSourceAttenuationMode(ovrAudioContext Context, int Sound, ovrAudioSourceAttenuationMode* pMode, float* pSourceGain);OVRA_EXPORT ovrResult ovrAudio_GetAudioSourceOverallGain(ovrAudioContext Context, int Sound, float* Gain);OVRA_EXPORT ovrResultovrAudio_SpatializeMonoSourceInterleaved(ovrAudioContext Context, int Sound, uint32_t* OutStatus, float* Dst, constfloat* Src);OVRA_EXPORT ovrResultovrAudio_SpatializeMonoSourceLR(ovrAudioContext Context, int Sound, uint32_t* OutStatus, float* DstLeft, float* DstRight, constfloat* Src);OVRA_EXPORT ovrResult ovrAudio_MixInSharedReverbLR(ovrAudioContext Context, uint32_t* OutStatus, float* DstLeft, float* DstRight);OVRA_EXPORT ovrResult ovrAudio_MixInSharedReverbInterleaved(ovrAudioContext Context, uint32_t* OutStatus, float* DstInterleaved);OVRA_EXPORT ovrResult ovrAudio_SetSharedReverbWetLevel(ovrAudioContext Context, constfloat Level);OVRA_EXPORT ovrResult ovrAudio_GetSharedReverbWetLevel(ovrAudioContext Context, float* Level);OVRA_EXPORT ovrResult ovrAudio_SetHeadRadius(ovrAudioContext Context, float HeadRadius);OVRA_EXPORT ovrResult ovrAudio_GetHeadRadius(ovrAudioContext Context, float* HeadRadius);OVRA_EXPORT ovrResultovrAudio_GetPerformanceCounter(ovrAudioContext Context, ovrAudioPerformanceCounter Counter, int64_t* Count, double* TimeMicroSeconds);OVRA_EXPORT ovrResult ovrAudio_ResetPerformanceCounter(ovrAudioContext Context, ovrAudioPerformanceCounter Counter);OVRA_EXPORT ovrResult ovrAudio_ProcessQuadBinaural(constfloat* ForwardLR,constfloat* RightLR,constfloat* BackLR,constfloat* LeftLR,float LookDirectionX,float LookDirectionY,float LookDirectionZ,int NumSamples,float* Dst);OVRA_EXPORT ovrResult ovrAudio_CreateAmbisonicStream(ovrAudioContext Context,int SampleRate,int AudioBufferLength,ovrAudioAmbisonicFormat format,int ambisonicOrder,ovrAudioAmbisonicStream* pAmbisonicStream);OVRA_EXPORT ovrResult ovrAudio_ResetAmbisonicStream(ovrAudioAmbisonicStream AmbisonicStream);OVRA_EXPORT ovrResult ovrAudio_DestroyAmbisonicStream(ovrAudioAmbisonicStream AmbisonicStream);OVRA_EXPORT ovrResult ovrAudio_SetAmbisonicRenderMode(ovrAudioAmbisonicStream AmbisonicStream, ovrAudioAmbisonicRenderMode Mode);OVRA_EXPORT ovrResult ovrAudio_GetAmbisonicRenderMode(ovrAudioAmbisonicStream AmbisonicStream, ovrAudioAmbisonicRenderMode* Mode);OVRA_EXPORT ovrResult ovrAudio_MonoToAmbisonic(constfloat* InMono,float DirectionX,float DirectionY,float DirectionZ,ovrAudioAmbisonicFormat Format,int AmbisonicOrder,float* OutAmbisonic,int NumSamples);OVRA_EXPORT ovrResult ovrAudio_ProcessAmbisonicStreamInterleaved(ovrAudioContext Context,ovrAudioAmbisonicStream AmbisonicStream,constfloat* Src,float* Dst,int NumSamples);OVRA_EXPORT ovrResult ovrAudio_SetAmbisonicOrientation(ovrAudioAmbisonicStream AmbisonicStream,float LookDirectionX,float LookDirectionY,float LookDirectionZ,float UpDirectionX,float UpDirectionY,float UpDirectionZ);OVRA_EXPORT ovrResult ovrAudio_GetAmbisonicOrientation(ovrAudioAmbisonicStream AmbisonicStream,float* pLookDirectionX,float* pLookDirectionY,float* pLookDirectionZ,float* pUpDirectionX,float* pUpDirectionY,float* pUpDirectionZ);OVRA_EXPORT ovrResult ovrAudio_SetProfilerEnabled(ovrAudioContext Context, int Enabled);OVRA_EXPORT ovrResult ovrAudio_SetProfilerPort(ovrAudioContext, int Port);OVRA_EXPORT ovrResult ovrAudio_SetReflectionModel(ovrAudioContext Context, ovrAudioReflectionModel Model);OVRA_EXPORT ovrResult ovrAudio_AssignRaycastCallback(ovrAudioContext Context, OVRA_RAYCAST_CALLBACK Callback, void* pctx);OVRA_EXPORT ovrResult ovrAudio_SetDynamicRoomRaysPerSecond(ovrAudioContext Context, int RaysPerSecond);OVRA_EXPORT ovrResult ovrAudio_SetDynamicRoomInterpSpeed(ovrAudioContext Context, float InterpSpeed);OVRA_EXPORT ovrResult ovrAudio_SetDynamicRoomMaxWallDistance(ovrAudioContext Context, float MaxWallDistance);OVRA_EXPORT ovrResult ovrAudio_SetDynamicRoomRaysRayCacheSize(ovrAudioContext Context, int RayCacheSize);OVRA_EXPORT ovrResultovrAudio_GetRoomDimensions(ovrAudioContext Context, float RoomDimensions[], float ReflectionsCoefs[], ovrAudioVector3f* Position);OVRA_EXPORT ovrResult ovrAudio_GetRaycastHits(ovrAudioContext Context, ovrAudioVector3f Points[], ovrAudioVector3f Normals[], int Length);// Propagation is only supported on Windows// All methods below will return ovrError_AudioUnsupportedFeature on other platforms/***********************************************************************************//* Geometry API */OVRA_EXPORT ovrResult ovrAudio_SetPropagationQuality(ovrAudioContext context, float quality);OVRA_EXPORT ovrResult ovrAudio_SetPropagationThreadAffinity(ovrAudioContext context, uint64_t cpuMask);OVRA_EXPORT ovrResult ovrAudio_CreateAudioGeometry(ovrAudioContext context, ovrAudioGeometry* geometry);OVRA_EXPORT ovrResult ovrAudio_DestroyAudioGeometry(ovrAudioGeometry geometry);OVRA_EXPORT ovrResult ovrAudio_AudioGeometryUploadMesh(ovrAudioGeometry geometry,const ovrAudioMesh* mesh /*, const ovrAudioMeshSimplificationParameters* simplification*/);OVRA_EXPORT ovrResult ovrAudio_AudioGeometryUploadMeshArrays(ovrAudioGeometry geometry,constvoid* vertices,size_t verticesByteOffset,size_t vertexCount,size_t vertexStride,ovrAudioScalarType vertexType,constvoid* indices,size_t indicesByteOffset,size_t indexCount,ovrAudioScalarType indexType,const ovrAudioMeshGroup* groups,size_t groupCount /*, const ovrAudioMeshSimplificationParameters* simplification*/);OVRA_EXPORT ovrResult ovrAudio_AudioGeometrySetTransform(ovrAudioGeometry geometry, constfloat matrix4x4[16]);OVRA_EXPORT ovrResult ovrAudio_AudioGeometryGetTransform(const ovrAudioGeometry geometry, float matrix4x4[16]);OVRA_EXPORT ovrResult ovrAudio_AudioGeometryWriteMeshFile(const ovrAudioGeometry geometry, constchar* filePath);OVRA_EXPORT ovrResult ovrAudio_AudioGeometryReadMeshFile(ovrAudioGeometry geometry, constchar* filePath);OVRA_EXPORT ovrResult ovrAudio_AudioGeometryWriteMeshFileObj(const ovrAudioGeometry geometry, constchar* filePath);/***********************************************************************************//* Material API */OVRA_EXPORT ovrResult ovrAudio_CreateAudioMaterial(ovrAudioContext context, ovrAudioMaterial* material);OVRA_EXPORT ovrResult ovrAudio_DestroyAudioMaterial(ovrAudioMaterial material);OVRA_EXPORT ovrResultovrAudio_AudioMaterialSetFrequency(ovrAudioMaterial material, ovrAudioMaterialProperty property, float frequency, float value);OVRA_EXPORT ovrResultovrAudio_AudioMaterialGetFrequency(const ovrAudioMaterial material, ovrAudioMaterialProperty property, float frequency, float* value);OVRA_EXPORT ovrResult ovrAudio_AudioMaterialReset(ovrAudioMaterial material, ovrAudioMaterialProperty property);/***********************************************************************************//* Serialization API */OVRA_EXPORT ovrResult ovrAudio_AudioGeometryWriteMeshData(const ovrAudioGeometry geometry, const ovrAudioSerializer* serializer);OVRA_EXPORT ovrResult ovrAudio_AudioGeometryReadMeshData(ovrAudioGeometry geometry, const ovrAudioSerializer* serializer);typedefenum {ovrAudioMaterialPreset_AcousticTile,ovrAudioMaterialPreset_Brick,ovrAudioMaterialPreset_BrickPainted,ovrAudioMaterialPreset_Carpet,ovrAudioMaterialPreset_CarpetHeavy,ovrAudioMaterialPreset_CarpetHeavyPadded,ovrAudioMaterialPreset_CeramicTile,ovrAudioMaterialPreset_Concrete,ovrAudioMaterialPreset_ConcreteRough,ovrAudioMaterialPreset_ConcreteBlock,ovrAudioMaterialPreset_ConcreteBlockPainted,ovrAudioMaterialPreset_Curtain,ovrAudioMaterialPreset_Foliage,ovrAudioMaterialPreset_Glass,ovrAudioMaterialPreset_GlassHeavy,ovrAudioMaterialPreset_Grass,ovrAudioMaterialPreset_Gravel,ovrAudioMaterialPreset_GypsumBoard,ovrAudioMaterialPreset_PlasterOnBrick,ovrAudioMaterialPreset_PlasterOnConcreteBlock,ovrAudioMaterialPreset_Soil,ovrAudioMaterialPreset_SoundProof,ovrAudioMaterialPreset_Snow,ovrAudioMaterialPreset_Steel,ovrAudioMaterialPreset_Water,ovrAudioMaterialPreset_WoodThin,ovrAudioMaterialPreset_WoodThick,ovrAudioMaterialPreset_WoodFloor,ovrAudioMaterialPreset_WoodOnConcrete,ovrAudioMaterialPreset_COUNT} ovrAudioMaterialPreset;inline ovrResult ovrAudio_GetReflectionBands(ovrAudioMaterialPreset Preset, AudioBands Bands) {if (Preset >= ovrAudioMaterialPreset_COUNT || Bands == NULL) {return ovrError_AudioInvalidParam;}switch (Preset) {case ovrAudioMaterialPreset_AcousticTile:Bands[0] = 0.488168418f;Bands[1] = 0.361475229f;Bands[2] = 0.339595377f;Bands[3] = 0.498946249f;break;case ovrAudioMaterialPreset_Brick:Bands[0] = 0.975468814f;Bands[1] = 0.972064495f;Bands[2] = 0.949180186f;Bands[3] = 0.930105388f;break;case ovrAudioMaterialPreset_BrickPainted:Bands[0] = 0.975710571f;Bands[1] = 0.983324170f;Bands[2] = 0.978116691f;Bands[3] = 0.970052719f;break;case ovrAudioMaterialPreset_Carpet:Bands[0] = 0.987633705f;Bands[1] = 0.905486643f;Bands[2] = 0.583110571f;Bands[3] = 0.351053834f;break;case ovrAudioMaterialPreset_CarpetHeavy:Bands[0] = 0.977633715f;Bands[1] = 0.859082878f;Bands[2] = 0.526479602f;Bands[3] = 0.370790422f;break;case ovrAudioMaterialPreset_CarpetHeavyPadded:Bands[0] = 0.910534739f;Bands[1] = 0.530433178f;Bands[2] = 0.294055820f;Bands[3] = 0.270105422f;break;case ovrAudioMaterialPreset_CeramicTile:Bands[0] = 0.990000010f;Bands[1] = 0.990000010f;Bands[2] = 0.982753932f;Bands[3] = 0.980000019f;break;case ovrAudioMaterialPreset_Concrete:Bands[0] = 0.990000010f;Bands[1] = 0.983324170f;Bands[2] = 0.980000019f;Bands[3] = 0.980000019f;break;case ovrAudioMaterialPreset_ConcreteRough:Bands[0] = 0.989408433f;Bands[1] = 0.964494646f;Bands[2] = 0.922127008f;Bands[3] = 0.900105357f;break;case ovrAudioMaterialPreset_ConcreteBlock:Bands[0] = 0.635267377f;Bands[1] = 0.652230680f;Bands[2] = 0.671053469f;Bands[3] = 0.789051592f;break;case ovrAudioMaterialPreset_ConcreteBlockPainted:Bands[0] = 0.902957916f;Bands[1] = 0.940235913f;Bands[2] = 0.917584062f;Bands[3] = 0.919947326f;break;case ovrAudioMaterialPreset_Curtain:Bands[0] = 0.686494231f;Bands[1] = 0.545859993f;Bands[2] = 0.310078561f;Bands[3] = 0.399473131f;break;case ovrAudioMaterialPreset_Foliage:Bands[0] = 0.518259346f;Bands[1] = 0.503568292f;Bands[2] = 0.578688800f;Bands[3] = 0.690210819f;break;case ovrAudioMaterialPreset_Glass:Bands[0] = 0.655915797f;Bands[1] = 0.800631821f;Bands[2] = 0.918839693f;Bands[3] = 0.923488140f;break;case ovrAudioMaterialPreset_GlassHeavy:Bands[0] = 0.827098966f;Bands[1] = 0.950222731f;Bands[2] = 0.974604130f;Bands[3] = 0.980000019f;break;case ovrAudioMaterialPreset_Grass:Bands[0] = 0.881126285f;Bands[1] = 0.507170796f;Bands[2] = 0.131893098f;Bands[3] = 0.0103688836f;break;case ovrAudioMaterialPreset_Gravel:Bands[0] = 0.729294717f;Bands[1] = 0.373122454f;Bands[2] = 0.255317450f;Bands[3] = 0.200263441f;break;case ovrAudioMaterialPreset_GypsumBoard:Bands[0] = 0.721240044f;Bands[1] = 0.927690148f;Bands[2] = 0.934302270f;Bands[3] = 0.910105407f;break;case ovrAudioMaterialPreset_PlasterOnBrick:Bands[0] = 0.975696504f;Bands[1] = 0.979106009f;Bands[2] = 0.961063504f;Bands[3] = 0.950052679f;break;case ovrAudioMaterialPreset_PlasterOnConcreteBlock:Bands[0] = 0.881774724f;Bands[1] = 0.924773932f;Bands[2] = 0.951497555f;Bands[3] = 0.959947288f;break;case ovrAudioMaterialPreset_Soil:Bands[0] = 0.844084203f;Bands[1] = 0.634624243f;Bands[2] = 0.416662872f;Bands[3] = 0.400000036f;break;case ovrAudioMaterialPreset_SoundProof:Bands[0] = 0.000000000f;Bands[1] = 0.000000000f;Bands[2] = 0.000000000f;Bands[3] = 0.000000000f;break;case ovrAudioMaterialPreset_Snow:Bands[0] = 0.532252669f;Bands[1] = 0.154535770f;Bands[2] = 0.0509644151f;Bands[3] = 0.0500000119f;break;case ovrAudioMaterialPreset_Steel:Bands[0] = 0.793111682f;Bands[1] = 0.840140402f;Bands[2] = 0.925591767f;Bands[3] = 0.979736567f;break;case ovrAudioMaterialPreset_Water:Bands[0] = 0.970588267f;Bands[1] = 0.971753478f;Bands[2] = 0.978309572f;Bands[3] = 0.970052719f;break;case ovrAudioMaterialPreset_WoodThin:Bands[0] = 0.592423141f;Bands[1] = 0.858273327f;Bands[2] = 0.917242289f;Bands[3] = 0.939999998f;break;case ovrAudioMaterialPreset_WoodThick:Bands[0] = 0.812957883f;Bands[1] = 0.895329595f;Bands[2] = 0.941304684f;Bands[3] = 0.949947298f;break;case ovrAudioMaterialPreset_WoodFloor:Bands[0] = 0.852366328f;Bands[1] = 0.898992121f;Bands[2] = 0.934784114f;Bands[3] = 0.930052698f;break;case ovrAudioMaterialPreset_WoodOnConcrete:Bands[0] = 0.959999979f;Bands[1] = 0.941232264f;Bands[2] = 0.937923789f;Bands[3] = 0.930052698f;break;case ovrAudioMaterialPreset_COUNT:default:Bands[0] = 0.000000000f;Bands[1] = 0.000000000f;Bands[2] = 0.000000000f;Bands[3] = 0.000000000f;return ovrError_AudioInvalidParam;};return ovrSuccess;}#ifdef __cplusplus}#endif#endif // OVR_Audio_h
Did you find this page helpful?