accept
(
userID
)
|
Accepts a VoIP connection from a given user.
Signature
static void com.meta.horizon.platform.ovr.requests.Voip.accept(long userID) Parameters userID: long
- The ID of the user to accept the VoIP connection from.
Returns void |
getIsConnectionUsingDtx
(
peerID
)
|
Gets whether or not a voice connection is using discontinuous transmission (DTX). Both sides must set to using DTX when their connection is established in order for this to be true. Returns unknown if there is no connection.
Signature
static VoipDtxState com.meta.horizon.platform.ovr.requests.Voip.getIsConnectionUsingDtx(long peerID) Parameters peerID: long
- The ID of the peer whose voice connection's DTX status is being queried.
Returns VoipDtxState
VoipDtxState
|
getLocalBitrate
(
peerID
)
|
Gets the current local bitrate used for the connection to the specified user. This is set by the current client. Returns unknown if there is no connection.
Signature
static VoipBitrate com.meta.horizon.platform.ovr.requests.Voip.getLocalBitrate(long peerID) Parameters peerID: long
- The ID of the peer whose local bitrate is being queried.
Returns VoipBitrate
VoipBitrate
|
getMicrophoneAvailability
()
|
Gets whether the microphone is currently available to the app. This can be used to show if the user's voice is able to be heard by other users. Returns a microphone availability state flag which determines whether it is available or not - com.meta.horizon.platform.ovr.models.MicrophoneAvailabilityState.
Signature
static Request<com.meta.horizon.platform.ovr.models.MicrophoneAvailabilityState> com.meta.horizon.platform.ovr.requests.Voip.getMicrophoneAvailability() |
getOutputBufferMaxSize
()
|
Returns the size of the internal ringbuffer used by the voip system in elements. This size is the maximum number of elements that can ever be returned by com.meta.horizon.platform.ovr.requests.Voip#getPCM.
This function can be safely called from any thread.
Signature
static long com.meta.horizon.platform.ovr.requests.Voip.getOutputBufferMaxSize() Returns long
long
|
getPCMSize
(
senderID
)
|
Returns the current number of audio samples available to read for the specified user. This function is inherently racy; it's possible that more data can be added between a call to this function and a subsequent call to com.meta.horizon.platform.ovr.requests.Voip#getPCM.
This function can be safely called from any thread.
Signature
static long com.meta.horizon.platform.ovr.requests.Voip.getPCMSize(long senderID) Parameters senderID: long
- The ID of the user to get the audio sample count for.
Returns long
long
|
getRemoteBitrate
(
peerID
)
|
Gets the current remote bitrate used for the connection to the specified user. This is set by the client on the other side of the connection. Returns unknown if there is no connection.
Signature
static VoipBitrate com.meta.horizon.platform.ovr.requests.Voip.getRemoteBitrate(long peerID) Parameters peerID: long
- The ID of the peer whose remote bitrate is being queried.
Returns VoipBitrate
VoipBitrate
|
getSyncTimestamp
(
userID
)
|
Returns a timestamp used for synchronizing audio samples sent to the given user with an external data stream.
Timestamps associated with audio frames are implicitly transmitted to remote peers; on the receiving side, they can be obtained by using com.meta.horizon.platform.ovr.requests.Voip#getPCMWithTimestamp. com.meta.horizon.platform.ovr.requests.Voip#getPCMWithTimestamp is used to fetch those timestamps on the sending side an application can insert the value returned by this function into each data packet and compare it to the value returned by GetPCMWithTimestamp() on the receiving side in order to determine the ordering of two events (sampling audio and composing a data packet).
Note: the timestamp is generated by an unspecified clock; it's doesn't generally represent wall-clock time. Use com.meta.horizon.platform.ovr.requests.Voip#getSyncTimestampDifference to convert the difference between two timestamps to microseconds.
This function assumes that a voice connection to the user already exists; it returns 0 if that isn't the case.
Signature
static long com.meta.horizon.platform.ovr.requests.Voip.getSyncTimestamp(long userID) Parameters userID: long
- he ID of the user to which the audio samples are being sent.
Returns long
long
|
getSyncTimestampDifference
(
lhs
, rhs
)
|
Calculates the difference between two sync timestamps, returned by either com.meta.horizon.platform.ovr.requests.Voip#getSyncTimestamp or com.meta.horizon.platform.ovr.requests.Voip#getPCMWithTimestamp, and converts it to microseconds.
Return value will be negative if lhs is smaller than rhs, zero if both timestamps are the same, and positive otherwise. The absolute value of the result is the time in microseconds between two sync timestamps.
Signature
static long com.meta.horizon.platform.ovr.requests.Voip.getSyncTimestampDifference(long lhs, long rhs) Parameters lhs: long
- The first sync timestamp to compare.
rhs: long
- The second sync timestamp to compare.
Returns long
long
|
getSystemVoipMicrophoneMuted
()
|
Returns SystemVoip microphone's mute state.
Signature
static VoipMuteState com.meta.horizon.platform.ovr.requests.Voip.getSystemVoipMicrophoneMuted() Returns VoipMuteState
VoipMuteState
|
getSystemVoipStatus
()
|
Returns SystemVoip status.
Signature
static SystemVoipStatus com.meta.horizon.platform.ovr.requests.Voip.getSystemVoipStatus() Returns SystemVoipStatus
SystemVoipStatus
|
setMicrophoneAvailabilityStateUpdateNotificationCallbacks
(
onSuccess
, onError
)
|
Indicates that the current microphone availability state has been updated. Use com.meta.horizon.platform.ovr.requests.Voip#getMicrophoneAvailability() to extract the microphone availability state.
Signature
static void com.meta.horizon.platform.ovr.requests.Voip.setMicrophoneAvailabilityStateUpdateNotificationCallbacks(Request.Handler< String > onSuccess, Request.Handler< Error > onError) Parameters onSuccess: Request.Handler< String >onError: Request.Handler< Error >Returns void |
setMicrophoneMuted
(
state
)
|
This function is used to enable or disable the local microphone. When muted, the microphone will not transmit any audio. Voip connections are unaffected by this state. New connections can be established or closed whether the microphone is muted or not. This can be used to implement push-to-talk, or a local mute button. The default state is unmuted.
This function can be safely called from any thread.
Signature
static void com.meta.horizon.platform.ovr.requests.Voip.setMicrophoneMuted(VoipMuteState state) Parameters state: VoipMuteState
- A value indicating whether to mute or unmute the local microphone.
Returns void |
setNewConnectionOptions
(
voipOptions
)
|
The options set for newly created connections to use. Existing connections will continue to use their current settings until they are destroyed and recreated.
Signature
static void com.meta.horizon.platform.ovr.requests.Voip.setNewConnectionOptions(VoipOptions voipOptions) Parameters Returns void |
setOutputSampleRate
(
rate
)
|
Sets the output sample rate. Audio data will be resampled as it is placed into the internal ringbuffer.
This function can be safely called from any thread.
Signature
static void com.meta.horizon.platform.ovr.requests.Voip.setOutputSampleRate(VoipSampleRate rate) Parameters rate: VoipSampleRate
- The new output sample rate to use.
Returns void |
setSystemVoipStateNotificationCallbacks
(
onSuccess
, onError
)
|
Sent to indicate that some part of the overall state of SystemVoip has changed. Use com.meta.horizon.platform.ovr.models.SystemVoipState#getStatus() and the properties of com.meta.horizon.platform.ovr.models.SystemVoipState to extract the state that triggered the notification. Note that the state may have changed further since the notification was generated, and that you may call the GetSystemVoip...() family of functions at any time to get the current state directly.
Signature
static void com.meta.horizon.platform.ovr.requests.Voip.setSystemVoipStateNotificationCallbacks(Request.Handler< SystemVoipState > onSuccess, Request.Handler< Error > onError) Parameters onSuccess: Request.Handler< SystemVoipState >onError: Request.Handler< Error >Returns void |
setSystemVoipSuppressed
(
suppressed
)
|
Sets whether SystemVoip should be suppressed so that this app's Voip can use the microphone and play incoming Voip audio. Once microphone switching functionality for the user is released, this function will no longer work. You can use com.meta.horizon.platform.ovr.requests.Voip#getMicrophoneAvailability() to see if the user has allowed the app access to the microphone. This returns a com.meta.horizon.platform.ovr.models.SystemVoipState object which contains statuses about whether the microphone is muted or whether passthrough is enabled.
Signature
static Request<com.meta.horizon.platform.ovr.models.SystemVoipState> com.meta.horizon.platform.ovr.requests.Voip.setSystemVoipSuppressed(boolean suppressed) Parameters suppressed: boolean
- A boolean indicates if the voip is supressed or not.
|
start
(
userID
)
|
Attempts to establish a VoIP session with the specified user.
A message of type com.meta.horizon.platform.ovr.Message.MessageType#Notification_Voip_SystemVoipState will be posted when the session is established.
This function can be safely called from any thread.
Signature
static void com.meta.horizon.platform.ovr.requests.Voip.start(long userID) Parameters userID: long
- The ID of the user to establish a VoIP session with.
Returns void |
stop
(
userID
)
|
Terminates a VoIP session with the specified user. Note that a muting functionality should be used to temporarily stop sending audio; restarting a VoIP session after tearing it down may be an expensive operation.
This function can be safely called from any thread.
Signature
static void com.meta.horizon.platform.ovr.requests.Voip.stop(long userID) Parameters userID: long
- The ID of the user to terminate the VoIP session with.
Returns void |