Volume / Audio Settings

Inherit from EasyManager.cs

using EasyCodeForVivox;

public class VivoxManager : EasyManager
{

}

Inject EasyAudio

using EasyCodeForVivox;
using System.IO;
using System.Linq;
using UnityEngine;
using Zenject;

public class VivoxAudio : MonoBehaviour
{
        EasyAudio _audio;

        [Inject]
        private void Initialize(EasyAudio audio)
        {
            _audio = audio;
        }
}

Volume Adjustment

Adjust Volume for Local User, only int values are valid.

Vivox Documentationarrow-up-right recommends only letting users set the volume up to 25. Accepted values are between -50 and 50 int

  • Adjust volume for local player volume level to 15.

EasyManager

EasyAudio

Remote Player Volume

Adjust Volume for Remote User, only int values are valid. Player must be logged in and in the same channel as the user calling this method.

Vivox Documentationarrow-up-right recommends only letting users set the volume up to 25. Accepted values are between -50 and 50 int

  • Adjust volume for Remote player "userName", in channel "channelName", and changes volume level to 15.

EasyManager

EasyAudio

Auto Voice Activity Detection

circle-info

For More information on Voice Activity Detection check out the Vivox Docsarrow-up-right

  • Set Auto Voice Activity Detection (VAD) - Recommended by Vivox

EasyManager

EasyAudio

Custom Voice Activity Detection

circle-info

For More information on Voice Activity Detection check out the Vivox Docsarrow-up-right

Set custom values for Voice Activity Detection (VAD). For more information on what the parameters do check out Vivox Docsarrow-up-right

EasyManager

EasyAudio

Get Audio Input/Output Devices

Get all Audio Input or Output devices to display to players or use internally in your app/game

  • Input devices - Microphones

  • Output devices - Speakers / Headphones

EasyManager

EasyAudio

Set Audio Input/Output Devices

If you allow your users to change Audio Device settings within your app/game, then you want to use the following methods to change

  • Input devices - Microphones

  • Output devices - Speakers / Headphones

In the code example I get all the current available audio devices. You should display these options to your players in a dropdown or type of list. Then whatever device the player chooses you would then call the Set methods for changing audio devices. As you can see I am choosing the first device in the list and setting that as the current audio device Vivox will use.

circle-info

Only affects Vivox, your in-game audio/SFXarrow-up-right should still use any previous selected or default Audio device

triangle-exclamation

EasyManager

EasyAudio

Refresh Audio Devices

Refreshes Vivox's internal list of Audio Devices

circle-info

Only affects Vivox, your in-game audio/SFXarrow-up-right should still use any previous selected or default Audio device

Examples refresh both Input and Output audio devices

EasyManager

EasyAudio

Inject Audio into Channel

Inject audio ".wav" files into a channel on behalf of user if they have transmission (Audio/Voice capabilities and aren't muted in the channel) active in that channel

circle-info

For more information on what type of files you can inject see Vivox Documentationarrow-up-right

  • I am injecting audio on behalf of player "userName"

  • I am getting the current directory of the app/game and then adding the path to the ".wav" file that will be injected

EasyManager

EasyAudio

Last updated