Voice chat with Meridian

Real-time voice pipeline: speech-to-text via any Whisper-compatible endpoint, LLM chat completion, and text-to-speech synthesis through Azure Speech Services.

STT
Whisper-compatible
Chat
Meridian LLM
TTS
azure-swc/tts

Usage

// 1. Capture audio → base64 PCM
const audio = await captureMic({ durationMs: 4000 });

// 2. STT via Whisper-compatible endpoint
const transcript = await fetch("/api/stt", {
  method: "POST",
  body: JSON.stringify({ audio: audio.base64 }),
}).then(r => r.json());

// 3. Chat completion
const reply = await fetch("/api/chat", {
  method: "POST",
  body: JSON.stringify({ messages: [{ role: "user", content: transcript.text }] }),
}).then(r => r.json());

// 4. TTS via Azure Speech
const speech = await fetch("/api/tts", {
  method: "POST",
  body: JSON.stringify({ text: reply.content, voice: "en-US-AvaNeural" }),
}).then(r => r.arrayBuffer());

playAudio(speech);

LOCK — Meridian Voice Pipeline