用途:为应用生成风格协调的整套 UI 音效(audio theme),把声音映射到标准交互常量,适用于钱包、仪表盘、社交、生产力工具等界面的点击、通知、状态切换等场景。
主要能力:通过 ElevenLabs 文本转音效 API 批量生成音效;提供 corporate-trust、crypto-modern、playful-delight、minimal-focus、retro-digital、pixel-minimal、premium-luxury 等 vibe 预设,也支持自定义描述;可按类别生成或重生成单个声音;默认对每个文件做 -3 dBFS 峰值归一化(需 ffmpeg);提供本地试听选择器,支持试听、分配、波形编辑、非破坏性修订与历史回退;并提供现有产品音效审计脚本,校验语义事件到声音的映射。声音常量覆盖按钮、导航、反馈、状态、模态框和钱包交易等类别。
使用方式:需在环境中设置 ELEVENLABS_API_KEY。常用命令示例: python scripts/generate_theme.py --vibe "crypto-modern" --output-dir "./audio-theme" python scripts/generate_theme.py --vibe-custom "warm organic subtle wooden interface sounds" --output-dir "./audio-theme" python scripts/generate_theme.py --regenerate "button-click-primary,notification-success" --vibe "crypto-modern" --output-dir "./audio-theme" python scripts/sound_picker.py --vibe pixel-minimal --output-dir ./audio-theme python scripts/audit_theme.py ./audio-event-map.json --theme ./public/audio/ui/theme.json
限制与注意事项:浏览器自动播放策略要求用户先有首次点击、点按或按键才可播放音频;悬停提示音需比点击音低 40-60% 并做节流;交易音效应在广播、等待、确认等状态转换时触发而非点击时;音频能否被感知需用 ffmpeg -i file.mp3 -af volumedetect -f null - 检查峰值并实际试听。具体价格、平台支持范围与完整依赖配置资料未提供。