Documentation Unity plugins
Docs/Ecosystem
Draft documentation · API may change

Ecosystem

VoxScribe -> PocketMind -> Vocalis.

This guide explains the intended offline voice assistant shape using the actual VoiceAssistantDemo source and the adjacent current APIs. SonicLoad sits beside the voice path for file and buffer import/export.

Pipeline at a glance

The real VoiceAssistantDemo path

The source sample in Assets/Denisitree/PocketMind/Samples/VoiceAssistantDemo.cs contains two active operations:

VoiceAssistantDemo.cs
chat = GetComponent<PocketMindChat>();
chat.SendAsync("What is the next objective in this scene?");

That sample does not call VoxScribe or Vocalis directly. The complete pipeline below is therefore an integration shape built from the real public APIs, not a claim that one existing sample already wires all three plugins together.

Step by step

1. Prepare audio input with VoxScribe

Add VoxScribeRecognizer, configure modelPath and language, then call StartListening. For an existing clip, call TranscribeAsync and await the returned string.

2. Send recognized text to PocketMind

Pass the recognized text to PocketMindChat.SendAsync. The class appends a user message, formats Llama 3 markers and calls native generation. Listen to OnCompleted for the implemented response path.

3. Speak the completed response with Vocalis

Give the completed response to VocalisSpeaker.SpeakAsync, with target set to an AudioSource. The speaker checks native availability, synthesizes and plays the returned clip.

4. Use SonicLoad around the edges

Use AudioLoader for file, byte or URL clip input and WavEncoder for the implemented WAV export path. This is useful for saved prompts, recorded buffers or debug artifacts, but it is not called by the provided VoiceAssistantDemo.

Integration shape

string transcript = await recognizer.TranscribeAsync(clip);
await chat.SendAsync(transcript);
// Handle chat.OnCompleted, then call speaker.SpeakAsync(response).
Prototype boundary: this compact flow is an integration sketch using real method names. The source does not currently emit VoxScribe recognizer events, does not invoke PocketMind.OnToken, and the included PocketMind sample does not show Vocalis playback.

Ownership and threading

  • VoxScribe wraps full native inference in Task.Run and has a separate queued MainThreadDispatcher helper.
  • PocketMind wraps native generation in Task.Run and invokes OnCompleted after it returns.
  • Vocalis wraps native synthesis in Task.Run and creates an AudioClip after the result returns.
  • SonicLoad uses asynchronous file/network APIs and a background task for WAV decoding.
  • Unity object access, event listeners and AudioSource playback still need a Unity-safe lifecycle in the integrating project.

What is implemented vs planned

AreaImplemented in sourceNot implemented or not wired
Speech inputAudioClip conversion path and recognizer lifecycle methods.Recognizer event emission and queue population are not shown.
Local reasoningCompleted generation and OnCompleted event.OnToken is declared but not invoked.
Speech outputNative synthesis to AudioClip and AudioSource playback.Validated cross-platform packaging is not present.
Audio filesWAV decode and 16-bit PCM WAV encode.MP3, FLAC and OGG export are planned in the SonicLoad sample.

Troubleshooting / FAQ

Planned

  • A single sample scene that wires microphone input, recognized text, local response completion and speech playback.
  • VoxScribe partial/final event emission and microphone queue feeding.
  • PocketMind token event emission.
  • Validated native library packaging across target platforms.

Something unclear?

Ask Denis