Posts

Showing posts from April, 2025

UniVoice 4.4.0: Easy drag and drop integration with Mirror (also, YouTube tutorial)

Image
A tutorial for this blogpost is available on YouTube I've recently helped a lot of people setup a basic UniVoice integration in their projects. And it became clear that the sample scene is not minimal enough. The sample scene is basically an example app that also does some UI stuff. Going through the code shows how it can be used. But what most people are looking for is to get basic voice chat working as soon as possible. I've seen some people adding the example app script to their scenes, which will not work as expected. For this reason, I have now created a basic setup sample that provides a component that you can just add to your Mirror Network manager and get voice chat working immediately. This UniVoiceMirrorSetupSample.cs  easily allows you to check if voice chat is working by making sure you have setup UniVoice properly, pretty much just adding the UNIVOICE_NETWORK_MIRROR  compilation symbol to your Mirror project. The script also provides access to the IAudioServer<...

UniVoice 4.3.0: Easy Push To Talk

Push to Talk is a popular feature to: * Encourage users to user voice chat more intentionally * Reduce CPU and bandwidth usage on both the client and the server * Avoid excess chatter when connected to several peers as they'd all be transmitting audio without it Old approach using VoiceSettings UniVoice provides a VoiceSettings class that allows a client to mute or deafen a peer.  In theory, this can be used to create a push-to-talk feature. However this isn't as straightforward. After modifying VoiceSettings , you need to call SubmitVoiceSettings() to sync it with the server. The server then makes sure that the audio you send to it doesn't get sent to anyone. Usage would be like this: session.Client.YourVoiceSettings.deafenAll = true; session.Client.SubmitVoiceSettings(); This isn't too bad, but there are a couple of limitations: * Syncing the settings with the server takes a while, so it's not as instantaneous. * The client still continues to send audio to the s...

UniVoice 4.x.x: Upgrade guide

A lot has changed between UniVoice v3 and v4, however I've tried to keep the new things "mirror" some old patterns as much as possible. There's no way to upgrade from v3 to v4 without code changes, so getting familiar with some key changes can help. In this post I'll be comparing the sample code for v4 and v3 and try to describe the differences that have been made. v4 sample v3 sample Namespace changes In v3 you'll notice these namespaces  Adrenak.UniVoice.UniMicInput  Adrenak.UniVoice.AudioSourceOutput  Adrenak.UniVoice.AirPeerNetwork  This is a remnant of the previous multi-repo approach where each repo had their own namespaces. UniVoice changed to a mono-repo one as described in an earlier post  with the key reason being ease of maintenance and integration. From v4 onwards, you can expect to need only the following namespaces: Adrenak.UniVoice.Networks; Adrenak.UniVoice.Outputs; Adrenak.UniVoice.Inputs; Adrenak.UniVoice.Filters; With all related implementat...

UniVoice 4.2.0: RNNoise noise cancellation

UniVoice was updated to 4.2.0 recently with the key change being that RNNiose is now supported. RNNoise is an amazing audio noise removal library that I've seen excellent results with. Background noise such as traffic, ambient noise are almost completely gone.  It is available in UniVoice 4.2.0 as an AudioFilter implementation called RNNoiseFilter  and is a one-line integration .    RNNoiseFilter class internally uses is used via RNNoise4Unity , a repository I made that simply makes it available as a UPM package.  Since RNNoise4Unity uses native libraries, it has not been made a direct dependency of UniVoice. Only a RNNoiseFilter.cs  is provided with UniVoice that can be activated using UNIVOICE_FILTER_RNNOISE4UNITY after you import RNNoise4Unity into your project.  Not adding packages that rely on native libraries to UniVoice dependencies is something I'm going to continue. I have highlighted in the 4.2.0 commit the following:  Activating non...