---
name: button_click_sfx.aiaudio
description: UI 按钮（设置/下载等）点击时的干净点击音效。
triggers: 需要生成 UI 按钮通用点击音效时触发。
---

# 按钮点击音效

## Recipe

生成提示词见 manifest.json generation.prompt。
- model: Google Lyria 3（平台默认，见 manifest.json generation.platformSkill）
- format: mp3
- loop: false

## Result

- 产物文件：`button_click.mp3`
- 在 Preloader.ts 中作为 `sfxButtonClick` key 加载

## Binding

```json
{
  "role": "sfxButtonClick",
  "target": "assets/sounds/button_click.mp3",
  "type": "audio-asset-reference"
}
```

## 生成方式

Platform Skill: `playcraft-audio-generation`

```bash
# 1. 生成 SFX（--prompt 必须英文）
playcraft tools generate-sfx \
     --prompt "clean button tap sound for UI buttons in mobile game" \
     --duration 1 \
     --output ta-workspace/raw_sfx.mp3

# 2. 归一化音量
playcraft audio normalize --input ta-workspace/raw_sfx.mp3 --output ta-workspace/raw_sfx.mp3 --target-loudness -16

# 3. 压缩（SFX 目标 ≤15KB）
playcraft audio compress --input ta-workspace/raw_sfx.mp3 --output ta-workspace/button_click.mp3 --target-size 15KB

# 4. 将产物写入 sandbox 对应路径（见 binding.target）
```
## Skill Definition

```yaml
tools:
  - generate_audio
inputs:
  - prompt: see manifest.json
outputs:
  - audio: button_click.mp3
```
