This website uses cookies to improve our services and deliver relevant ads.
By interacting with this site, you agree to this use. For more information, see our Cookies Policy

Audio 1.36 Reference Guide

OVR_Audio.h File Reference

OVR Audio SDK public header file.

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
#define
OVR_AUDIO_MAJOR_VERSION
#define
OVR_AUDIO_MINOR_VERSION
#define
OVR_AUDIO_PATCH_VERSION

Enumerations

enum
ovrAudioError {
}
Enumerates error codes that can be returned by OVRAudio.
enum
ovrAudioSourceFlag {
}
Audio source flags.
enum
ovrAudioSourceAttenuationMode {
}
Audio source attenuation mode.
enum
ovrAudioEnable {
}
Global boolean flags.
enum
ovrAudioReflectionModel {
}
Explicit override to select reflection and reverb system.
enum
ovrAudioHRTFInterpolationMethod {
}
Internal use only.
enum
ovrAudioSpatializationStatus {
}
Status mask returned by spatializer APIs.
enum
ovrAudioHeadphones {
}
Headphone models used for correction.
enum
ovrAudioPerformanceCounter {
}
Performance counter enumerants.
enum
ovrAudioAmbisonicFormat {
}
Ambisonic formats.
enum
ovrAudioAmbisonicSpeakerLayout {
}
Virtual speaker layouts for ambisonics.

Typedefs

int32_t
struct ovrPosef_
struct ovrPoseStatef_
struct ovrAudioSource_
Opaque type definitions for audio source and context.
struct ovrAudioContext_ *
struct ovrAudioAmbisonicStream_ *
void *

Functions

