# RAI: ROS 2 text-to-speech agent

Receive ROS 2 speech text and play synthesized audio using Kokoro TTS or an OpenTTS alternative.

ID: `rai-examples-s2s-tts-py`

Record version: `source-21186a99d1aa7d8a7dd9ed0715e3afae8dd5f0834743afffa3d074082e14d496`

Hub commit: `66a13cd6ae8ab828219a4916587fb83d6dc71809`

## Access

Fetch the pinned repository, verify this source checksum, and use upstream installation and invocation. This record does not install or execute code.

Optional inert file retrieval: `python /PATH_TO_SKILL/scripts/rsh.py fetch-source rai-examples-s2s-tts-py --expected-source-revision b018729833742c6f71e1e9f332ee2b435676fb4f --expected-source-sha256 21186a99d1aa7d8a7dd9ed0715e3afae8dd5f0834743afffa3d074082e14d496 --project ./experiment --json`. This verifies one file, preserves provenance and never installs or runs it. See [source-file retrieval](https://hub.superfastrobotics.com/source-files.md).

Hub preparation adapter: **false**. Runtime verification: **not_run**.

Upstream setup: https://github.com/RobotecAI/rai/blob/b018729833742c6f71e1e9f332ee2b435676fb4f/docs/setup/install.md

## Source and license

- Repository: https://github.com/RobotecAI/rai
- Pinned source: https://github.com/RobotecAI/rai/blob/b018729833742c6f71e1e9f332ee2b435676fb4f/examples/s2s/tts.py
- Revision: `b018729833742c6f71e1e9f332ee2b435676fb4f`
- Path: `examples/s2s/tts.py`
- Source SHA256: `21186a99d1aa7d8a7dd9ed0715e3afae8dd5f0834743afffa3d074082e14d496`
- Source bytes: 2330
- Original authors: Robotec.AI (per-file copyright notice)
- License: [Apache-2.0](https://github.com/RobotecAI/rai/blob/b018729833742c6f71e1e9f332ee2b435676fb4f/LICENSE)
- License scope: Selected first-party source and per-file notices; excludes models, dependencies, datasets, simulator assets and external service terms.

License SHA256: `c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4`

## Artifact

```json
{
  "kind": "workflow",
  "format": "python",
  "workflow_role": "speech-inference"
}
```

## Requirements

```json
{
  "python": "Root/core/whoami/perception/semap/s2s use >=3.10,<3.13; standalone finetune uses >=3.10,<3.12. Match sourced ROS distribution Python.",
  "packages": [
    "Pinned RAI checkout",
    "Matching ROS 2 and rai_interfaces",
    "Per-workflow packages, local model or hosted-provider dependencies from pinned setup"
  ],
  "display": "Official setup documents ROS 2 Humble/Jazzy, rai_interfaces and feature-specific environment. Nothing installed or runtime verified.",
  "execution_domain": "computation-or-hardware",
  "source_imports": [
    "argparse",
    "rai_s2s",
    "rai_s2s.sound_device",
    "rclpy",
    "signal",
    "time"
  ],
  "notes": "Upstream per-workflow profile declarations only; provider availability, dependency resolution and runtime/robot compatibility are unverified.",
  "declared_requirements": {
    "speech": {
      "gpu": "LocalWhisper selects CUDA when available and library default otherwise. Kokoro documentation declares CPU default/fallback and optional CUDA 12/cuDNN 9 setup. No capacity or throughput guarantee.",
      "external_models": "Selected Whisper, Silero VAD, OpenWakeWord or Kokoro ONNX assets. Upstream initialization can obtain assets; none were downloaded. OpenTTS requires an external server.",
      "api": "Selected ASR example uses local Whisper and TTS example local Kokoro. Other supported speech providers include hosted OpenAI/ElevenLabs with credentials; use of those providers is not implied by these examples.",
      "evidence_paths": [
        "src/rai_s2s/README.md",
        "src/rai_s2s/pyproject.toml",
        "src/rai_s2s/rai_s2s/asr/models/local_whisper.py",
        "src/rai_s2s/rai_s2s/tts/models/kokoro_tts.py"
      ]
    }
  }
}
```

## Invocation

```json
{
  "entrypoint": "python examples/s2s/tts.py",
  "notes": "Source/setup invocation shape only; not executed or runtime verified. Source references only; no Hub adapter, compatibility promise, provider access grant or runtime result. Known limits: Source constructs KokoroTTS before checking --tts-model; selecting OpenTTS does not establish that Kokoro initialization/assets are avoided. Example constructs Kokoro before checking its OpenTTS alternative; selecting OpenTTS does not establish that Kokoro initialization/model assets are avoided."
}
```

## Compatibility

```json
[]
```

Missing environment fields remain unknown. Source discovery labels do not establish robot compatibility.

## Evidence

Level: **source_reviewed**. Runtime verification: **not_run**.

Verified exact source, applicable license and author/setup document bytes at a full Git commit; parsed the Python AST and reviewed this guarded operational entrypoint and its explicit license notices. No upstream code, installation, robot command, dataset, mesh or checkpoint was executed or loaded.

Source review and contributor reports do not establish task completion. Preserve upstream attribution and licenses.
