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

Parties

Parties allow users to chat with friends and navigate VR as a group.

Parties are only available for Gear VR apps at this time.

Users can create Parties, start a voice chat using Voice Chat (VoIP), invite friends to join them in Rooms, and even invite their Party to join an app using Coordinated App Launch (CAL). Party voice chat persists across apps in VR and users can continue to interact while navigating between apps.

You don't have to do anything to allow users to join Parties; however, there are a couple steps if you are planning to use the microphone for commands or chat in your app.
  • If you're using Voice Chat (VoIP) - In addition to integrating the VoIP service, you also need to integrate with our SystemVoIP API. Note: Parties introduces a change that removes echo cancellation from our VoIP inputs. We will be adding this back in as an option in the future. In the meantime, you may want to require users to use headphones and mute a user's mic if they don't have headphones plugged in.
  • If you're using your own VoIP service - You need to integrate with both the Shared Mic API and SystemVoIP API.
  • If you're using the mic, but not for VoIP - If you're using the mic for something other than VoIP (e.g. voice search or voice commands), you need to integrate with our Shared Mic API.

Shared Microphone API

The Shared Microphone API allows sharing of mic access between multiple services so app can access the user mic data while in a Party.

To integrate with our API, you need to instantiate our mic object and retrieve PCM data from it.

// This file was @generated with LibOVRPlatform/codegen/main. Do not modify it!
                
#ifndef OVR_MICROPHONE_H
#define OVR_MICROPHONE_H
                
#include "OVR_Platform_Defs.h"
#include <stdint.h>
#include <stddef.h>
                        
typedef struct ovrMicrophone *ovrMicrophoneHandle;
                        
/// Creates an ovrMicrophone object and returns a handle to it.
/// The caller owns this memory and is responsible for freeing it.
/// Use ovr_Microphone_Destroy to free the object.
OVRP_PUBLIC_FUNCTION(ovrMicrophoneHandle) ovr_Microphone_Create();
                        
/// Stops and frees a previously created microphone object.
OVRP_PUBLIC_FUNCTION(void) ovr_Microphone_Destroy(ovrMicrophoneHandle obj);
                        
/// Gets all available samples of microphone data and copies it into
/// outputBuffer. The microphone will generate data at roughly the rate of 480
/// samples per 10ms. The data format is 16 bit fixed point 48khz mono.
/// 
/// This function can be safely called from any thread.
OVRP_PUBLIC_FUNCTION(size_t) ovr_Microphone_GetPCM(const ovrMicrophoneHandle obj, int16_t *outputBuffer, size_t outputBufferNumElements);
                        
/// Gets all available samples of microphone data and copies it into
/// outputBuffer. The microphone will generate data at roughly the rate of 480
/// samples per 10ms. The data format is 32 bit floating point 48khz mono.
/// 
/// This function can be safely called from any thread.
OVRP_PUBLIC_FUNCTION(size_t) ovr_Microphone_GetPCMFloat(const ovrMicrophoneHandle obj, float *outputBuffer, size_t outputBufferNumElements);

/// Starts microphone recording. After this is called pcm data can be extracted
/// using ovr_Microphone_GetPCM.
/// 
/// This function can be safely called from any thread.
OVRP_PUBLIC_FUNCTION(void) ovr_Microphone_Start(const ovrMicrophoneHandle obj);
                        
/// Stops microphone recording.
/// 
/// This function can be safely called from any thread.
OVRP_PUBLIC_FUNCTION(void) ovr_Microphone_Stop(const ovrMicrophoneHandle obj);
                        
                        
// DEPRECATED - use ovr_Microphone_GetPCMFloat instead
OVRP_PUBLIC_FUNCTION(size_t) ovr_Microphone_ReadData(const ovrMicrophoneHandle obj, float *outputBuffer, size_t outputBufferSize);
                        
#endif

SystemVoIP API

The SystemVoIP API ensures that the user doesn't hear both the Party VoIP and the VoIP in your app at the same time.

There are two ways to check the state of SystemVoIP (active means the user is using Party VoIP). One way is to check every frame, the other is to listen for a notification.

  1. Check Every Frame - To check whether SystemVoIP is active at any time:
    • In C: ovr_Voip_GetSystemVoipStatus() == ovrSystemVoipStatus_Active
    • In C#: Voip.GetSystemVoipStatus() == SystemVoipStatus.Active
    These are synchronous functions, not requests.
  2. Listen for a Notification - To get a notification for changes in the VoIP state you can make the following request:
    • In C: Watch for ovrMessage_Notification_Voip_SystemVoipState, and then use ovr_Message_GetSystemVoipState() and ovr_SystemVoipState_GetStatus() to get the status.
    • In C# Watch for MessageType.Notification_Voip_SystemVoipState which has a Message<SystemVoipState> from which you can access the Status field, or call SetSystemVoipStateNotificationCallback with a Message<SystemVoipState> callback
    It's possible for the state to change quickly. The values you extract from notification messages will be the state at the time the notification was added to the message queue, which may be different from the state then the message is processed. You may wish to listen for the notification, and then ignore its values and check the current state using the synchronous functions.

If the SystemVoIP is active you can:

  • Use In-App VoIP - i.e. you want the user to be in your in-app chat instead of in Party VoIP. Suppress SystemVoIP by calling ovr_Voip_SetSystemVoipSuppressed(bool suppressed) and use either the Shared Microphone API or the Platform VoIP API to run your in-app VoIP.
  • Use SystemVoIP (Party VoIP) - i.e. you want to use Party VoIP instead of in your in-app VoIP. Suppress your in-app VoIP (don't send the user's mic input to other users and don't play other user's audio to the user).

SystemVoIP will be unsupressed if the if the app has it suppressed quits.

You may also allow your users to toggle between SystemVoIP and your in-app VoIP. This allows users to choose if they want to keep talking to their party (in which case you would need to suppress your in-app VoIP), or if they want to use your in-app VoIP (in which case you would need to suppress the SystemVoIP).