Skip to main content
Module: LCKUnrealAudio | Version: 1.0 | Platforms: All

Overview

LCKUnrealAudio provides native Unreal Engine audio capture, supporting both game audio output and microphone input using Unreal’s built-in audio systems. It uses FAudioCapture for microphone input and FLCKUnrealAudioListener for submix-based game audio capture.

Supported Channels

ChannelSupportedDescription
GameYesUnreal Audio submix capture
MicrophoneYesUnreal Audio microphone capture
VoiceChatNoUse LCKVivox for voice chat

Dependencies

// Add to your .Build.cs
PublicDependencyModuleNames.AddRange(new string[] {
    "LCKUnrealAudio",
    "LCKAudio"
});

Automatic Integration

The plugin automatically registers itself with the LCK audio system when the module loads. No manual initialization is required.

Source Implementation

FLCKUnrealAudioSource

The core audio source class that implements ILCKAudioSource for native Unreal Engine audio:
class FLCKUnrealAudioSource : public ILCKAudioSource
{
public:
    FLCKUnrealAudioSource();
    ~FLCKUnrealAudioSource();

    bool StartCapture() noexcept override;
    bool StartCapture(TLCKAudioChannelsMask Channels) noexcept override;
    void StopCapture() noexcept override;
    const FString& GetSourceName() const noexcept override;
    float GetVolume() const noexcept override;

private:
    TUniquePtr<Audio::FAudioCapture> MicrophoneCapture;
    TSharedPtr<FLCKUnrealAudioListener, ESPMode::ThreadSafe> GameAudioListener;
    bool bIsMicrophoneCapturing = false;
    int32 Samplerate = 48000;
    int32 ChannelsCount = 1;
};
MemberTypeDescription
MicrophoneCaptureTUniquePtr<Audio::FAudioCapture>Unreal’s built-in microphone capture device
GameAudioListenerTSharedPtr<FLCKUnrealAudioListener, ESPMode::ThreadSafe>Submix listener for game audio output capture
bIsMicrophoneCapturingboolWhether microphone capture is currently active
Samplerateint32Audio sample rate, defaults to 48000 Hz
ChannelsCountint32Number of audio channels (1 = mono mic input)

Audio Capture Pipeline

┌─────────────────────────────────────────────────────┐
│              Unreal Audio Engine                     │
├──────────────────────┬──────────────────────────────┤
│   Master Submix      │      Audio Capture API       │
│   (Game Audio)       │      (Microphone)            │
│        ↓             │           ↓                  │
│  FLCKUnrealAudio     │    Audio::FAudioCapture      │
│     Listener         │                              │
└──────────┬───────────┴──────────────┬───────────────┘
           │                          │
           ▼                          ▼
┌────────────────────────────────────────────────────┐
│           FLCKUnrealAudioSource                     │
│   OnAudioDataDelegate (Game + Microphone)          │
└────────────────────────────────────────────────────┘

FLCKUnrealAudioListener

Hooks into Unreal’s submix system to capture the final game audio mix. Registered automatically on the master submix when game audio capture starts.

FAudioCapture (Microphone)

Uses Unreal’s Audio::FAudioCapture API for cross-platform microphone input. The microphone stream is captured at 48000 Hz mono and delivered through the same OnAudioDataDelegate with ELCKAudioChannel::Microphone.

Blueprint Functions

ULCKUnrealAudioBPL

A Blueprint function library exposing audio utilities to Blueprints:
GetUnrealAudioSamplerate
int32
Returns the current Unreal Audio sample rate. Use this to configure the encoder with the correct sample rate.
UFUNCTION(BlueprintCallable, BlueprintPure, Category = "LCK")
static int32 GetUnrealAudioSamplerate();

Usage

#include "LCKUnrealAudioBPL.h"

// Get sample rate for encoder configuration
int32 SampleRate = ULCKUnrealAudioBPL::GetUnrealAudioSamplerate();

// Configure encoder with matching rate
FLCKRecorderParams Params;
Params.Samplerate = SampleRate;
In Blueprints, search for Get Unreal Audio Samplerate under the LCK category.

Configuration

Sample Rate

The default sample rate is 48000 Hz. This matches the LCK encoder’s expected input rate. If your project uses a different audio sample rate, ensure the encoder is configured to match:
int32 ProjectSampleRate = ULCKUnrealAudioBPL::GetUnrealAudioSamplerate();
// Use this value when configuring FLCKRecorderParams::Samplerate
Voice chat and game audio must match in sample rate, otherwise audio distortion will occur in recordings.

Project Settings

Ensure audio capture is enabled in your project settings:
  1. Edit > Project Settings > Platforms > Windows/Android
  2. Enable “Audio Capture” in the Audio section

Submix Setup

For game audio capture, the plugin hooks into Unreal’s master submix. No additional configuration is needed for default behavior.
For custom submix routing, create a custom submix and route game audio through it, then configure the plugin to capture from that submix.

Microphone Permissions

Windows

No special permissions required. Microphone access is granted at the OS level.

Android

Add to your AndroidManifest.xml:
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
On Android, consider using LCKOboe for lower latency microphone capture instead of LCKUnrealAudio.

Performance

MetricImpact
CPU< 1% overhead
Memory~1MB buffer
Latency1-2 frames

Troubleshooting

  1. Verify audio is playing through Unreal’s audio system (not FMOD/Wwise)
  2. Check that the master submix is not muted
  3. Check LogLCKUnrealAudio for errors
  1. Verify microphone permissions are granted
  2. Check that no other application is exclusively using the mic
  3. Confirm Audio Capture is enabled in Project Settings
  4. On Android, verify RECORD_AUDIO permission in manifest
  1. Use ULCKUnrealAudioBPL::GetUnrealAudioSamplerate() to query the actual rate
  2. Ensure FLCKRecorderParams::Samplerate matches
  3. Check Project Settings audio sample rate configuration

Log Category

DECLARE_LOG_CATEGORY_EXTERN(LogLCKUnrealAudio, Log, All);

See Also

Audio Overview

Audio system architecture

LCKOboe

Low-latency Android microphone