API reference
API reference
Select your platform
No SDKs available
No versions available

ovr_Voip_GetPCMWithTimestamp Function

Like ovr_Voip_GetPCM(), this function copies available audio samples into a provided buffer, but also stores the timestamp of the first sample in the output parameter 'timestamp'. This timestamp can be used for synchronization; see ovr_Voip_GetSyncTimestamp() for more details.
This function returns a number of samples copied. Note that it may return early, even if there's more data available, in order to keep the batch of audio samples with a single timestamp small; for example, if there's 30ms worth of audio in the buffer, this function may return 480 samples (10ms) each time it's called. Therefore, it's recommended to call this as long as there's data in the buffer (i.e. the function returns a non-zero result).

Signature

size_t ovr_Voip_GetPCMWithTimestamp(ovrID senderID, int16_t *outputBuffer, size_t outputBufferNumElements, uint32_t *timestamp)

Parameters

senderID: ovrID The ID of the user who sent the audio data.
outputBuffer: int16_t * A buffer to store the audio samples.
outputBufferNumElements: size_t The number of elements in the output buffer.
timestamp: uint32_t * A pointer to a uint32 variable that will store the timestamp of the first sample in the output buffer.

Returns

size_t