> ## Documentation Index
> Fetch the complete documentation index at: https://docs.liv.tv/llms.txt
> Use this file to discover all available pages before exploring further.

# Audio API Overview

> API reference overview for the LCK audio system: ILCKAudioSource interface, FLCKAudioMix mixer, and ELCKAudioChannel enum.

<Info>
  **Module:** LCKAudio | **Version:** 1.0 | **Platforms:** All
</Info>

## Overview

The LCK audio system provides modular audio capture through a plugin architecture. Audio sources register as modular features and feed PCM data into a mixer that produces a final stereo output for the encoder.

This page covers the three core API types. For the full interface specification, see [ILCKAudioSource Interface](/api-reference/unreal/audio-source-interface).

***

## ELCKAudioChannel

Enum defining audio channel types. Used as a bitmask to declare source capabilities and request capture channels.

```cpp theme={null}
enum ELCKAudioChannel : uint64
{
    None       = 0,
    Game       = 1 << 0,   // Game audio (Unreal, FMOD, Wwise)
    Microphone = 1 << 1,   // Microphone input
    VoiceChat  = 1 << 2,   // Voice chat (Vivox)
    Max        = 1 << 3    // Maximum value marker
};
```

| Value        | Bit | Description                        |
| ------------ | --- | ---------------------------------- |
| `None`       | 0   | No channels                        |
| `Game`       | 0x1 | Game audio output                  |
| `Microphone` | 0x2 | Microphone input                   |
| `VoiceChat`  | 0x4 | Voice chat audio (send or receive) |

***

## FLCKAudioMix

Combines multiple `ILCKAudioSource` instances into a single stereo output for the encoder.

```cpp theme={null}
class FLCKAudioMix
{
public:
    void SetTargetSampleRate(int32 InSampleRate) noexcept;
    void AddSource(TWeakPtr<ILCKAudioSource> AudioSource) noexcept;
    TArray<float> StereoMix(TLCKAudioChannelsMask Channels);
    bool StartCapture() noexcept;
    void StopCapture() noexcept;
    void EnsureMicrophoneCapture() noexcept;
    float GetVolume() const noexcept;
};
```

| Method                      | Purpose                                                      |
| --------------------------- | ------------------------------------------------------------ |
| `SetTargetSampleRate(Hz)`   | Set the target sample rate for resampling (typically 48000)  |
| `AddSource(Source)`         | Register an audio source with the mixer (takes `TWeakPtr`)   |
| `StereoMix(Channels)`       | Return interleaved stereo PCM for the requested channel mask |
| `StartCapture()`            | Begin capture on all registered sources                      |
| `StopCapture()`             | Stop capture on all registered sources                       |
| `EnsureMicrophoneCapture()` | Start microphone capture if a mic source exists but is idle  |
| `GetVolume()`               | Get the current mixed volume level (0.0-1.0)                 |

### Usage Example

```cpp theme={null}
FLCKAudioMix AudioMix;

// Add sources
AudioMix.AddSource(UnrealAudioSource);
AudioMix.AddSource(FMODSource);

// Set target sample rate
AudioMix.SetTargetSampleRate(48000);

// Start capturing all registered sources
AudioMix.StartCapture();

// Each frame: get mixed audio for the encoder
TArray<float> MixedPCM = AudioMix.StereoMix(Channels);
Encoder->EncodeAudio(MixedPCM);
```

***

## ILCKAudioSource

The base interface all audio plugins implement. See the full specification at [ILCKAudioSource Interface](/api-reference/unreal/audio-source-interface).

| Method                   | Purpose                       |
| ------------------------ | ----------------------------- |
| `StartCapture()`         | Begin audio capture           |
| `StopCapture()`          | Stop audio capture            |
| `GetVolume()`            | Current audio level (0.0-1.0) |
| `GetSourceName()`        | Source identifier string      |
| `GetSupportedChannels()` | Channel capability bitmask    |

***

## Audio Source Plugins

| Plugin                                                     | Module         | Game | Mic | VoiceChat | Platform       |
| ---------------------------------------------------------- | -------------- | ---- | --- | --------- | -------------- |
| [Unreal Audio](/api-reference/unreal/audio/unreal-audio)   | LCKUnrealAudio | Yes  | Yes | No        | All            |
| [FMOD](/api-reference/unreal/audio/FMOD)                   | LCKFMOD        | Yes  | No  | No        | All            |
| [Wwise](/api-reference/unreal/audio/Wwise)                 | LCKWwise       | Yes  | No  | No        | Win64, Android |
| [Oboe (Android)](/api-reference/unreal/audio/Oboe-Android) | LCKOboe        | No   | Yes | No        | Android        |
| [Vivox](/api-reference/unreal/audio/Vivox)                 | LCKVivox       | Yes  | Yes | No        | All            |

***

## Related

<CardGroup cols={2}>
  <Card title="ILCKAudioSource Interface" icon="microphone" href="/api-reference/unreal/audio-source-interface">
    Full interface specification, delegate signature, and custom source guide
  </Card>

  <Card title="Types & Structs" icon="cube" href="/api-reference/unreal/types">
    Audio channel structs and configuration types
  </Card>
</CardGroup>
