Sample-accurate Metasound triggers from game code?

The MetaSound overview page claims that “sample-accurate” triggers can be executed from “gameplay events”. How to do this?UAudioComponent::SetTriggerParameteris only tick-accurate. Is there any function (C++ or blueprint) that can run a trigger at a specific (sub-tick) time?

short answer: not from the game thread, by construction. the game thread ticks at frame boundaries; the audio render thread runs its blocks on its own clock (typically every 1024 or 512 samples). a game thread call can never land inside an audio block, only before it.

what the engine gives you:

  1. set trigger parameter (audio component or metasound source): the value is delivered to the render thread by the next block. that is tick accurate plus at most one block of latency, which for 60fps game plus 512-sample blocks is a few milliseconds worst case. this is what most games ship with and what the docs loosely call sample accurate.
  2. quartz: when the timing requirement is musical, quartz exists precisely for this. schedule sounds on a clock with beats per minute, and the audio render thread executes the scheduled events on the sample clock. a trigger that must land on a beat or subdivision belongs here, not in tick.
  3. the metasound input trick for offset scheduling: pass a time offset (in seconds or beats) as a float input alongside the trigger, and inside the metasound use a delay or scheduled node so the audio graph itself places the event on the sample grid. the game thread only needs to be close; the metasound does the sample accurate math. this is the pattern harmonix uses for beat synced content.
  4. true audio-thread callbacks from gameplay code do not exist in blueprint and are limited in c++ (you can write a custom metasound node or DI that talks to the audio render thread directly, but the boundary is strict: no game thread calls from the render side, communication through lock-free queues).
    practical recipe for gameplay to audio tight sync: quartz clock plus a metasound with a beat scheduled envelope or trigger, values set via parameters on the component, one frame of game tolerance absorbed by the metasound’s internal scheduling. if you need single-shot punchy events (impacts, ui), the set trigger next block latency is perceptually transparent below roughly 10ms.