ovrResult
DEPRECATED Initialize OVRAudio.
void
DEPRECATED Shutdown OVRAudio.
OVRA_EXPORT const char *
ovrAudio_GetVersion ( int * Major, int * Minor, int * Patch )
Return library's built version information.
OVRA_EXPORT float *
ovrAudio_AllocSamples ( int NumSamples )
Allocate properly aligned buffer to store samples.
OVRA_EXPORT void
ovrAudio_FreeSamples ( float * Samples )
Free previously allocated buffer.
OVRA_EXPORT ovrResult
ovrAudio_GetTransformFromPose ( const ovrPosef * Pose, float * Vx, float * Vy, float * Vz, float * Pos )
Retrieve a transformation from an ovrPosef.
OVRA_EXPORT ovrResult
ovrAudio_CreateContext ( ovrAudioContext * pContext, const ovrAudioContextConfiguration * pConfig )
Create an audio context for spatializing incoming sounds.
OVRA_EXPORT ovrResult
ovrAudio_InitializeContext ( ovrAudioContext Context, const ovrAudioContextConfiguration * pConfig )
OVRA_EXPORT void
ovrAudio_DestroyContext ( ovrAudioContext Context )
Destroy a previously created audio context.
OVRA_EXPORT ovrResult
ovrAudio_Enable ( ovrAudioContext Context, ovrAudioEnable What, int Enable )
Enable/disable options in the audio context.
OVRA_EXPORT ovrResult
ovrAudio_IsEnabled ( ovrAudioContext Context, ovrAudioEnable What, int * pEnabled )
Query option status in the audio context.
OVRA_EXPORT ovrResult
ovrAudio_SetUnitScale ( ovrAudioContext Context, float UnitScale )
Set the unit scale of game units relative to meters.
OVRA_EXPORT ovrResult
ovrAudio_GetUnitScale ( ovrAudioContext Context, float * UnitScale )
Get the unit scale of game units relative to meters.
OVRA_EXPORT ovrResult
ovrAudio_SetHRTFInterpolationMethod ( ovrAudioContext Context, ovrAudioHRTFInterpolationMethod InterpolationMethod )
Set HRTF interpolation method.
OVRA_EXPORT ovrResult
ovrAudio_GetHRTFInterpolationMethod ( ovrAudioContext Context, ovrAudioHRTFInterpolationMethod * pInterpolationMethod )
Get HRTF interpolation method.
OVRA_EXPORT ovrResult
ovrAudio_SetSimpleBoxRoomParameters ( ovrAudioContext Context, const ovrAudioBoxRoomParameters * Parameters )
Set box room parameters for reverberation.
OVRA_EXPORT ovrResult
ovrAudio_GetSimpleBoxRoomParameters ( ovrAudioContext Context, ovrAudioBoxRoomParameters * Parameters )
Get box room parameters for current reverberation.
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)
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.
OVRA_EXPORT ovrResult
ovrAudio_SetListenerPoseStatef ( ovrAudioContext Context, const ovrPoseStatef * PoseState )
Sets the listener's pose state.
OVRA_EXPORT ovrResult
ovrAudio_ResetAudioSource ( ovrAudioContext Context, int Sound )
Reset an audio source's state.
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).
OVRA_EXPORT ovrResult
ovrAudio_GetAudioSourcePos ( ovrAudioContext Context, int Sound, float * pX, float * pY, float * pZ )
Gets the position of an audio source.
OVRA_EXPORT ovrResult
ovrAudio_SetAudioSourceRange ( ovrAudioContext Context, int Sound, float RangeMin, float RangeMax )
Sets the min and max range of the audio source.
OVRA_EXPORT ovrResult
ovrAudio_GetAudioSourceRange ( ovrAudioContext Context, int Sound, float * pRangeMin, float * pRangeMax )
Gets the min and max range of the audio source.
OVRA_EXPORT ovrResult
ovrAudio_SetAudioSourceRadius ( ovrAudioContext Context, int Sound, float Radius )
Sets the radius of the audio source for volumetric sound sources.
OVRA_EXPORT ovrResult
ovrAudio_GetAudioSourceRadius ( ovrAudioContext Context, int Sound, float * pRadius )
Gets the radius of the audio source for volumetric sound sources.
OVRA_EXPORT ovrResult
ovrAudio_SetAudioReverbSendLevel ( ovrAudioContext Context, int Sound, float Level )
Sets the reverb wet send level for audio source.
OVRA_EXPORT ovrResult
ovrAudio_GetAudioReverbSendLevel ( ovrAudioContext Context, int Sound, float * pLevel )
Gets the the reverb wet send level for audio source.
OVRA_EXPORT ovrResult
ovrAudio_SetAudioSourceFlags ( ovrAudioContext Context, int Sound, uint32_t Flags )
Sets an audio source's flags.
OVRA_EXPORT ovrResult
ovrAudio_GetAudioSourceFlags ( ovrAudioContext Context, int Sound, uint32_t * pFlags )
Gets an audio source's flags.
OVRA_EXPORT ovrResult
ovrAudio_SetAudioSourceAttenuationMode ( ovrAudioContext Context, int Sound, ovrAudioSourceAttenuationMode Mode, float FixedScale )
Set the attenuation mode for a sound source.
OVRA_EXPORT ovrResult
ovrAudio_GetAudioSourceAttenuationMode ( ovrAudioContext Context, int Sound, ovrAudioSourceAttenuationMode * pMode, float * pFixedScale )
Get the attenuation mode for a sound source.
OVRA_EXPORT ovrResult
ovrAudio_GetAudioSourceOverallGain ( ovrAudioContext Context, int Sound, float * Gain )
Get the overall gain for a sound source.
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.
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.
OVRA_EXPORT ovrResult
ovrAudio_SetHeadphoneModel ( ovrAudioContext Context, ovrAudioHeadphones Model, const float * ImpulseResponse, int NumSamples )
Set the headphone model used by the headphone correction algorithm.
OVRA_EXPORT ovrResult
ovrAudio_GetHeadphoneModel ( ovrAudioContext Context, ovrAudioHeadphones * pModel, const float ** pImpulseResponse, int * pNumSamples )
Get the headphone model used by the headphone correction algorithm.
OVRA_EXPORT ovrResult
ovrAudio_MixInSharedReverbLR ( ovrAudioContext Context, uint32_t * OutStatus, float * DstLeft, float * DstRight )
Mix shared reverb into buffer.
OVRA_EXPORT ovrResult
ovrAudio_MixInSharedReverbInterleaved ( ovrAudioContext Context, uint32_t * OutStatus, float * DstInterleaved )
Mix shared reverb into interleaved buffer.
OVRA_EXPORT ovrResult
ovrAudio_SetSharedReverbWetLevel ( ovrAudioContext Context, const float Level )
Set shared reverb wet level.
OVRA_EXPORT ovrResult
ovrAudio_GetSharedReverbWetLevel ( ovrAudioContext Context, float * Level )
Get shared reverb wet level.
OVRA_EXPORT ovrResult
ovrAudio_SetSharedReverbRange ( ovrAudioContext Context, float RangeMin, float RangeMax )
Sets the min and max range of the shared reverb.
OVRA_EXPORT ovrResult
ovrAudio_GetSharedReverbRange ( ovrAudioContext Context, float * pRangeMin, float * pRangeMax )
Gets the min and max range of the shared reverb.
OVRA_EXPORT ovrResult
ovrAudio_SetHeadRadius ( ovrAudioContext Context, float HeadRadius )
Set user headRadius.
OVRA_EXPORT ovrResult
ovrAudio_GetHeadRadius ( ovrAudioContext Context, float * HeadRadius )
Set user configuration.
OVRA_EXPORT ovrResult
ovrAudio_GetPerformanceCounter ( ovrAudioContext Context, ovrAudioPerformanceCounter Counter, int64_t * Count, double * TimeMicroSeconds )
Retrieve a performance counter.
OVRA_EXPORT ovrResult
ovrAudio_ResetPerformanceCounter ( ovrAudioContext Context, ovrAudioPerformanceCounter Counter )
Reset a performance 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 )
Quad-binaural spatialization.
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.
OVRA_EXPORT ovrResult
ovrAudio_ResetAmbisonicStream ( ovrAudioAmbisonicStream AmbisonicStream )
Reset a previously created ambisonic stream for re-use.
OVRA_EXPORT ovrResult
ovrAudio_DestroyAmbisonicStream ( ovrAudioAmbisonicStream AmbisonicStream )
Destroy a previously created ambisonic stream.
OVRA_EXPORT ovrResult
ovrAudio_SetAmbisonicSpeakerLayout ( ovrAudioAmbisonicStream AmbisonicStream, ovrAudioAmbisonicSpeakerLayout Layout )
Sets the virtual speaker layout for the ambisonic stream.
OVRA_EXPORT ovrResult
ovrAudio_GetAmbisonicSpeakerLayout ( ovrAudioAmbisonicStream AmbisonicStream, ovrAudioAmbisonicSpeakerLayout * Layout )
Sets the virtual speaker layout for the 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.
OVRA_EXPORT ovrResult
ovrAudio_RenderAmbisonicSpeakerFeed ( const float * InAmbisonics, float DirectionX, float DirectionY, float DirectionZ, ovrAudioAmbisonicFormat Format, int AmbisonicOrder, float * SpeakerFeed, int NumSamples )
Render a speaker feed from ambisonics.
OVRA_EXPORT ovrResult
ovrAudio_ProcessAmbisonicStreamInterleaved ( ovrAudioContext Context, ovrAudioAmbisonicStream AmbisonicStream, const float * Src, float * Dst, int NumSamples )
Spatialize ambisonic stream.
OVRA_EXPORT ovrResult
ovrAudio_SetAmbisonicOrientation ( ovrAudioAmbisonicStream AmbisonicStream, float LookDirectionX, float LookDirectionY, float LookDirectionZ, float UpDirectionX, float UpDirectionY, float UpDirectionZ )
Set orientation for ambisonic stream.
OVRA_EXPORT ovrResult
ovrAudio_GetAmbisonicOrientation ( ovrAudioAmbisonicStream AmbisonicStream, float * pLookDirectionX, float * pLookDirectionY, float * pLookDirectionZ, float * pUpDirectionX, float * pUpDirectionY, float * pUpDirectionZ )
Get orientation for ambisonic stream.
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.
OVRA_EXPORT ovrResult
ovrAudio_SetProfilerPort ( ovrAudioContext , int Port )
Set the network port for the Oculus Audio profiler.
OVRA_EXPORT ovrResult
ovrAudio_SetReflectionModel ( ovrAudioContext Context, ovrAudioReflectionModel Model )
Explicitly set the reflection model, this can be used to A/B test the algorithms.
OVRA_EXPORT ovrResult
ovrAudio_AssignRaycastCallback ( ovrAudioContext Context, OVRA_RAYCAST_CALLBACK Callback, void * pctx )
Assign a callback for raycasting into the game geometry.
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.
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.
OVRA_EXPORT ovrResult
ovrAudio_SetDynamicRoomMaxWallDistance ( ovrAudioContext Context, float MaxWallDistance )
Set the maximum distance to the wall for dynamic room modeling to constrain the size.
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.
OVRA_EXPORT ovrResult
ovrAudio_UpdateRoomModel ( ovrAudioContext Context, float WetLevel )
Update the dynamic room modeling, this will fire the ray cast calback and update the size of the room.
OVRA_EXPORT ovrResult
ovrAudio_GetRoomDimensions ( ovrAudioContext Context, float RoomDimensions, float ReflectionsCoefs, ovrAudioVector3f * Position )
Retrieves the dimensions of the dynamic room moel.
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.
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 )

