OpenVoiceSharp 1.0.3
dotnet add package OpenVoiceSharp --version 1.0.3
NuGet\Install-Package OpenVoiceSharp -Version 1.0.3
<PackageReference Include="OpenVoiceSharp" Version="1.0.3" />
paket add OpenVoiceSharp --version 1.0.3
#r "nuget: OpenVoiceSharp, 1.0.3"
// Install OpenVoiceSharp as a Cake Addin #addin nuget:?package=OpenVoiceSharp&version=1.0.3 // Install OpenVoiceSharp as a Cake Tool #tool nuget:?package=OpenVoiceSharp&version=1.0.3
<img src="https://raw.githubusercontent.com/realcoloride/OpenVoiceSharp/master/openvoicesharp.png" alt="OpenVoiceSharp" width="28" height="28"> 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.
- NAudio - Licensed MIT
- OpusDotNet & Opus - Licensed MIT & BSD
- WebRtcVadSharp & WebRTC - Licensed MIT & Other
- YellowDogMan.RRNoise.NET & RNNoise - Licensed MIT & BSD
As of this library, just good old MIT.
ยฉ (real)coloride - 2024 | Licensed MIT
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.1 is compatible. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- NAudio (>= 2.2.1)
- OpusDotNet (>= 1.0.3)
- System.Memory (>= 4.5.5)
- WebRtcVadSharp (>= 1.3.2)
- YellowDogMan.RRNoise.NET (>= 0.1.6)
-
net6.0
- NAudio (>= 2.2.1)
- OpusDotNet (>= 1.0.3)
- System.Memory (>= 4.5.5)
- WebRtcVadSharp (>= 1.3.2)
- YellowDogMan.RRNoise.NET (>= 0.1.6)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Changed copying via array in circular buffer for optimization