--- title: Good Morning emoji: ☀️ colorFrom: yellow colorTo: red sdk: static pinned: false short_description: First app for the new Reachy Mini, by Clem Delangue tags: - reachy_mini - reachy_mini_python_app --- # Good Morning — a Reachy Mini app > **First!** The first Reachy Mini app built for the new version of Reachy > Mini, by [Clem Delangue](https://huggingface.co/clem), co-founder & CEO of > Hugging Face. Press a button → Reachy Mini says: > *"Good morning. Today is a good day to help more people become AI > builders, not just AI users thanks to open-source!"* The button lives at `http://localhost:7860/` whenever the app is running on your robot. The app also auto-opens that page in your default browser when it starts. ## Install From the project root: ```bash # Same Python env you use for the reachy-mini SDK (3.10–3.12). pip install -e . ``` This installs the `reachy_mini_apps` entry point `good_morning`, so the app shows up in the Reachy Mini dashboard's app list. ## Run Two options: **1) Through the Reachy Mini app system** (preferred — this is what makes it "an app"). Install from the Reachy Mini dashboard's **Discover Apps** panel, hit Start on the `good_morning` tile, and the app will pop your default browser open at `http://localhost:7860/`. Click the orange button. **2) Standalone, for quick testing:** ```bash python -m good_morning_app.main ``` Then open `http://localhost:7860/` and click the button. ## How it works The first time the app starts, `pyttsx3` synthesises the phrase once and caches it as `good_morning..wav` next to the code (the hash is derived from the phrase, so changing `PHRASE` auto-invalidates the cache). On every press we: 1. Load the cached WAV → mono float32, resampled to 16 kHz, shape `(N, 1)`. 2. Push it to the speaker with `reachy_mini.media.push_audio_sample(samples)` (the canonical TTS path per the SDK docs — there is no `.speak()` helper). 3. Sleep for the audio's duration since `push_audio_sample` is non-blocking. A small thread polls the local FastAPI's `/healthz` endpoint until it answers 200, then opens `http://localhost:7860/` in your default browser. ## Tweaking Open `src/good_morning_app/main.py`: - `PHRASE` — change what it says (audio cache is regenerated automatically). - `WEB_PORT` — where the button page lives. To swap the TTS engine (e.g. for Piper or an online voice), replace `_synthesize_phrase()` — anything that produces a WAV will work; the loader handles mono/stereo and resampling. ## Project layout ``` reachy-mini-good-morning/ ├── pyproject.toml # registers the reachy_mini_apps entry point ├── README.md # this file (HF Space frontmatter at the top) └── src/ └── good_morning_app/ ├── __init__.py └── main.py # GoodMorningApp(ReachyMiniApp) ``` ## References - Reachy Mini SDK: - Audio API (`push_audio_sample`): - Reference app (entry-point shape, `ReachyMiniApp` subclass):