> ## Documentation Index
> Fetch the complete documentation index at: https://songbird.studiocollective.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# songbird-lyria

# songbird-lyria

AI music generation via Google's Gemini APIs — both real-time streaming and REST.

## What it owns

### Lyria RealTime (WebSocket, streaming)

* `GeminiClient` — WebSocket client speaking the Gemini Live protocol.
* `CircularAudioBuffer` — circular buffer with resampling for streaming generated audio into the engine at the host sample rate.
* `LyriaPlugin` — high-level orchestrator that sits behind the `lyria` channel in the sync engine.

### Lyria 3 (REST, non-streaming)

* `lyria3` module — HTTP client for the Gemini `generateContent` API.
* `Lyria3Model` — enum for Clip (30s) and Pro (full-length) models.
* `Lyria3Request` / `Lyria3Response` — request parameters and parsed audio response.

## Public API

* `GeminiClient`, `GeminiEvent`, `CircularAudioBuffer`, `LyriaPlugin`, plus the `types` module.
* `Lyria3Model`, `Lyria3Request`, `Lyria3Response` from the `lyria3` module.

## How it fits

* **Lyria RealTime**: Used by `songbird-app` (Tauri command path) to expose streaming Lyria generation. Talks to Gemini over WebSocket via `tokio-tungstenite`.
* **Lyria 3**: Used by `songbird-sync` (`ai.generate_lyria3` command handler) for one-shot audio generation. Talks to Gemini REST API via `reqwest`.

## Tests

`cargo test -p songbird-lyria`. Network-touching tests should be `#[ignore]`d by default.