Detailed Description

Copyright (c) Facebook Technologies, LLC and its affiliates. All rights reserved.

Macros Documentation

#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
#define OVR_AUDIO_MAJOR_VERSION
#define OVR_AUDIO_MINOR_VERSION
#define OVR_AUDIO_PATCH_VERSION

Enumeration Type Documentation

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.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_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.ovrAudioHRTFInterpolationMethod
Internal use only.
Enumerator
ovrAudioHRTFInterpolationMethod_Nearest
ovrAudioHRTFInterpolationMethod_SimpleTimeDomain
ovrAudioHRTFInterpolationMethod_MinPhaseTimeDomain
ovrAudioHRTFInterpolationMethod_PhaseTruncation
ovrAudioHRTFInterpolationMethod_PhaseLerp
ovrAudioHRTFInterpolationMethod_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.ovrAudioHeadphones
Headphone models used for correction.
Enumerator
ovrAudioHeadphones_None
No correction applied.
ovrAudioHeadphones_Rift
Apply correction for default headphones on Rift.
ovrAudioHeadphones_Rift_INTERNAL0
Apply correction for default headphones on Rift.
ovrAudioHeadphones_Rift_INTERNAL1
Apply correction for default headphones on Rift.
ovrAudioHeadphones_Rift_INTERNAL2
Apply correction for default headphones on Rift.
ovrAudioHeadphones_Rift_INTERNAL3
Apply correction for default headphones on Rift.
ovrAudioHeadphones_Rift_INTERNAL4
Apply correction for default headphones on Rift.
ovrAudioHeadphones_Custom
Apply correction using custom IR.
ovrAudioHeadphones_COUNT
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_HeadphoneCorrection
Retrieve profiling information for headphone correction.
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.ovrAudioAmbisonicSpeakerLayout
Virtual speaker layouts for ambisonics.
Enumerator
ovrAudioAmbisonicSpeakerLayout_FrontOnly
A single virtual speaker in-front of listener.
ovrAudioAmbisonicSpeakerLayout_Octahedron
6 virtual speakers
ovrAudioAmbisonicSpeakerLayout_Cube
8 virtual speakers
ovrAudioAmbisonicSpeakerLayout_Icosahedron
12 virtual speakers
ovrAudioAmbisonicSpeakerLayout_Dodecahedron
20 virtual speakers
ovrAudioAmbisonicSpeakerLayout_20PointElectron
20 virtual speakers more evenly distributed over sphere
ovrAudioAmbisonicSpeakerLayout_SphericalHarmonics
(default) Uses a spherical harmonic representation of HRTF instead of virtual speakers
ovrAudioAmbisonicSpeakerLayout_Mono
Plays the W (omni) channel through left and right with no spatialization.

