Skip to content

adrenak/univoice

Repository files navigation

UniVoice

UniVoice is a voice chat/VoIP solution for Unity.

Some features of UniVoice:

  • 👥 Group voice chat. Multiple peers can join a chatroom and exchange audio.

  • ⚙ Peer specific settings. Don't want to listen to a peer? Mute them. Don't want someone listening to you? Mute yourself against them.

  • 🎨 Customize your audio input, output and networking layer.

    • 🎤 Configurable Audio Input: UniVoice is audio input agnostic. It supports mic audio input out of the box and you can change the source of outgoing audio by implementing the IAudioInput interrace.

    • 🔊 Configurable Audio Output: UniVoice is audio output agnostic. Out of the box is supports playing peer audio using Unity AudioSource. You can divert incoming audio to anywhere you want by implementing the IAudioOutput interface.

    • 🌐 Configurable Network: UniVoice is network agnostic and supports Mirror out of the box. You can implement the IAudioClient and IAudioServer interfaces using the networking plugin of your choice to make it compatible with it.

    • ✏️ Audio Filters: Modify outgoing and incoming audio by implementing the IAudioFilter interface. Gaussian blurring for denoising and Opus (Concentus) encoding & decoding for lower bandwidth consumption are provided out of the box.

Installation

⚠️ OpenUPM may not have up to date releases. Install using NPM registry instead 👇

Ensure you have the NPM registry in the manifest.json file of your Unity project with the following scopes:

"scopedRegistries": [
    {
        "name": "npmjs",
        "url": "https://registry.npmjs.org",
        "scopes": [
            "com.npmjs",
            "com.adrenak.univoice",
            "com.adrenak.brw",
            "com.adrenak.unimic",
            "com.adrenak.concentus-unity"
        ]
    }
}

Then add com.adrenak.univoice:x.y.z to the dependencies in your manifest.json file (where x.y.z is the version you wish to install). The list of versions is available on the UniVoice NPM page.

Docs

Am API reference is available: http://www.vatsalambastha.com/univoice

Samples

This repository contains a sample scene for the Mirror network, which is the best place to see how UniVoice can be integrated into your project.

To try the sample, import Mirror and add the UNIVOICE_MIRROR_NETWORK compilation symbol to your project.

Dependencies

com.adrenak.brw for reading and writing messages for communication. See MirrorServer.cs and MirrorClient.cs where they're used.

com.adrenak.unimic for easily capturing audio from any connected mic devices. See UniMicInput.cs for usage. Also used for streaming audio playback. See StreamedAudioSourceOutput.cs for usage.

com.adrenak.concentus-unity for Opus encoding and decoding. See ConcentusEncodeFilter.cs and ConcentusDecodeFilter.cs for usage

License and Support

This project is under the MIT license.

Community contributions are welcome.

Contact

The developer can be reached at the following links:

Website
LinkedIn
GitHub
Twitter
Discord: adrenak#1934