Oculus Go Development

On 6/23/20 Oculus announced plans to sunset Oculus Go. Information about dates and alternatives can be found in the Oculus Go introduction.

Oculus Quest Development

All Oculus Quest developers MUST PASS the concept review prior to gaining publishing access to the Quest Store and additional resources. Submit a concept document for review as early in your Quest application development cycle as possible. For additional information and context, please see Submitting Your App to the Oculus Quest Store.

Parties and Party Chat

Note: You are viewing the Native version of this topic. To view this topic for Unity development, see Parties and Party Chat (Unity). To view this topic for Unreal development, see Parties and Party Chat (Unreal).

Parties allow users to voice chat with friends in Oculus Home. For example, a group of friends can start a party in Home and chat about the game that they want to play together. Then, when they launch the app their chat session continues while in that app.

You may wish to disable party chat if your multiplayer app also provides a voice chat feature.

Users can create a Party and start a voice chat with members of the party and they can invite friends to join them in Rooms. Party voice chat persists across apps in VR and users can continue to interact while navigating between apps. This can cause issues if your app has a voice chat feature.

VoIP Options

No integration is required to support parties; however, there are some things you should consider if you are planning to use the microphone for commands or chat in your app. Following is a list of the kinds of chat a user could participate in.

  • System VoIP, also called Party VoIP, is the VoIP service used in Parties and Oculus Home. This service does not require an integration and is available to any user.
  • Platform VoIP is the VoIP service provided by the Oculus platform and one of the options to integrate voice chat in your app. For more information, see Voice Chat (VoIP).
  • Application VoIP is any non-Oculus VoIP service that you use in your app.

This page reviews how your app can use the microphone for chat or commands in collaboration with Party/System VoIP.

Options for VoIP in Apps That Target Rift

If you’re planning implement VoIP in your application, either the Platform VoIP or Application VoIP, youll need to handle two chat streams. For example, if User A and B are in a party and User A launches an application that User C is playing and invites User C to a multiplayer game; User A will then be able to talk to B (on Party VoIP) and C (on Application or Platform VoIP), but B and C will not be able to hear each other. You’ll want to suppress one of the chat streams to avoid this conflict.

Oculus provides a System VoIP API that you can use to detect if the user is in a party and using (System VoIP), and allows you to disable a VoIP stream.

Check the Status

To use the System VoIP API first check the status of the System VoIP. There are two ways to check the state of System VoIP (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 System VoIP is active at any time, using the following function. Note that this is a synchronous function, not a request: ovr_Voip_GetSystem VoIPStatus() == ovrSystem VoIPStatus_Active

  2. Listen for a Notification - To get a notification for changes in the VoIP state you can make the following request:

    In Native or Unreal apps, listen or the notification for ovrMessage_Notification_Voip_System VoIPState, and then use ovr_Message_GetSystem VoIPState() and ovr_System VoIPState_GetStatus() to get the status.

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.

Suppress a VoIP Stream

Next, you can suppress the VoIP stream that you don’t want the user to hear or allow the user to hear the stream that they choose.

If the System VoIP is active you can:

  • Enable In-App VoIP For a User - Use this option if you want the user to be in your in-app chat instead of their party chat. Suppress System VoIP by calling ovr_Voip_SetSystem VoIPSuppressed(bool suppressed) , then use either Platform VoIP or your own VoIP service to run the app VoIP.
  • Enable System/Party VoIP For a User - Use this option if you want to allow the user to continue using their party chat instead of the 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). If you’re using Platform VoIP, information about suppressing that VoIP stream can be found on the Voice Chat (VoIP) page.

System VoIP will be unsuppressed if the app that has it suppressed quits. You may also wish to stop suppressing a user’s party VoIP when they leave the multiplayer portion of your app, e.g. your home menu, so that they may resume chatting with their party.

You may also allow your users to toggle between System VoIP 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 System VoIP).

Options for VoIP with Apps that Target Quest and Go

