unfurl

Voice

Proximity voice chat with Opus and a microphone picker for Unreal Engine.

Proximity voice chat with Opus and a microphone picker for Unreal Engine.

👀 Summary

NsVoice is proximity voice chat for multiplayer games. A component on the player pawn reads the microphone, encodes the voice with Opus, and sends it through the host. The other machines play the voice from that component, so your attenuation settings make it quieter with distance.

NsVoice has no input bindings, no UI, and no save of the options. The game binds push to talk, draws the meter, and saves the picked microphone and the volumes.

📦 Features

⚙️ Requirements

🛠️ Installation

  1. Clone or download this repository.
  2. Copy the NsVoice folder into the Plugins folder of your project.
  3. Add "NsVoice" to the dependencies of the game module that uses the components.
  4. Add these lines to Config/DefaultEngine.ini:
    [Voice]
    bEnabled=true
    
  5. Generate the project files and enable the plugin.

🚀 Getting Started

In Blueprint:

  1. Open the Blueprint of the player character.
  2. Add an Ns Voice Chat component, and attach it to the head.
  3. Set an attenuation on the component in the Details panel.
  4. Add an Ns Voice Activity component, if the game must know who speaks.
  5. Start two players in a listen server or a client session, and talk.

Transmit When Locally Controlled is on, so the microphone opens for the local player. For push to talk, turn it off and call Set Transmitting.

In C++:

#include "NsVoiceChatComponent.h"
#include "NsVoiceActivityComponent.h"

AMyHero::AMyHero()
{
    VoiceChat = CreateDefaultSubobject<UNsVoiceChatComponent>(TEXT("VoiceChat"));
    VoiceChat->SetupAttachment(GetMesh(), TEXT("head"));
    VoiceChat->bTransmitWhenLocallyControlled = false; // push to talk
    VoiceActivity = CreateDefaultSubobject<UNsVoiceActivityComponent>(TEXT("VoiceActivity"));
}

void AMyHero::StartTalk() { VoiceChat->SetTransmitting(true); }
void AMyHero::StopTalk() { VoiceChat->SetTransmitting(false); }

🔧 API

Main Classes

Main Functions

🚧 Limits

📚 Documentation


Contact