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
Sound Categories
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
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.
