Skip to content

kunitoki/sonic-skills / skills/game-audio-review

game-audio-review

Verified

Reviews game audio code for Wwise/FMOD integration safety, custom DSP plugin correctness, and audio middleware usage. Use when the user asks to review a Wwise plugin, check an FMOD DSP effect, audit game audio middleware integration, or asks "is my game audio code safe?". Trigger on phrases like "review my Wwise plugin", "check FMOD DSP effect", "is my game audio code safe", "review my audio middleware integration", or when you see AkPluginInfo, FMOD_DSP_DESCRIPTION, IMetaSoundSource, or Execute/process callbacks in game audio code.

Game Audio Middleware Review

Middleware callbacks share all realtime constraints of native audio, plus middleware-specific memory, threading, and parameter rules.

Step 0 — Run universal checks first

Invoke audio-dsp-review and audio-numerics-review before this skill. This skill adds middleware-specific checks on top; it does not replace realtime-safety or numerics reviews.

Step 1 — Identify the integration type

TypeEntry pointKey concerns
Wwise pluginAkPluginInfo + Execute()Memory via AkAlloc, thread model per platform
FMOD DSP effectFMOD_DSP_DESCRIPTION + process callbackFMOD_MEMORY_ALLOC, must not block
Unreal MetaSoundsIMetaSoundSource, GetNextBufferGameThread vs AudioThread ownership
Custom engine integrationEngine audio callbackPlatform-specific thread model and priorities

Step 2 — Scan for violations

ViolationWhereRisk
Allocating from any heap inside the audio callbackplugin Execute/processRealtime violation; middleware allocators are for setup/teardown, not per-buffer allocation
Blocking I/O from audio callbackExecute/processXrun / dropout
Accessing game engine state from audio threadExecute/processNot thread-safe; data race or stale read
Event or parameter changes without thread-safe channelgame loop → audioData race on shared state
DSP plugin not handling bypass correctlyExecute/processIncorrect audio output in bypass mode
Not respecting channel count negotiationplugin initBuffer overread / underwrite
Missing AK_OPTIMIZED guard around debug codeany plugin codeDebug I/O included in shipping build
Wwise RTPC not clamped before useparameter readOut-of-range value fed to DSP; clipping or NaN
FMOD parameter index used as a magic numberparameter readWrong value applied after descriptor edits; use a shared enum tied to paramdesc order
Unreal: accessing UAudioComponent from AudioThreadGetNextBufferGameThread-only object; crashes on non-GameThread

Step 3 — Write the review

## Game Audio Review: `[file / plugin class]`

### Verdict
[Safe | Has critical violations | Warnings only] — [one sentence summary]

### Integration Type
[Wwise plugin | FMOD DSP | Unreal MetaSounds | Custom engine]

### Critical Violations
**[Category]: [description]**
`file:line` — `offending code`
Why: [one sentence on the middleware / realtime risk]
Fix: [concrete middleware-idiomatic suggestion]

### Warnings
[same format]

### What's Done Well
[correct patterns observed]

### Recommended Fixes (priority order)
1. ...

Quick fix table

ViolationFix
Allocation in Wwise ExecutePre-allocate in Init with AK_PLUGIN_ALLOC / AK_PLUGIN_FREE
Allocation in FMOD processPre-allocate in create/reset with dsp_state->functions->alloc / free
Blocking call in callbackMove to game thread; pass result via lock-free queue or atomic
Game engine state read on audio threadCache a thread-safe copy; update via std::atomic or SPSC queue
Wwise bypass not handledLeave buffer untouched and return; do not write to output
Channel count assumed constantRead from io_pBuffer->NumChannels() or FMOD inchannels at runtime
FMOD parameter by magic numberDefine enum indices and keep descriptor order in one place
Unreal GameThread object on AudioThreadMarshal via AsyncTask(ENamedThreads::GameThread, ...)

For code structure examples (Wwise, FMOD, MetaSounds, thread models, memory patterns) see references/game-audio-patterns.md.

rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first.Stars: 194kUpdated Claude CodeCodexVerifiedInstall