Note: The following methods are intended for Android development.

There are two integrations that you may need to add to your mobile app.

Handle Multiple VoIP Streams

If you’re planning to have some form of VoIP in your application, you’ll need a way to handle the two chat streams. For example, if User A and B are in a party and User A launches an application that User C is playing and invites User C to a multiplayer game; User A will then be able to talk to B (on Party VoIP) and C (on Application or Platform VoIP), but B and C will not be able to hear each other. You’ll want to suppress one of the chat streams to avoid this conflict.

Oculus provides System VoIP APIs that enables you to detect if the user is in a party and using System VoIP, and allows you to disable a VoIP stream.

To use the System VoIP API first check the status of the System VoIP. There are two ways to check the state of System VoIP (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 System VoIP is active at any time (these are synchronous functions, not requests):

    ovr_Voip_GetSystem VoIPStatus() == ovrSystem VoIPStatus_Active

  2. Listen for a Notification - To get a notification for changes in the VoIP state you can make the following request:

    Listen for ovrMessage_Notification_Voip_System VoIPState, and then use ovr_Message_GetSystem VoIPState() and ovr_System VoIPState_GetStatus() to get the status.

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.

Next, you can suppress the VoIP stream that you don’t want the user to hear or allow the user to hear the stream that they choose.

If the System VoIP is active you can:

  • Use In-App VoIP - For example if you want the user to be in your in-app chat instead of their party chat. Suppress System VoIP by calling ovr_Voip_SetSystem VoIPSuppressed(bool suppressed) , then use either Platform VoIP or your own VoIP service to run the app VoIP.
  • Use System VoIP (Party VoIP) - For example if you want to allow the user to continue using their party chat instead of the 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). If you’re using Platform VoIP, information about suppressing that VoIP stream can be found on the Voice Chat (VoIP) page.

System VoIP will be unsuppressed if the app that has it suppressed quits. You may also wish to unsupress a user’s party VoIP when they leave the multiplayer portion of your app, e.g. your home menu, so that they may resume chatting with their party.

You may also allow your users to toggle between System VoIP 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 System VoIP).

Manage the Shared Microphone

Android only allows one device to access the microphone at a time. So, Oculus has developed an application layer that allows multiple applications to access the microphone at the same time.

The following functions can be used to access microphone data on an Android device. These functions allow the microphone to be accessed by multiple services. These functions should be used if you plan to use your own VoIP service or if you plan to use the microphone for voice commands in your application. Detail about each function can be found in the Platform SDK Reference Content.

Create a microphone object

Create an ovrMicrophone object and receives a handle to it. The caller owns this memory and is responsible for freeing it. Use ovr_Microphone_Destroy to free the object.

ovr_Microphone_Create()

Start microphone capture

Start gathering microphone data. After this is called PCM data can be extracted. This function can be safely called from any thread.

ovr_Microphone_Start()

Retrieve microphone PCM data

Retrieve all available samples of microphone data and copies it into the 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.

ovr_Microphone_GetPCM()

Retrieve microphone PCM data (float):

Retrieve all available samples of microphone data and copies it into the 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.

ovr_Microphone_GetPCMFloat()

Stop microphone capture

Stop gathering microphone data. This function can be safely called from any thread. ovr_Microphone_Stop()

Destroy a microphone object

Stop and free a previously created microphone object.

ovr_Microphone_Destroy()

Integration Steps

In general, creating a microphone object may resemble the following:

  • Create the microphone object by calling ovr_Microphone_Create() .
  • Start capturing microphone data in your app, when appropriate, by calling ovr_Microphone_Start() .
  • When you’re ready to read the microphone data, call ovr_Microphone_GetPCMFloat() to retrieve the PCM data off the buffer and use as needed in your application.
  • When finished, you can either stop collecting PCM data by calling ovr_Microphone_Stop() if you intend to start again at some point, or ovr_Microphone_Destroy() to destroy the microphone object.