/OpenVoiceSharp

Agnostic C# VoIP/Voice Chat library.

Primary LanguageC#MIT LicenseMIT

OpenVoiceSharp OpenVoiceSharp

Agnostic VoIP Voice Chat and Audio Streaming C# library.

Introduction

Warning

This package is not ready to use and is in work in progress. Please come back later!

OpenVoiceSharp is an extremely simple, basic compact library that allows for real time VoIP (Voice over IP) voice chat and audio streaming. It allows for any app or game to embed voice chatting functionality.

OpenVoiceSharp utilizes Opus as codec under the hood and RNNoise for basic (toggleable) noise suppression and WebRTC VAD (voice activity detection).

OpenVoiceSharp also has a dedicated class (VoiceUtilities) for converting PCM to float formats depending on use cases for engines.

Why did I make this?

I believe that voice chat, proximity or not is an essential functionality for game immersion or multiplayer, or discussion. Though, when searching for a friendly open source/free alternative other than Steam's Voice API or Epic Online Services's Voice API, I could not find any, and to make matters worse, it was extremely difficult to get information around how voice chat/audio streaming essentially worked under the hood, which can make difficult for people to make their own voice chat implementation.

Most alternatives are paid (Vivox, Photon Voice, Dissonance etc...) & are mostly compatible for Unity, which can cause an issue for developers using their own game engine, app stack, or game engines like the Godot Engine.

So upon learning how to make VoIP myself, I decided to share the knowledge into this library to make sure no one has to ever struggle with VoIP again, because I also believe that implementation for such things should be easy to use and implement.

Features

  • ๐Ÿ•“ Agnostic: no specific engine/environment required!
  • โšก Easy and friendly to use: all you need is a way to record and playback the audio!
  • ๐ŸŽ™๏ธ Basic microphone recorder class: no way to record the audio correctly or easily? BasicMicrophoneRecorder does that!
  • ๐Ÿ’ฅ Low memory footprint: using Opus, the packets are tiny! And OpenVoiceSharp aims to be as memory efficient and performant as possible.
  • ๐ŸŽต Audio streaming favoring: option to encode less for better quality packets for audio streaming and more!
  • ๐Ÿ˜ฏ Low latency: OpenVoiceSharp aims to be as low latency as possible. One opus frame is only 20ms!
  • ๐Ÿ”Š Customizable bitrate: make audio crystal crisp or not, it depends on you! (Supports from 8kbps up to 512kbps)
  • ๐Ÿƒ Basic noise suppression using RNNoise (can be toggled)
  • ๐Ÿงช Basic voice conversion utilies: convert 16 bit PCM to float 32 PCM and so on.
  • ๐Ÿ—ฃ๏ธ Voice activity detection (VAD): out of the box basic voice activity detection using WebRTC's VAD.

Note

OpenVoiceSharp is meant to be extremely basic and straightforward. Audio playback, modification (effects or more) and features such as groups, teams, muting should be left to implement by yourself. OpenVoiceSharp just provides a basic way to encode and decode voice packets along with a basic microphone recorder.

Requirements

  • Windows (64 bit)
  • .NET 6.0 and higher or support for .NET Standard 2.1
  • Visual Studio

Warning

OpenVoiceSharp currently only supports Windows 64 bit, atleast the dependencies do. I currently do not plan on integrating native support for MacOS, Linux, Android or others but you can compile the libraries yourself and link them.

Installation & Usage

Everything you need to know or do can be found in the wiki.

Contribute

If you wish to contribute, you have a few ways:

By supporting the project:

  • ๐Ÿ—ฃ๏ธ Feedback, ideas, or bug reports can be opened talked through the Discord server or through Issues.
  • ๐ŸŒŸ Leave a star or share this project.

Or sending me a coffee:

๐Ÿ’– I do those projects out of pure passion and love for the craft. All my open source projects will remain free to use forever.

โ˜• If you wish to support me, send me a coffee on ko.fi: https://ko-fi.com/coloride

Licenses & Disclaimer

OpenVoiceSharp uses the following libraries, so by using OpenVoiceSharp, you accept their license's conditions.

Tip

Most of the libraries used by OpenVoiceSharp are MIT licensed, except for WebRTC's VAD, which contains the license from WebRTC.

As of this library, just good old MIT.

ยฉ (real)coloride - 2024 | Licensed MIT