Typedef Documentation

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

Function Documentation

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_GetTransformFromPose ( const ovrPosef * Pose, float * Vx, float * Vy, float * Vz, float * Pos )
Retrieve a transformation from an ovrPosef.
Parameters
Pose[in]
pose to fetch transform from
Vx[out]
buffer to store orientation vector X
Vy[out]
buffer to store orientation vector Y
Vz[out]
buffer to store orientation vector Z
Pos[out]
buffer to store position
Returns an ovrResult indicating success or failure
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 )
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_SetHRTFInterpolationMethod ( ovrAudioContext Context, ovrAudioHRTFInterpolationMethod InterpolationMethod )
Set HRTF interpolation method.
NOTE: Internal use only!
Parameters
Context
context to use
InterpolationMethod
method to use
OVRA_EXPORT ovrResult ovrAudio_GetHRTFInterpolationMethod ( ovrAudioContext Context, ovrAudioHRTFInterpolationMethod * pInterpolationMethod )
Get HRTF interpolation method.
NOTE: Internal use only!
Parameters
Context
context to use
InterpolationMethod
method to use
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.
Width/Height/Depth default is 11/10/9m Reflection constants default to 0.25
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[in]
pointer to returned ovrAudioBoxRoomParameters box description
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_SetListenerPoseStatef ( ovrAudioContext Context, const ovrPoseStatef * PoseState )
Sets the listener's pose state.
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
PoseState[in]
listener's pose state as returned by LibOVR
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
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
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
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
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
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
OVRA_EXPORT ovrResult ovrAudio_SetAudioReverbSendLevel ( ovrAudioContext Context, int Sound, float Level )
Sets the reverb wet 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
OVRA_EXPORT ovrResult ovrAudio_GetAudioReverbSendLevel ( ovrAudioContext Context, int Sound, float * pLevel )
Gets the the reverb wet 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
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 FixedScale )
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 * pFixedScale )
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)
InFlags[in]
spatialization flags to apply
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)
InFlags[in]
spatialization flags to apply
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_SetHeadphoneModel ( ovrAudioContext Context, ovrAudioHeadphones Model, const float * ImpulseResponse, int NumSamples )
Set the headphone model used by the headphone correction algorithm.
Parameters
Context[in]
context to use
Model[in]
model to use
ImpulseResponse[in]
impulse response to use
NumSamples[in]
size of impulse response in samples
Returns an ovrResult indicating success or failure
See Also:
ovrAudio_ApplyHeadphoneCorrection
OVRA_EXPORT ovrResult ovrAudio_GetHeadphoneModel ( ovrAudioContext Context, ovrAudioHeadphones * pModel, const float ** pImpulseResponse, int * pNumSamples )
Get the headphone model used by the headphone correction algorithm.
Parameters
Context[in]
context to use
pModel[in]
addr of returned model used
pImpulseResponse[in]
addr of returned impulse response used (as a readonly buffer)
pNumSamples[in]
addr of returned size of impulse response in samples
Returns an ovrResult indicating success or failure
See Also:
ovrAudio_ApplyHeadphoneCorrection
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
InFlags[in]
spatialization flags to apply
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_SetSharedReverbRange ( ovrAudioContext Context, float RangeMin, float RangeMax )
Sets the min and max range of the shared reverb.
Parameters
Context
context to use
RangeMin
min range in meters (full gain)
RangeMax
max range in meters
Returns an ovrResult indicating success or failure
OVRA_EXPORT ovrResult ovrAudio_GetSharedReverbRange ( ovrAudioContext Context, float * pRangeMin, float * pRangeMax )
Gets the min and max range of the shared reverb.
Parameters
Context
context to use
pRangeMin
addr of the returned min range in meters (full gain)
pRangeMax
addr of the returned max range in meters
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_SetAmbisonicSpeakerLayout ( ovrAudioAmbisonicStream AmbisonicStream, ovrAudioAmbisonicSpeakerLayout Layout )
Sets the virtual speaker layout for the ambisonic stream.
Parameters
Context
a valid ambisonic stream
OVRA_EXPORT ovrResult ovrAudio_GetAmbisonicSpeakerLayout ( ovrAudioAmbisonicStream AmbisonicStream, ovrAudioAmbisonicSpeakerLayout * Layout )
Sets the virtual speaker layout 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_RenderAmbisonicSpeakerFeed ( const float * InAmbisonics, float DirectionX, float DirectionY, float DirectionZ, ovrAudioAmbisonicFormat Format, int AmbisonicOrder, float * SpeakerFeed, int NumSamples )
Render a speaker feed from ambisonics.
Parameters
InAmbisonics[in]
Interleaved ambisonic audio buffer to render (4 channels for 1st order, 9 channels for second order)
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)
OutSpeakerFeed[out]
Buffer to write speaker feed to
NumSamples[in]
Length of the buffer in frames (OutSpeakerFeed is this length, InAmbisonics 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 4 channel interleaved B-format floating point 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_UpdateRoomModel ( ovrAudioContext Context, float WetLevel )
Update the dynamic room modeling, this will fire the ray cast calback and update the size of the room.
Parameters
Context[in]
context to use
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 )
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 )
1
6
7
8
9
10
11
12
13
14
15
16
17
19
20
21
22
23
25
26
27
28
29
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
102
103
104
105
106
107
108
109
110
111
115
116
117
118
119
120
121
122
123
124
125
129
130
131
132
133
134
135
136
137
138
139
143
144
145
146
147
148
149
150
151
152
153
154
155
161
162
163
164
165
166
167
168
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
191
192
193
194
195
196
197
198
199
200
202
203
204
205
206
207
208
213
214
215
216
217
218
219
220
221
222
223
224
225
227
228
229
230
231
233
234
236
237
247
248
258
259
268
269
279
280
281
282
289
290
291
292
293
294
295
296
307
308
309
310
311
312
318
319
327
328
329
330
338
339
340
341
346
347
352
353
360
361
362
369
370
371
375
376
377
378
379
380
381
382
383
398
399
400
409
410
411
412
431
432
433
434
435
450
451
452
453
454
465
466
467
468
469
470
481
482
494
495
496
497
509
510
511
512
523
524
525
526
538
539
540
541
551
552
553
554
565
566
567
568
578
579
580
581
592
593
594
595
603
604
605
606
614
615
616
617
628
629
630
631
632
643
644
645
646
647
658
659
660
661
674
675
676
677
678
692
693
694
695
696
697
707
708
709
710
720
721
722
723
733
734
735
736
737
745
746
747
748
755
756
757
764
765
766
776
777
778
789
790
791
799
800
801
809
810
811
821
822
823
824
825
832
833
834
847
848
849
850
857
858
859
860
861
862
863
868
869
875
876
882
883
889
890
902
903
915
916
922
923
933
934
935
936
946
947
948
949
955
956
962
963
970
971
972
979
980
986
987
988
994
995
1001
1002
1008
1009
1014
1015
1023
1024
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1408
/********************************************************************************/
#ifndef OVR_Audio_h
#define OVR_Audio_h

