# Voice & AI

Phone-side cloud ASR/TTS bootstrap, offline glass speech features, AI streaming chat, plus how pieces stitch together end-to-end.

## Pages

- [Phone SDK init (ASR/TTS)](./01-%E6%89%8B%E6%9C%BA%E7%AB%AF-SDK-%E5%88%9D%E5%A7%8B%E5%8C%96%EF%BC%88ASR-TTS%EF%BC%89.md)
- [Glass TTS & ASR](./02-%E7%9C%BC%E9%95%9C%E7%AB%AF-TTS-%E4%B8%8E-ASR.md)
- [Glass AI Chat](./03-%E7%9C%BC%E9%95%9C%E7%AB%AF-AI-Chat.md)

## Reading order

1. Phone bootstrap — where hosted voice services negotiate credentials.  
2. Glass lane — contrasts offline wakewords vs streamed ASR lanes.  
3. AI Chat — ties microphones, cloud ASR responses, playback together.

## Capability wiring

| Feature | Responsibility | Typical host screen |
| --- | --- | --- |
| Offline wake-word | Local hot-word triggers | `HomeActivity` |
| Offline TTS | Local narration | `SendMessageActivity` |
| Cloud ASR | Dictation-grade dictation | `SendMessageActivity` |
| Cloud TTS | Hosted speech synthesis | Provisioned phone init; stubs on glass |
| AI Chat | LLM streamed answers | `SdkMediaActivity` |

## End-to-end mental model

```mermaid
sequenceDiagram
    participant U as User
    participant G as Glass client
    participant A as ASR service
    participant AI as AI Chat
    participant T as TTS playback

    U->>G: Speak
    G->>A: Begin speech decode
    A-->>G: Partial/final hypotheses
    G->>AI: Forward user question text
    AI-->>G: Incremental narration tokens
    G->>T: Render reply as audible speech
    T-->>U: Playback
```
