Preloader

About

Social

MicRaw

Offline Speech-to-Text

MicRaw: Offline Speech-to-Text for Unreal Engine

I created MicRaw, a free and open-source speech-to-text plugin for Unreal Engine. It gives developers an offline workflow for converting live microphone input and prerecorded WAV files into usable text without sending audio to a cloud service.

MicRaw combines Vosk for responsive real-time recognition with an optional Whisper workflow for more accurate final transcription. It can power subtitles, voice commands, accessibility features, dialogue capture, searchable transcripts, and other voice-driven gameplay systems.

The plugin is available on GitHub under the MIT License.

What I Built

MicRaw provides a complete transcription layer for Unreal Engine rather than a simple speech recognition wrapper.

Key features include:

  • Real-time microphone transcription
  • Prerecorded WAV file transcription
  • Fast offline recognition using Vosk
  • Optional Whisper final-pass transcription
  • Hybrid Vosk and Whisper processing
  • Live partial results and finalized transcript events
  • Built-in subtitle UI
  • Wake phrases, keyword detection, and voice commands
  • Asynchronous language loading and model caching
  • Runtime statistics and diagnostic events
  • Blueprint-accessible APIs
  • An editor tool for individual and batch WAV transcription
  • Persistent transcript and audio recording
  • Session browsing and dialogue export tools

Recognition Workflows

I designed three selectable recognition modes:

  1. Vosk Real-Time
    Optimized for responsive captions, voice commands, and live interaction.
  2. Whisper Final Pass
    Buffers audio and produces a higher-quality final transcript after a segment is completed.
  3. Vosk Live + Whisper Final
    Uses Vosk for immediate partial results and command detection while Whisper produces a refined final version of the same speech.

Each result carries source information, allowing downstream systems to distinguish between a live Vosk update and a refined Whisper result. I also prevented final Whisper results from triggering commands a second time in hybrid mode.

Problems I Tackled

Real-Time Audio Processing

Unreal’s microphone input does not arrive in a format that can simply be handed to every speech recognition engine. I built an audio pipeline that captures microphone samples, buffers them safely, prepares them for recognition, and sends results back to Unreal’s game-facing systems.

This required careful handling of:

  • Audio sample conversion
  • Buffer ownership
  • Recognition on background threads
  • Game-thread event delivery
  • Start, stop, flush, and failure states
  • Runtime performance reporting

Latency Versus Accuracy

Fast recognition and accurate recognition often require different approaches. Vosk is well suited to responsive partial transcription, while Whisper is better suited to refined final text but requires more processing.

The hybrid workflow addresses this tradeoff by giving the user immediate feedback through Vosk and replacing or supplementing it with a higher-quality Whisper result when the speech segment finishes.

Duplicate Voice Commands

Hybrid recognition introduces a subtle problem: the same spoken phrase can appear first as a Vosk result and later as a Whisper result. Without a guard, one phrase could trigger the same gameplay command twice.

I attached a source type to every recognition result and limited command evaluation to the appropriate live recognition source.

Large Language Models

The four large Vosk models used during development occupied approximately 9.2 GiB. Including them directly in Git would make the repository difficult to clone and exceed normal GitHub file limits.

I solved this by:

  • Keeping models and third-party binaries outside version control
  • Adding a PowerShell setup script
  • Downloading SDK files and language models from their official sources
  • Allowing users to choose small or large models
  • Documenting third-party licenses separately
  • Staging only installed models during Unreal packaging

This reduced the public source repository to approximately 0.38 MiB, excluding the optional dependencies.

Multilingual Text

MicRaw supports English, Hindi, Japanese, and Spanish. This exposed font and rendering issues, especially when using Unreal’s basic debug text tools, which do not contain all required glyphs.

I created a subtitle workflow using Unreal UI components and language-aware font configuration so multilingual text can be rendered correctly in production interfaces.

Unreal Engine Compatibility

Unreal Engine minor releases can change build defaults, include ordering, editor dependencies, and API behavior.

I added explicit compatibility checks and verified editor compilation across:

  • Unreal Engine 5.5
  • Unreal Engine 5.6
  • Unreal Engine 5.7
  • Unreal Engine 5.8

The plugin currently targets Win64 and uses version-aware build settings to surface compatibility problems early.

Technical Implementation

MicRaw is implemented as two Unreal modules:

  • MicRaw: runtime capture, recognition, subtitles, commands, storage, and Blueprint APIs
  • MicRawEditor: editor-only WAV transcription and batch-processing tools

The architecture separates recognition engines behind a shared backend interface. This allows Vosk, Whisper, and the hybrid workflow to use the same Unreal-facing component and event system.

The plugin integrates with:

  • Unreal Engine C++
  • Blueprint
  • Audio Capture
  • UMG and Slate
  • Unreal’s JSON system
  • Asynchronous tasks
  • Runtime dependency staging
  • Vosk’s native C API
  • whisper.cpp’s C API

Output and Integration

MicRaw can produce 7 export formats:

  • WAV
  • JSONL
  • TXT
  • SRT
  • VTT
  • CSV
  • JSON

These outputs support several use cases, including subtitles, dialogue review, narrative pipelines, accessibility records, searchable session history, and external processing.

Project Numbers

  • 4 supported Unreal Engine versions
  • 4 supported languages
  • 3 recognition modes
  • 7 export formats
  • 2 Unreal modules
  • 48 files in the initial public release
  • Approximately 7,900 lines of source and documentation
  • Approximately 9.2 GiB of optional Vosk models kept outside Git
  • Approximately 0.38 MiB for the public source repository
  • 100% local recognition, with no required cloud transcription service

Result

MicRaw turns speech recognition into a reusable Unreal Engine system that developers can access from both C++ and Blueprint. It handles audio capture, recognition, subtitles, commands, language models, editor tooling, persistence, exports, and engine compatibility in one plugin.

The result is a private, offline foundation for voice-enabled games and interactive applications, released publicly so other Unreal developers can use it, study it, and contribute to it.

Tech Stack

Engine

Unreal Engine 5.5–5.8

Language

C++ / Blueprint

License

MIT