#include <stdint.h>

#include "OVR_Audio_DynamicRoom.h"
#include "OVR_Audio_Propagation.h"

#ifdef __cplusplus
extern"C" {
#endif

#ifndef OVR_RESULT_DEFINED
#define OVR_RESULT_DEFINED
typedef int32_t ovrResult;
#endif

#ifndef OVR_SUCCESS_DEFINED
#define OVR_SUCCESS_DEFINED
#define ovrSuccess 0
#endif

typedefenum
{
   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_h
typedefstruct ovrPosef_ ovrPosef;
typedefstruct ovrPoseStatef_ ovrPoseStatef;
#endif

#define OVR_AUDIO_MAJOR_VERSION 1
#define OVR_AUDIO_MINOR_VERSION 36
#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 
#define FUNC_NAME __func__
#elif defined __linux__
#define OVRA_EXPORT __attribute__((visibility("default")))
#define FUNC_NAME __func__
#else
#error not implemented
#endif


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, 
#endif

  ovrAudioSourceFlag_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_COUNT
} ovrAudioEnable;


typedefenum
{
    ovrAudioReflectionModel_StaticShoeBox       = 0,    
    ovrAudioReflectionModel_DynamicRoomModeling = 1,    
    ovrAudioReflectionModel_PropagationSystem   = 2,    
    ovrAudioReflectionModel_Automatic           = 3,    


    ovrAudioReflectionModel_COUNT
} ovrAudioReflectionModel;

typedefenum
{

  ovrAudioHRTFInterpolationMethod_Nearest,
  ovrAudioHRTFInterpolationMethod_SimpleTimeDomain,
  ovrAudioHRTFInterpolationMethod_MinPhaseTimeDomain,
  ovrAudioHRTFInterpolationMethod_PhaseTruncation,
  ovrAudioHRTFInterpolationMethod_PhaseLerp,

  ovrAudioHRTFInterpolationMethod_COUNT

} ovrAudioHRTFInterpolationMethod;

typedefenum
{
  ovrAudioSpatializationStatus_None      = 0x00,  
  ovrAudioSpatializationStatus_Finished  = 0x01,  
  ovrAudioSpatializationStatus_Working   = 0x02,  

} ovrAudioSpatializationStatus;

typedefenum
{
    ovrAudioHeadphones_None           = -1,  
    ovrAudioHeadphones_Rift           = 0,   
    ovrAudioHeadphones_Rift_INTERNAL0 = 1,   
    ovrAudioHeadphones_Rift_INTERNAL1 = 2,   
    ovrAudioHeadphones_Rift_INTERNAL2 = 3,   
    ovrAudioHeadphones_Rift_INTERNAL3 = 4,   
    ovrAudioHeadphones_Rift_INTERNAL4 = 5,   

    ovrAudioHeadphones_Custom         = 10,  

    ovrAudioHeadphones_COUNT
} ovrAudioHeadphones;

typedefenum
{
    ovrAudioPerformanceCounter_Spatialization            = 0,  
    ovrAudioPerformanceCounter_SharedReverb              = 1,  
    ovrAudioPerformanceCounter_HeadphoneCorrection       = 2,  

    ovrAudioPerformanceCounter_COUNT
} ovrAudioPerformanceCounter;


typedefenum
{
    ovrAudioAmbisonicFormat_FuMa, 
    ovrAudioAmbisonicFormat_AmbiX 
} ovrAudioAmbisonicFormat;


typedefenum
{
    ovrAudioAmbisonicSpeakerLayout_FrontOnly           =  0, 
    ovrAudioAmbisonicSpeakerLayout_Octahedron          =  1, 
    ovrAudioAmbisonicSpeakerLayout_Cube                =  2, 
    ovrAudioAmbisonicSpeakerLayout_Icosahedron         =  3, 
    ovrAudioAmbisonicSpeakerLayout_Dodecahedron        =  4, 
    ovrAudioAmbisonicSpeakerLayout_20PointElectron     =  5, 
    ovrAudioAmbisonicSpeakerLayout_SphericalHarmonics  = -1, 
    ovrAudioAmbisonicSpeakerLayout_Mono                = -2  
} ovrAudioAmbisonicSpeakerLayout;


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 );

