good-morning / README.md
clem
Switch icon to sun β˜€οΈ
cb56ac4
|
Raw History Blame Contribute Delete
3.25 kB
metadata
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, 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:

# 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:

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.<hash>.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