Token导航 LogoToken导航TokenDH.com
开发敏感数据clawhub未标认证来源可访问clear审计提醒

sonos-announce索诺斯宣布

Agent Skill

sonos-announce 用于处理音频、语音、转写和声音素材相关任务,适合在 OpenClaw 中需要整理音频流程、转写内容或生成配音素材时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

18,360

周安装

750

GitHub Stars

公开资料未说明

下载量

5,940
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:sonos-announce(索诺斯宣布)
来源仓库:https://github.com/clawdianova/sonos-announce
安装命令:
openclaw skills install sonos-announce
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install sonos-announce

简介

通过智能状态恢复功能在 Sonos 上播放音频 - 暂停流媒体、跳过线路输入/电视/蓝牙、恢复一切。

SKILL.md

name
sonos-announce
version
1.0.2
description
Play audio on Sonos with intelligent state restoration - pauses streaming, skips Line-In/TV/Bluetooth, resumes everything.
metadata

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

ParameterTypeDefaultDescription
audio_file_pathstrrequiredFilename (if using media_dir) or full path to audio file
wait_for_audioboolTrueWait for audio to finish playing before returning
media_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'
    }
  }
}

Usage Examples

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:

VariableDefaultDescription
SONOS_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

PlatformStatusNotes
macOS✅ SupportedFull support
Linux✅ SupportedFull support
Windows✅ 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 TypeBehavior
Spotify 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 input
TV/HDMIRe-connected to TV audio
BluetoothRe-connected to Bluetooth
Paused 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

IssueSolution
No speakers foundEnsure on same network as Sonos speakers
Resume not workingCheck speakers were playing (not paused) before announcement
HTTP server failedCheck port 8888 is available, or set SONOS_HTTP_PORT
Module import errorRun: pip install soco
Duration detection failsEnsure ffprobe is installed (part of ffmpeg)

Files

  • sonos_core.py - Main module with announce() function
  • SKILL.md - This documentation

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

需要根据任务场景推荐可安装能力包时

04

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

95.85%
按下载量换算5,693

安全审计

VirusTotal

可疑

ClawScan

通过

Static analysis

未展示

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills