RootIB: RB-20260309020034-C9D0E1F2
# LiveEcho × OBS — YouTube Streaming Guide

**LiveEcho** generates real-time AI narration in your voice while you work.
This guide shows you how to route that narration audio into OBS so it appears
in your YouTube live stream or recording alongside your screen.

---

## Prerequisites

| Tool | Where to get |
|------|-------------|
| OBS Studio | https://obsproject.com |
| LiveEcho | https://barbrickdesign.github.io/liveEcho.html |
| Chrome / Edge / Firefox | Any modern browser |

---

## Option A — System Audio Route (simplest)

OBS can capture all audio playing on your computer — including browser TTS.

### Steps

1. **Open LiveEcho** in your browser at
   `https://barbrickdesign.github.io/liveEcho.html`

2. **Configure LiveEcho settings** (right panel):
   - Set *Persona Style* and *Persona Prompt* as desired.
   - Make sure *Voice on* is checked.
   - Optionally, configure the AI backend URL + API key for real narration.

3. **Open OBS Studio.**

4. **Add a Desktop Audio capture source:**
   - In the *Sources* panel, click **+** → **Audio Output Capture**
     (Windows) or **Audio Output Capture / Built-in Audio** (macOS).
   - Name it `LiveEcho TTS`.
   - Select your system default output device (the same one your browser plays through).

5. **Add a Screen Capture source:**
   - Click **+** → **Display Capture** or **Window Capture**.
   - Point it at the window / screen you want to show.

6. **Start LiveEcho:**
   - Click **Start LiveEcho** in the browser.
   - Choose the screen/window to narrate.
   - You should hear narration through your speakers immediately.

7. **Test in OBS:**
   - Watch the Audio Mixer. You should see `LiveEcho TTS` level meters moving
     when narration is spoken.
   - Adjust the volume fader as needed.

8. **Go live or start recording** in OBS.

> **Tip:** Lower your system master volume, then raise the OBS Desktop Audio
> fader to compensate. This avoids bleed from other system sounds.

---

## Option B — Virtual Audio Cable (pro setup)

For maximum control (separate narration track, no system bleed), use a virtual
audio device so LiveEcho's TTS goes only into OBS.

### Tools needed

| Platform | Recommended tool |
|----------|-----------------|
| Windows  | [VB-Audio Virtual Cable](https://vb-audio.com/Cable/) (free) |
| macOS    | [BlackHole](https://github.com/ExistentialAudio/BlackHole) (free) |
| Linux    | PulseAudio virtual sink / PipeWire loopback |

### Steps (Windows + VB-Audio)

1. Install VB-Audio Virtual Cable.

2. In **Windows Sound Settings → Playback**, set
   `CABLE Input (VB-Audio)` as your default playback device
   — or just switch your browser's output device to CABLE Input.

3. In **OBS Audio Settings**, add an *Audio Input Capture* source
   pointing at `CABLE Output (VB-Audio)`. OBS now receives whatever
   the browser (LiveEcho TTS) sends to the virtual cable.

4. Add your screen capture source for the primary video.

5. Optionally add a *Desktop Audio* source for your normal system sounds
   (music, notifications, etc.) so those go on a separate OBS audio track.

6. Run LiveEcho, go live in OBS. Done.

### Steps (macOS + BlackHole)

1. Install BlackHole 2ch.

2. Open **Audio MIDI Setup** → create a **Multi-Output Device** that
   includes both `BlackHole 2ch` and your speakers.
   Set this as the system output so you can still hear the narration.

3. In **OBS Audio Settings** → *Audio Input Capture* → select `BlackHole 2ch`.

4. Follow the same steps as Windows above.

---

## Recommended OBS Scene Layout

```
Scene: LiveEcho Stream
├── Display Capture (your main screen)
├── Browser Source (optional: LiveEcho window overlay)
├── Audio Output Capture  ← system / virtual cable
└── Microphone (optional: your real mic for commentary)
```

---

## Audio Mixing Tips

- **Narration should be prominent** — set the LiveEcho TTS track 2–4 dB
  louder than background music, 6–10 dB quieter than your live mic (if used).
- **Remove silence** — LiveEcho only speaks when narration is generated,
  so gaps are normal. Add background music as a secondary audio source.
- **Clip filter** — Add a *Compressor* filter to the LiveEcho TTS source in
  OBS to smooth out any volume spikes.

---

## Latency Notes

LiveEcho generates narration in real time:
- **Local template mode**: near-instant (~100 ms)
- **AI backend mode**: typically 1–3 seconds (depends on your API / model)

For live streaming, this delay is acceptable — viewers see the screen at the
same time they hear the narration. For recorded videos, the narration and
screen action are naturally sync'd because LiveEcho samples the screen at the
moment it generates each narration burst.

---

## Troubleshooting

| Symptom | Fix |
|---------|-----|
| No audio in OBS | Verify the LiveEcho "Voice on" checkbox is checked; check OBS Audio Mixer for the correct source |
| TTS speaks but OBS doesn't capture it | Switch to virtual cable (Option B) so browser audio routes directly to OBS |
| Narration cuts off | Reduce the screen capture interval or check AI backend latency |
| Echoey / doubled audio | Mute the CABLE Input in Windows Playback to prevent it going back to speakers twice |
| Long delay before narration | Lower the AI model's `max_tokens`; use a faster model like `gpt-4o-mini` |

---

## Configuring the AI Backend (optional)

For real AI narration instead of the local template:

1. Start the LiveEcho backend server:

   ```bash
   cd backend
   PORT=3210 MODEL_API_KEY=sk-YOUR_KEY node liveecho-server.js
   ```

2. In LiveEcho → **AI Backend Config**:
   - **Backend URL**: `http://localhost:3210/api/narrate`
   - **API Key**: your `sk-...` key (stored in memory only, never saved)

3. Or deploy the server to Railway / Fly.io / Render and use the public URL.

### Available environment variables

| Variable | Default | Description |
|----------|---------|-------------|
| `PORT` | 3210 | HTTP port |
| `MODEL_API_URL` | `https://api.openai.com/v1/chat/completions` | OpenAI-compatible endpoint |
| `MODEL_API_KEY` | — | API key (required) |
| `MODEL_NAME` | `gpt-4o` | Model name (use `gpt-4o-mini` for faster/cheaper) |
| `ALLOWED_ORIGIN` | `https://barbrickdesign.github.io` | CORS allowed origin |
| `MAX_TOKENS` | 150 | Max tokens per narration response |

---

## Resources

- LiveEcho: https://barbrickdesign.github.io/liveEcho.html
- OBS Studio: https://obsproject.com
- VB-Audio Cable: https://vb-audio.com/Cable/
- BlackHole (macOS): https://github.com/ExistentialAudio/BlackHole
- BarbrickDesign: https://barbrickdesign.github.io

---

*Created by Ryan Barbrick — BarbrickDesign@gmail.com*
