Kanda Foundation 0.8.0
Loading...
Searching...
No Matches
Voice Chat

The Kanda SDK integrates voice chat functionality using the Unity Vivox service. This feature is available through the IVoiceService interface.

Voice Chat Options

Voice chat is enabled in all projects by default but will require a Unity Cloud connected project with Vivox enabled to function. To connect please see the Vivox documentation.

If you would like to disable voice chat, you can do so by setting the "Use Voice Chat" option to false in Edit > Project Settings > Kanda SDK > Connection Settings.

The VoiceService provides two types of voice chat:

  • Group: Use the JoinChannel method to enable group voice chat, where all participants can communicate without positional context.
  • Positional: Use the JoinPositionalChannel method for positional voice chat, where audio is spatially adjusted based on the player's in-game location.

Positional Voice Chat Requirements

When using positional voice chat, it is essential to continuously synchronize the player’s head position with the voice service. This is managed through the Set3DPosition method, which ensures that the 3D audio environment reflects the player’s movements in real-time.

Example: Lifecycle of VoiceService (Positional Chat)

Here is a typical lifecycle of the VoiceService for positional voice chat:

  1. Initialize VoiceService
    The VoiceService is initialized to prepare for voice chat.
  2. Join a voice channel
    The player joins a voice channel using the JoinPositionalChannel method, enabling positional audio.
  3. Update 3D position
    The system continuously updates the player’s head position in the voice channel using the Set3DPosition method, allowing for accurate 3D spatial audio.
  4. Leave the voice channel
    The player exits the voice channel, terminating the voice chat session.

Authentication

By default, this voice service does not require authentication. However, it is possible to configure OpenID Connect (OIDC) authentication for enhanced security.

To enable authentication, follow the steps outlined in the Unity Services Authentication page.

Restrictions

Vivox as of November 2024 does not support changing the transport for the voice chat. The transport per default is UDP, and as a result some network setups, especially those in corporate environments, may block the voice chat. In such cases the voice chat will not work.

For more information about Vivox networking requirements, see Unity's Vivox documentation.

Should voice chat still be a requirement for the project, and the devices are required to be on the corporate network, then alternatively the project can use a different voice chat provider that supports Secure Websockets (WSS).

Services which support WSS include: