Posts

Morning thoughts of a night owl

The residents in the apartments opposite us have started to turn their lights off and call it a night. Some of them are binge watching TV, and won't stop for many hours. The traffic on the road is starting to calm down. Not many passenger cars and cabs now. Most people have already endured their journey back home from their workplace, through the chaotic streets of Bangalore during rush hour. Now it's largely trucks and cranes and other heavy vehicles making the noise, many of them going to one of the construction sites near us. My wife and I have had dinner. She's done with her work and we're finally watching the series finale of Brooklyn 99, after over a year of watching an episode or two every now and then. There are 11 minutes left before it ends and it's 10:42pm right now. Perfect. Because I'd really like to finish this episode before 11pm, which is when I get on Discord to join daily standup and start my workday. --- I was recently talking to a couple of p...

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...

UniVoice 4+: Now a mono repo

UniVoice has been around since Jan 2019 and has been evolving towards becoming a robust VoIP solution for Unity. Recently I released version 4.x, which is a big upgrade from v3. One of the things that's changed is that UniVoice is now a mono repo. Why mono repo Previously the main repository only housed the interfaces and implementations for them were separate repositories . This caused a lot of pain for both me and any users of UniVoice. For me because if I wanted to change something in, let's say, the univoice-unimic-input  repository. I would need to open UniVoice, change the manifest to point to a local copy of the univoice-unimic-input repo so that I can test the changes locally.  For users because when they'd install the univoice package, it wouldn't really have anything usable. They'd need to install implementation packages separately. In v3, to get UniVoice to work you needed at implementations of at least three interfaces: IAudioInput, IAudioOutput and ICha...