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

# FMOD

> API reference for FLCKFMODSource, the audio source that captures game audio from FMOD Studio via DSP callback.

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

## Overview

LCKFMOD captures game audio from the FMOD Studio master bus using a non-destructive DSP callback. It provides game audio only; pair it with LCKUnrealAudio or LCKOboe for microphone capture.

## Supported Channels

| Channel      | Supported | Description                   |
| ------------ | --------- | ----------------------------- |
| `Game`       | Yes       | FMOD Studio master bus output |
| `Microphone` | No        | Use LCKUnrealAudio or LCKOboe |
| `VoiceChat`  | No        | Use LCKVivox                  |

***

## FLCKFMODSource

Audio source class that captures FMOD master bus output via a DSP attached at `FMOD_CHANNELCONTROL_DSP_TAIL`. Implements `ILCKFeatureInstance`.

```cpp theme={null}
class FLCKFMODSource : public ILCKFeatureInstance
{
public:
    // ILCKFeatureInstance interface
    virtual bool StartCapture() noexcept override;
    virtual bool StartCapture(TLCKAudioChannelsMask Channels) noexcept override;
    virtual void StopCapture() noexcept override;
    virtual float GetVolume() const noexcept override;
    virtual const FString& GetSourceName() const noexcept override;

    // FMOD-specific
    int32 Samplerate = 48000;

protected:
    TLCKAudioChannelsMask SupportedChannels = ELCKAudioChannel::Game;
};
```

### ILCKFeatureInstance Methods

| Method                   | Behavior                                                    |
| ------------------------ | ----------------------------------------------------------- |
| `StartCapture()`         | Attaches DSP to the FMOD master bus and begins capture      |
| `StartCapture(Channels)` | Begins capture if `Game` is in the requested channel mask   |
| `StopCapture()`          | Detaches DSP and stops capture                              |
| `GetVolume()`            | Returns current RMS volume of captured game audio (0.0-1.0) |
| `GetSourceName()`        | Returns `"LCKFMOD"`                                         |

### Fields

| Field        | Type    | Default | Description                    |
| ------------ | ------- | ------- | ------------------------------ |
| `Samplerate` | `int32` | 48000   | FMOD output sample rate in Hz. |

<Warning>
  Ensure the FMOD sample rate matches your encoder configuration (typically 48000 Hz). Mismatched sample rates between game audio and voice chat cause distortion.
</Warning>

***

## FLCKFMODModule

Module that manages the lifecycle of `FLCKFMODSource`.

```cpp theme={null}
class FLCKFMODModule : public IModuleInterface
{
public:
    virtual void StartupModule() override;
    virtual void ShutdownModule() override;

private:
    TSharedPtr<FLCKFMODSource> FeatureInstance;
};

IMPLEMENT_MODULE(FLCKFMODModule, LCKFMOD)
```

On startup, the module detects the FMODStudio plugin, creates an `FLCKFMODSource`, and registers it as a modular feature. On shutdown, it detaches the DSP callback, unregisters, and destroys the source.

<Warning>
  **LCKFMOD requires the FMODStudio plugin** which must be downloaded separately from [fmod.com](https://www.fmod.com/download). The LCKFMOD plugin is disabled by default and will not compile without FMODStudio installed.
</Warning>

***

## Log Category

```cpp theme={null}
DECLARE_LOG_CATEGORY_EXTERN(LogLCKFMOD, Log, All);
```

***

## Related

<CardGroup cols={2}>
  <Card title="FMOD Setup Guide" icon="headphones" href="/unreal/audio/fmod">
    Integration guide with configuration steps and troubleshooting
  </Card>

  <Card title="Audio Overview" icon="volume-high" href="/api-reference/unreal/audio/overview">
    Audio system API overview
  </Card>
</CardGroup>