OVRA_EXPORT ovrResult ovrAudio_GetTransformFromPose( const ovrPosef *Pose, 
float *Vx, float *Vy, float *Vz,
float *Pos );

typedefstruct _ovrAudioContextConfig
{
  uint32_t   acc_Size;              
  uint32_t   acc_MaxNumSources;     
  uint32_t   acc_SampleRate;        
  uint32_t   acc_BufferLength;      
} 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);

OVRA_EXPORT ovrResult ovrAudio_SetHRTFInterpolationMethod( ovrAudioContext Context, 
                                                             ovrAudioHRTFInterpolationMethod InterpolationMethod );

OVRA_EXPORT ovrResult ovrAudio_GetHRTFInterpolationMethod( ovrAudioContext Context, 
                                                            ovrAudioHRTFInterpolationMethod* pInterpolationMethod );

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 );


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_SetListenerPoseStatef( ovrAudioContext Context, 
const ovrPoseStatef *PoseState );

// Note: there is no ovrAudio_GetListenerPoseStatef() since the pose data is not cached internally.
// Use ovrAudio_GetListenerVectors() instead to get the listener's position and orientation info.

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_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 FixedScale );

OVRA_EXPORT ovrResult ovrAudio_GetAudioSourceAttenuationMode( ovrAudioContext Context, 
int Sound, 
                                                              ovrAudioSourceAttenuationMode* pMode, 
float* pFixedScale );

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, constfloat *Src );

