What It Does
- Streams ambient and relaxation audio on demand
- Searches Freesound for a fresh sound each time
- Supports nature, weather, water, cozy, urban, noise, focus, and sleep categories
- Maps natural voice requests like
something cozyorhelp me focusto the best sound category - Redirects requests for songs, artists, or non-ambient music
- Streams audio chunk by chunk without bundling audio files
- Lets the user stop or pause playback through OpenHome music mode controls
- Keeps the session conversational so the user can request another sound or exit
Supported Requests
| Request type | Example | What happens |
|---|---|---|
| Weather ambience | Play rain | Searches for rain ambience and streams a selected preview |
| Water ambience | Ocean waves | Searches for ocean or wave sounds |
| Cozy ambience | Something cozy | Routes to campfire, cafe, or similar cozy soundscapes |
| Focus audio | Help me focus | Routes to focus-friendly ambience or background noise |
| Sleep audio | Help me sleep | Routes to sleep-friendly ambience |
| Noise | White noise | Searches for white, pink, brown, fan, or similar noise |
| Non-ambient music | Play Taylor Swift | Politely redirects because the ability is for ambient audio |
| Stop or exit | Stop | Stops playback or exits the session cleanly |
Sound Categories
| Group | Categories |
|---|---|
| Weather | rain, thunder, wind |
| Water | ocean, river, waterfall |
| Nature | forest, crickets |
| Cozy | campfire, cafe |
| Urban | city ambience |
| Noise | white noise, pink noise, brown noise, fan |
| Focus / Sleep | focus sounds, sleep sounds, meditation |
Example Prompts
- “Play rain.”
- “Ocean waves.”
- “Something cozy.”
- “Help me focus.”
- “White noise.”
- “Play something relaxing.”
- “Stop.”
- “Exit.”
Example Conversation
User: Play rain. AI: Alright, getting some rain sounds ready. Just a moment to set things up. Say stop whenever you’d like. [streams rain audio] User: Stop. AI: Alright. Want me to play some rain, ocean, or campfire next, or wrap up?
Trigger Phrases
- “ambient sounds”
- “play ambient sounds”
- “relaxing sounds”
- “sleep sounds”
- “focus sounds”
- “white noise”
- “play rain”
- “play ocean”
- “play campfire”
- “play cafe sounds”
- “help me relax”
- “help me focus”
- “help me sleep”
Data Source
| Source | OpenHome API key name | Role |
|---|---|---|
| Freesound API | freesound_api_key | Searching and streaming ambient audio previews |
Setup
Ambient Sounds uses the Freesound API. You need a Freesound account and API token.Getting a Freesound API Token
- Create or sign in to a Freesound account.
- Apply for a Freesound API token.
- Copy the generated token from your Freesound developer settings.
Adding the key to OpenHome
In OpenHome Settings -> API Keys, add a new key namedfreesound_api_key. Paste your Freesound token as the value and save.
Do not hardcode the key in main.py or store it in any prefs/config file.
Voice Flow
- The user triggers the ability.
- The ability routes the request to a sound category, exit, non-ambient redirect, or needs-input state.
- For a sound category, it speaks a short setup line to cover search latency.
- It searches Freesound with curated search terms for that category.
- It chooses one of the top matching audio previews.
- It streams the audio through OpenHome.
- If the user says stop, playback stops.
- After playback, the ability asks whether the user wants another sound or wants to wrap up.
- On exit, it clears music mode and returns control to the normal OpenHome conversation.
Notes
- Freesound is required for search and streaming.
- Audio is streamed from Freesound previews; no audio files are bundled with the ability.
- Each playback is a single selected sound, not an internal infinite loop.
- Requests outside ambient audio, such as specific songs or artists, are redirected.
Developer Credit
Developed by @yonaseth12.View on GitHub
Source code for the
noise-machine community ability.
