Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Shyamalp16/CloudGaming/llms.txt

Use this file to discover all available pages before exploring further.

Overview

The host.audio section controls audio capture from the target process or system, Opus encoding parameters, WASAPI configuration, and latency optimization.

Process-Specific Audio Capture

Capture audio only from the target process instead of all system audio (requires Windows 11+).
audio.processLoopback.enabled
boolean
default:"true"
Enable process-specific loopback audio capture.Default: trueWhen enabled, only audio from the target process is captured. When disabled, all system audio is captured.
Requires Windows 11 or later. Falls back to system audio capture on older Windows versions.
audio.processLoopback.includeProcessTree
boolean
default:"true"
Include audio from child processes of the target.Default: trueUseful when the main application spawns child processes that also produce audio.

Opus Encoding

audio.bitrate
integer
default:"80000"
Opus encoding bitrate in bits per second.Default: 80000 (80 kbps)Recommended ranges:
  • 64000 (64 kbps) - Minimum quality
  • 80000 (80 kbps) - Good quality (default)
  • 128000 (128 kbps) - High quality
  • 192000 (192 kbps) - Maximum quality
80 kbps provides excellent quality for most use cases. Increase for music-focused applications.
audio.complexity
integer
default:"6"
Opus encoder computational complexity.Default: 6Range: 0 (lowest CPU) to 10 (highest CPU)Higher values improve quality at the same bitrate but use more CPU.
audio.application
integer
default:"2049"
Opus application type.Default: 2049 (OPUS_APPLICATION_AUDIO)Options:
  • 2048 - VOIP (optimized for speech)
  • 2049 - AUDIO (general purpose, music)
  • 2051 - RESTRICTED_LOWDELAY (lowest latency)
audio.channels
integer
default:"2"
Number of audio channels.Default: 2 (stereo)
  • 1 - Mono
  • 2 - Stereo
audio.frameSizeMs
integer
default:"10"
Opus frame size in milliseconds.Default: 10 msOptions: 2.5, 5, 10, 20, 40, 60Smaller values reduce latency but increase overhead. 10 ms is optimal for low-latency streaming.

Error Resilience

audio.enableFec
boolean
default:"true"
Enable Forward Error Correction (FEC) in Opus encoder.Default: trueFEC embeds redundant data to recover from packet loss. Slightly increases bitrate.
Keep enabled for network streaming. Only disable on perfect local networks.
audio.expectedLossPerc
integer
default:"5"
Expected packet loss percentage for FEC tuning.Default: 5 (%)Higher values increase FEC overhead but improve resilience.
audio.enableDtx
boolean
default:"false"
Enable Discontinuous Transmission (DTX).Default: falseReduces bitrate during silence by not encoding silent frames. Can cause audio artifacts in gaming.

WASAPI Configuration

Windows Audio Session API (WASAPI) settings for low-level audio capture.
audio.wasapi.preferExclusiveMode
boolean
default:"false"
Prefer WASAPI exclusive mode.Default: falseExclusive mode provides lower latency but prevents other applications from using the audio device.
May conflict with other audio applications. Only enable if you need absolute minimum latency.
audio.wasapi.enforceEventDriven
boolean
default:"true"
Use event-driven WASAPI mode.Default: trueEvent-driven mode is more efficient than polling and provides lower latency.
audio.wasapi.devicePeriodMs
float
default:"5.0"
Target device period in milliseconds.Default: 5.0 msLower values reduce latency but increase CPU usage and risk of audio glitches.
audio.wasapi.fallbackPeriodMs
float
default:"10.0"
Fallback period if target period is not supported.Default: 10.0 ms
audio.wasapi.force48kHzStereo
boolean
default:"true"
Force 48 kHz stereo capture format.Default: true48 kHz is optimal for Opus encoding. Resampling occurs if source is different.
audio.wasapi.preferLinearResampling
boolean
default:"true"
Use linear resampling instead of higher quality algorithms.Default: trueLinear resampling has lower latency. Set to false for better quality at cost of latency.
audio.wasapi.useDmoOnlyForHighQuality
boolean
default:"false"
Only use DirectX Media Objects (DMO) for high-quality resampling.Default: false

Latency Optimization

