# Send Sonos Announce to your agent
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
## Fast path
- Download the package from Yavira.
- Extract it into a folder your agent can access.
- Paste one of the prompts below and point your agent at the extracted folder.
## Suggested prompts
### New install

```text
I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete.
```
### Upgrade existing

```text
I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run.
```
## Machine-readable fields
```json
{
  "schemaVersion": "1.0",
  "item": {
    "slug": "sonos-announce",
    "name": "Sonos Announce",
    "source": "tencent",
    "type": "skill",
    "category": "AI 智能",
    "sourceUrl": "https://clawhub.ai/clawdianova/sonos-announce",
    "canonicalUrl": "https://clawhub.ai/clawdianova/sonos-announce",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadUrl": "/downloads/sonos-announce",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=sonos-announce",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "packageFormat": "ZIP package",
    "primaryDoc": "SKILL.md",
    "includedAssets": [
      "SKILL.md",
      "sonos_core.py"
    ],
    "downloadMode": "redirect",
    "sourceHealth": {
      "source": "tencent",
      "slug": "sonos-announce",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-05-03T20:25:02.769Z",
      "expiresAt": "2026-05-10T20:25:02.769Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=sonos-announce",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=sonos-announce",
        "contentDisposition": "attachment; filename=\"sonos-announce-1.0.4.zip\"",
        "redirectLocation": null,
        "bodySnippet": null,
        "slug": "sonos-announce"
      },
      "scope": "item",
      "summary": "Item download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this item.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/sonos-announce"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    }
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/sonos-announce",
    "downloadUrl": "https://openagent3.xyz/downloads/sonos-announce",
    "agentUrl": "https://openagent3.xyz/skills/sonos-announce/agent",
    "manifestUrl": "https://openagent3.xyz/skills/sonos-announce/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/sonos-announce/agent.md"
  }
}
```
## Documentation

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

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

pip install soco

Requirements:

python3 - Python 3
ffprobe - Part of ffmpeg, for audio duration detection
soco - Python Sonos library

### Core Function

announce(audio_file_path, wait_for_audio=True, media_dir=None)

### Parameters

ParameterTypeDefaultDescriptionaudio_file_pathstrrequiredFilename (if using media_dir) or full path to audio filewait_for_audioboolTrueWait for audio to finish playing before returningmedia_dirstrNoneDirectory where audio file is located (HTTP server will serve from here)

### Returns

{
  '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'
    }
  }
}

### Simple (file in default media directory)

from sonos_core import announce

# File served from default media_dir
result = announce('announcement.mp3')

### With custom media directory

from sonos_core import announce

# Full path to audio file
result = announce(
    'my_audio.mp3', 
    media_dir='/home/user/audio/announcements'
)

### Full path (no media_dir)

from sonos_core import announce

# Uses directory of file as media_dir
result = announce('/full/path/to/audio.mp3')

### Environment Variables

Configure the HTTP server for streaming to Sonos:

VariableDefaultDescriptionSONOS_HTTP_HOSTauto-detectedLAN IP address (auto-detected)SONOS_HTTP_PORT8888HTTP server port

# Set before running (optional)
export SONOS_HTTP_HOST=192.168.1.100  # Override auto-detected IP
export SONOS_HTTP_PORT=8888           # Override port

# Or set in code before importing
import os
os.environ['SONOS_HTTP_HOST'] = '192.168.1.100'

from sonos_core import announce
announce('audio.mp3')

### Supported Platforms

PlatformStatusNotesmacOS✅ SupportedFull supportLinux✅ SupportedFull supportWindows✅ SupportedUses taskkill and start /b

The module automatically detects your platform and uses appropriate commands for:

Killing the HTTP server
Starting the HTTP server in background

### State Restoration

The module intelligently restores previous playback state:

Source TypeBehaviorSpotify TrackResumed at exact position (seek)Spotify PlaylistResumed at exact position (seek)Spotify RadioResumed from start (no seek)Internet RadioResumed from start (no seek)Line-InRe-connected to Line-In inputTV/HDMIRe-connected to TV audioBluetoothRe-connected to BluetoothPaused contentLeft paused

### Seeking Behavior

Some streaming services don't support seeking to a specific position:

Can seek: Spotify tracks, Spotify playlists, local files, queue items
Cannot seek: Spotify Radio, TuneIn radio, Pandora, Tidal radio

The module automatically detects these and handles accordingly.

### External Input Detection

Automatically detects inputs that cannot be paused:

x-rincon:RINCON_* - Line-In
x-rincon-stream:RINCON_* - Line-In stream
x-sonos-htastream:* - TV/HDMI (Sonos Home Theater)
x-sonos-vanished:* - Vanished device
x-rincon-bt:* - Bluetooth

### Soundboard Example

from sonos_core import announce

SOUNDS = {
    'airhorn': '/path/to/sounds/airhorn.mp3',
    'rimshot': '/path/to/sounds/rimshot.mp3',
    'victory': '/path/to/sounds/victory.mp3',
}

def play_sound(name):
    """Play a sound effect."""
    if name in SOUNDS:
        announce(SOUNDS[name])
    else:
        print(f"Unknown sound: {name}")

### Troubleshooting

IssueSolutionNo speakers foundEnsure on same network as Sonos speakersResume not workingCheck speakers were playing (not paused) before announcementHTTP server failedCheck port 8888 is available, or set SONOS_HTTP_PORTModule import errorRun: pip install socoDuration detection failsEnsure ffprobe is installed (part of ffmpeg)

### Files

sonos_core.py - Main module with announce() function
SKILL.md - This documentation
## Trust
- Source: tencent
- Verification: Indexed source record
- Publisher: clawdianova
- Version: 1.0.4
## Source health
- Status: healthy
- Item download looks usable.
- Yavira can redirect you to the upstream package for this item.
- Health scope: item
- Reason: direct_download_ok
- Checked at: 2026-05-03T20:25:02.769Z
- Expires at: 2026-05-10T20:25:02.769Z
- Recommended action: Download for OpenClaw
## Links
- [Detail page](https://openagent3.xyz/skills/sonos-announce)
- [Send to Agent page](https://openagent3.xyz/skills/sonos-announce/agent)
- [JSON manifest](https://openagent3.xyz/skills/sonos-announce/agent.json)
- [Markdown brief](https://openagent3.xyz/skills/sonos-announce/agent.md)
- [Download page](https://openagent3.xyz/downloads/sonos-announce)