OVRA_EXPORT ovrResult ovrAudio_SpatializeMonoSourceLR( ovrAudioContext Context, 
int Sound, 
                                                 uint32_t *OutStatus, 
float *DstLeft, float *DstRight, 
constfloat *Src );

OVRA_EXPORT ovrResult ovrAudio_SetHeadphoneModel( ovrAudioContext Context, 
                                            ovrAudioHeadphones Model,
constfloat *ImpulseResponse, int NumSamples );

OVRA_EXPORT ovrResult ovrAudio_GetHeadphoneModel( ovrAudioContext Context, 
                                            ovrAudioHeadphones* pModel,
constfloat** pImpulseResponse, int* pNumSamples );

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_SetSharedReverbRange( ovrAudioContext Context,
float RangeMin, float RangeMax );

OVRA_EXPORT ovrResult ovrAudio_GetSharedReverbRange( ovrAudioContext Context,
float* pRangeMin, float* pRangeMax );

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(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_SetAmbisonicSpeakerLayout(ovrAudioAmbisonicStream AmbisonicStream, ovrAudioAmbisonicSpeakerLayout Layout);

OVRA_EXPORT ovrResult ovrAudio_GetAmbisonicSpeakerLayout(ovrAudioAmbisonicStream AmbisonicStream, ovrAudioAmbisonicSpeakerLayout* Layout);

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_RenderAmbisonicSpeakerFeed(constfloat* InAmbisonics, float DirectionX, float DirectionY, float DirectionZ, ovrAudioAmbisonicFormat Format, int AmbisonicOrder, float* SpeakerFeed, 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 ovrResult ovrAudio_UpdateRoomModel(ovrAudioContext Context, float WetLevel);

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);

// 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 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);

/***********************************************************************************/
/* Serialization API */

OVRA_EXPORT ovrResult ovrAudio_AudioGeometryWriteMeshData(const ovrAudioGeometry geometry, const ovrAudioSerializer* serializer);
OVRA_EXPORT ovrResult ovrAudio_AudioGeometryReadMeshData(ovrAudioGeometry geometry, const ovrAudioSerializer* serializer);

#ifdef __cplusplus
}
#endif

#endif // OVR_Audio_h
The documentation for this file was generated from the following file: OVR_Audio.h