Advanced latency tuning for ultra-low-latency scenarios.
audio.latency.enforceSingleFrameBuffering
boolean
default:"true"
Minimize buffering to single frame.Default: trueReduces latency but requires consistent system performance.
audio.latency.maxFrameSizeMs
integer
default:"10"
Maximum frame size in milliseconds.Default: 10 msShould match frameSizeMs for lowest latency.
audio.latency.minFrameSizeMs
integer
default:"10"
Minimum frame size in milliseconds.Default: 10 ms
audio.latency.strictLatencyMode
boolean
default:"false"
Enable strict latency mode with aggressive buffering reduction.Default: false
May cause audio glitches on slower systems. Only enable for ultra-low-latency requirements.
audio.latency.warnOnBuffering
boolean
default:"true"
Log warnings when buffering exceeds target.Default: trueUseful for diagnosing audio latency issues.
audio.latency.targetOneWayLatencyMs
integer
default:"40"
Target one-way audio latency in milliseconds.Default: 40 msEnd-to-end latency target including capture, encode, network, and decode.
audio.latency.ultraLowLatencyProfile
boolean
default:"false"
Enable ultra-low-latency profile with all optimizations.Default: falseApplies aggressive settings for minimum latency. May reduce quality.
audio.latency.disableFecInLowLatency
boolean
default:"false"
Disable FEC in ultra-low-latency mode.Default: falseTrades error resilience for lower latency.

Adaptive Bitrate Control

Dynamic audio bitrate adjustment based on network conditions.
audio.bitrateAdaptation.enabled
boolean
default:"true"
Enable adaptive audio bitrate control.Default: trueAutomatically adjusts bitrate based on packet loss and network quality.
audio.bitrateAdaptation.minBitrate
integer
default:"64000"
Minimum bitrate in bps.Default: 64000 (64 kbps)
audio.bitrateAdaptation.maxBitrate
integer
default:"128000"
Maximum bitrate in bps.Default: 128000 (128 kbps)
audio.bitrateAdaptation.decreaseCooldownMs
integer
default:"2000"
Cooldown period after bitrate decrease.Default: 2000 ms
audio.bitrateAdaptation.increaseIntervalMs
integer
default:"10000"
Interval between bitrate increases.Default: 10000 ms
audio.bitrateAdaptation.increaseStep
integer
default:"8000"
Bitrate increase step size in bps.Default: 8000 (8 kbps)
audio.bitrateAdaptation.highLossThreshold
float
default:"0.05"
Packet loss threshold to trigger bitrate decrease.Default: 0.05 (5%)
audio.bitrateAdaptation.lowLossThreshold
float
default:"0.01"
Packet loss threshold to allow bitrate increase.Default: 0.01 (1%)
audio.bitrateAdaptation.cleanSamplesRequired
integer
default:"30"
Number of clean samples before increasing bitrate.Default: 30
audio.bitrateAdaptation.fecEnableThreshold
float
default:"0.03"
Packet loss threshold to enable FEC.Default: 0.03 (3%)
audio.bitrateAdaptation.fecDisableThreshold
float
default:"0.005"
Packet loss threshold to disable FEC.Default: 0.005 (0.5%)

Threading

audio.useThreadAffinity
boolean
default:"false"
Pin audio encoder thread to specific CPU cores.Default: false
audio.encoderThreadAffinityMask
integer
default:"0"
CPU affinity mask for encoder thread (bitmask of CPU cores).Default: 0 (no affinity)Example: 0x0F pins to first 4 cores.

Example Configurations

Low Latency Gaming

{
  "audio": {
    "processLoopback": {
      "enabled": true,
      "includeProcessTree": true
    },
    "bitrate": 64000,
    "complexity": 4,
    "frameSizeMs": 10,
    "enableFec": true,
    "latency": {
      "enforceSingleFrameBuffering": true,
      "strictLatencyMode": true,
      "ultraLowLatencyProfile": true
    }
  }
}

High Quality Music Streaming

{
  "audio": {
    "processLoopback": {
      "enabled": true
    },
    "bitrate": 128000,
    "complexity": 10,
    "frameSizeMs": 20,
    "enableFec": true,
    "bitrateAdaptation": {
      "enabled": true,
      "minBitrate": 96000,
      "maxBitrate": 192000
    }
  }
}

Unreliable Network

{
  "audio": {
    "bitrate": 80000,
    "enableFec": true,
    "expectedLossPerc": 10,
    "bitrateAdaptation": {
      "enabled": true,
      "highLossThreshold": 0.08,
      "fecEnableThreshold": 0.02
    }
  }
}

Build docs developers (and LLMs) love