Overview
- Skill Key
- clawdianova/sonos-announce
- Author
- clawdianova
- Source Repo
- openclaw/skills
- Version
- 1.0.2
- Source Path
- skills/clawdianova/sonos-announce
- Latest Commit SHA
- 96a75bc4a8ec39fbb05a8be89b3313fba5f5b857
Play audio on Sonos with intelligent state restoration - pauses streaming, skips Line-In/TV/Bluetooth, resumes everything.
Stars
0
Installs
0
Status
ACTIVE
Visibility
PUBLIC
直接复制以下提示词,发送给你的 AI 助手即可完成安装。
请先检查是否已安装 SkillHub 商店,若未安装,请根据 https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/skillhub.md 安装 SkillHub 商店,然后安装 sonos-announce 技能。 若已安装,则直接安装 sonos-announce 技能。
# Sonos Announce
Play audio files on Sonos speakers with intelligent state restoration.
## When to use
- User wants to play an announcement on Sonos
- Soundboard effects (airhorn, rimshot, etc.)
- Any audio playback that should resume previous state
**This skill handles playback only** - audio generation (TTS, ElevenLabs, etc.) is separate.
## Quick Start
```python
import sys
import os
sys.path.insert(0, '/path/to/sonos-announce')
from sonos_core import announce
# Play audio and restore previous state
# Assumes audio is in default media_dir (~/.local/share/openclaw/media/outbound)
result = announce('my_audio.mp3')
```
## Installation
```bash
pip install soco
```
Requirements:
- `python3` - Python 3
- `ffprobe` - Part of ffmpeg, for audio duration detection
- `soco` - Python Sonos library
## Core Function
```python
announce(audio_file_path, wait_for_audio=True, media_dir=None)
```
### Parameters
| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `audio_file_path` | str | required | Filename (if using media_dir) or full path to audio file |
| `wait_for_audio` | bool | True | Wait for audio to finish playing before returning |
| `media_dir` | str | None | Directory where audio file is located (HTTP server will serve from here) |
### Returns
```python
{
'coordinators': 2,
'states': {
'192.168.1.120': {
'uri': 'x-sonos-spotify:spotify%3atrack%3a...',
'position': '0:01:23',
'queue_position': 5,
'was_playing': True,
'is_external': False,
'transport_state': 'PLAYING',
'speaker_name': 'Bedroom'
}
}
}
```
## Usage Examples
### Simple (file in default media directory)
```python
from sonos_core import announce
# File served from default media_dir
result = announce('announcement.mp3')
```
### With custom media directory
```python
from sonos_core import announce
# Full path to audio file
result = announce(
'my_audio.mp3',
media_dir='/home/user/audio/ann...
capt-marbles
Task Router
capncoconut
Register, communicate, and earn on the x402hub AI agent marketplace. Use when an agent needs to register on x402hub, browse or claim bounties, submit deliverables, send messages to other agents via x402 Relay, check marketplace stats, or manage agent credentials. Triggers on x402hub, agent marketplace, bounty, relay messaging, agent-to-agent communication, or USDC earning.
capevace
Real-time event bus for AI agents. Publish, subscribe, and share live signals across a network of agents with Unix-style simplicity.
captchasco
OpenClaw integration guidance for CAPTCHAS Agent API, including OpenResponses tool schemas and plugin tool registration.
carol-gutianle
name: modelready description: Start using a local or Hugging Face model instantly, directly from chat. metadata: {"openclaw":{"requires":{"bins": "bash", "curl" }, "env": "URL" }}
canbirlik
Controls Wiz smart bulbs (turn on/off, RGB colors, disco mode) via local WiFi.