Immerse SDK
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

Voice

The Immerse voice solution implementation varies depending on the platform of your app (e.g. WebGL vs. Android).

WebGL

For WebGL apps, the voice solution is managed entirely within the browser, requiring no additional setup by the developer.

Audio Check

When launching a WebGL app in the browser, users will be prompted with an audio check before the app is presented to them. During this check, they can select their input device and ensure they can be heard and hear other users.

If you wish to skip this audio check during development, append the parameter skipAudioCheck=true to the URL.

Android

For Android clients, the voice functionality is managed by a plugin that must be included in the build. This plugin is part of the Voice module in the Immerse SDK but requires configuration in your project’s Gradle templates.

Connection to the voice service automatically made immediately after the network connection is created successfully.

Adding a Gradle Template

  1. Open the Unity Project Settings: Edit > Project Settings…
  2. Select the Player section and switch to the Android build target.
  3. Scroll down and expand Publishing Settings.
  4. Under the Build header, enable the ‘Custom Main Gradle Template’ and ‘Custom Gradle Properties Template’ options. The following files will be added to your project:
  • Assets\Plugins\Android\mainTemplate.gradle
  • Assets\Plugins\Android\gradleTemplate.properties

Publishing settings

Editing the Gradle Templates

mainTemplate.gradle

  1. Open the mainTemplate.gradle file (any text editor is fine).
  2. In the dependencies section towards the top, add the following line:
implementation 'com.opentok.android:opentok-android-sdk:2.22.2'
  1. Save and close the file.

gradleTemplate.properties

  1. Open the gradleTemplate.properties file (any text editor is fine).
  2. Add the following line before the **ADDITIONAL PROPERTIES** line:
android.useAndroidX=true
  1. Save and close the file.