audiowaveform

从音频文件生成波形可视化。适用于在用户请求时创建波形图像、为音频播放器生成可视化、为网页播放器输出波形数据、制作播客剧集预览与音频缩略图、渲染用于社交媒体的波形 PNG、提取峰值数据为 JSON,以及将波形生成集成到音频处理流程中。覆盖 audiowaveform 命令行工具、JSON/二进制数据输出与网页播放器集成场景。

仓库最近推送
GitHub Stars
219
Forks
38
Issues / PRs
1

安装方式

先用 Prompt 核对来源与依赖。也可下载安装包。

用 AI 助手安装

复制提示词,让助手先核对固定版本和依赖。

查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "audiowaveform":https://skillpi.com/zh/skills/deepskill-a6f8a6773b4835d149aab448fa612f7eef1289756bebb3d7be65178717b17c79。安装前核对上游来源和版本:https://github.com/TerminalSkills/skills。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。

来源与配置

github.com

配置方式待核实

请查看原始来源中的适用工具、依赖和权限要求。

安装实测待补充

从音频文件生成波形可视化。适用于在用户请求时创建波形图像、为音频播放器生成可视化、为网页播放器输出波形数据、制作播客剧集预览与音频缩略图、渲染用于社交媒体的波形 PNG、提取峰值数据为 JSON,以及将波形生成集成到音频处理流程中。覆盖 audiowaveform 命令行工具、JSON/二进制数据输出与网页播放器集成场景。

0 下载

介绍来源: third_party · TerminalSkills · 1.0.0 参考来源

SkillPi 解读

输入和输出
翻译待完成,请参阅来源文档。
实测状态
未测试

文件浏览

在原站浏览文件 ↗

原始 SKILL.md

打开原文 ↗
Frontmatter
name: audiowaveform
description: >-
  Generate waveform visualizations from audio files. Use when a user asks to
  create waveform images, build audio player visualizations, generate waveform
  data for web players, create podcast episode previews, build audio thumbnails,
  render waveform PNGs for social media, extract peak data as JSON, or integrate
  waveform generation into audio processing pipelines. Covers audiowaveform CLI,
  JSON/binary data output, and web player integration.
license: Apache-2.0
compatibility: 'Linux, macOS (audiowaveform 1.7+)'
metadata:
  author: terminal-skills
  version: 1.0.0
  category: content
  tags:
    - audiowaveform
    - waveform
    - audio
    - visualization
    - podcast

Audiowaveform

Overview

Generate waveform visualizations from audio files using BBC's audiowaveform tool. Renders PNG/SVG waveform images and outputs peak data as JSON or binary for web-based audio players (wavesurfer.js, peaks.js). Ideal for podcast players, music platforms, social media audio previews, and any UI that shows audio waveforms.

Instructions

Step 1: Installation

# Ubuntu/Debian
apt install -y audiowaveform

# macOS
brew install audiowaveform

# From source (if not in repos)
apt install -y cmake g++ libmad0-dev libsndfile1-dev libgd-dev libboost-filesystem-dev libboost-program-options-dev libboost-regex-dev
git clone https://github.com/bbc/audiowaveform.git
cd audiowaveform && mkdir build && cd build
cmake .. && make && make install

# Verify
audiowaveform --version

Step 2: Generate Waveform Images

Basic PNG waveform:

audiowaveform -i episode.wav -o waveform.png

Customized waveform:

audiowaveform -i episode.mp3 -o waveform.png \
  --width 1800 \
  --height 200 \
  --colors audacity \
  --background-color ffffff \
  --waveform-color 3b82f6 \
  --axis-label-color 666666 \
  --border-color ffffff \
  --zoom auto

Color schemes:

  • audacity — classic Audacity look
  • Custom: use hex --waveform-color, --background-color

High-res for social media (1200x630 — OG image size):

audiowaveform -i episode.wav -o social-preview.png \
  --width 1200 --height 630 \
  --background-color 1a1a2e \
  --waveform-color 00d4ff \
  --no-axis-labels

Specific time range:

audiowaveform -i episode.wav -o clip.png \
  --start 60 --end 180 \
  --width 800 --height 150

Split channels (stereo):

audiowaveform -i stereo.wav -o waveform.png --split-channels

Step 3: Generate Waveform Data (JSON)

For web players that render waveforms client-side:

# JSON output (peaks data)
audiowaveform -i episode.wav -o peaks.json \
  --pixels-per-second 20 \
  --bits 8

# Binary format (smaller files)
audiowaveform -i episode.wav -o peaks.dat \
  --pixels-per-second 20 \
  --bits 8

JSON structure:

{
  "version": 2,
  "channels": 1,
  "sample_rate": 44100,
  "samples_per_pixel": 2205,
  "bits": 8,
  "length": 1200,
  "data": [0, 45, -3, 67, 12, 89, ...]
}

Pixels-per-second guidelines:

  • 20 — good for full episode overview (podcast, 1-2h)
  • 50 — detailed view for songs (3-5 min)
  • 100 — very detailed, for short clips
  • 200+ — waveform editing precision

Step 4: Web Player Integration

With wavesurfer.js:

<div id="waveform"></div>
<button onclick="wavesurfer.playPause()">Play/Pause</button>

<script src="https://unpkg.com/wavesurfer.js@7"></script>
<script>
const wavesurfer = WaveSurfer.create({
  container: "#waveform",
  waveColor: "#3b82f6",
  progressColor: "#1d4ed8",
  cursorColor: "#ef4444",
  barWidth: 2,
  barRadius: 2,
  barGap: 1,
  height: 80,
  responsive: true,
  // Use pre-generated peaks for instant rendering
  peaks: null, // Will load from JSON
  url: "/audio/episode.mp3",
});

// Load pre-generated peaks (skip client-side decoding)
fetch("/waveforms/episode-peaks.json")
  .then(r => r.json())
  .then(data => {
    wavesurfer.load("/audio/episode.mp3", [data.data]);
  });
</script>

With peaks.js (BBC):

<div id="zoomview-container"></div>
<div id="overview-container"></div>

<script src="https://unpkg.com/peaks.js"></script>
<script>
const audioElement = document.getElementById("audio");

Peaks.init({
  containers: {
    zoomview: document.getElementById("zoomview-container"),
    overview: document.getElementById("overview-container"),
  },
  mediaElement: audioElement,
  dataUri: {
    json: "/waveforms/episode-peaks.json",
  },
  zoomLevels: [256, 512, 1024, 2048],
  overview: {
    waveformColor: "#3b82f6",
    playedWaveformColor: "#1d4ed8",
  },
  zoomview: {
    waveformColor: "#3b82f6",
    playedWaveformColor: "#1d4ed8",
  },
}, (err, peaks) => {
  if (err) console.error(err);
  // peaks instance ready
});
</script>

Step 5: Batch Processing & Pipeline

Generate waveforms for all episodes:

#!/bin/bash
# generate-waveforms.sh
AUDIO_DIR="./episodes"
OUT_DIR="./waveforms"
mkdir -p "$OUT_DIR"

for f in "$AUDIO_DIR"/*.{mp3,wav}; do
  [ -f "$f" ] || continue
  base=$(basename "$f" | sed 's/\.[^.]*$//')

  # PNG preview
  audiowaveform -i "$f" -o "$OUT_DIR/${base}.png" \
    --width 1200 --height 150 \
    --background-color ffffff --waveform-color 3b82f6

  # JSON peaks for web player
  audiowaveform -i "$f" -o "$OUT_DIR/${base}.json" \
    --pixels-per-second 20 --bits 8

  # Social media preview
  audiowaveform -i "$f" -o "$OUT_DIR/${base}-social.png" \
    --width 1200 --height 630 \
    --background-color 0f172a --waveform-color 38bdf8 --no-axis-labels

  echo "✅ $base"
done

Step 6: Convert Between Formats

# Binary → JSON
audiowaveform -i peaks.dat -o peaks.json

# JSON → PNG (render from pre-computed data)
audiowaveform -i peaks.json -o waveform.png \
  --width 1200 --height 200 \
  --zoom auto

# From raw audio → multiple outputs
audiowaveform -i input.wav -o peaks.dat --bits 8 --pixels-per-second 20
audiowaveform -i peaks.dat -o overview.png --width 2000 --height 100
audiowaveform -i peaks.dat -o detail.png --start 60 --end 120 --width 800 --height 200

Examples

Example 1: Generate waveform previews for a podcast website

User prompt: "I have 50 podcast episodes as MP3 files in ./episodes/. Generate PNG waveform previews and JSON peak data for each one so I can use them with wavesurfer.js on my Next.js site."

The agent will:

  1. Verify audiowaveform is installed, install it via apt or brew if missing.
  2. Create output directories ./waveforms/png/ and ./waveforms/json/.
  3. Write a bash loop that iterates over all .mp3 files in ./episodes/, generating a 1200x150 PNG with brand colors and a JSON peaks file at 20 pixels-per-second with 8-bit depth for each episode.
  4. Run the batch script and report how many waveforms were generated.
  5. Show a wavesurfer.js code snippet that loads the pre-generated JSON peaks for instant waveform rendering without client-side audio decoding.

Example 2: Create social media audio preview images

User prompt: "I need OG-image-sized waveform graphics for sharing podcast episodes on Twitter. Dark background, cyan waveform, no axis labels. Do episodes 10 through 15."

The agent will:

  1. Identify the audio files for episodes 10-15 in the episodes directory.
  2. Run audiowaveform for each file with --width 1200 --height 630 (OG image dimensions), --background-color 0f172a, --waveform-color 06b6d4, and --no-axis-labels.
  3. Save output files as episode-10-social.png through episode-15-social.png.
  4. Confirm the files were generated and note their file sizes.

Guidelines

  • Always check that audiowaveform is installed before running commands; it is not available in most default package managers and may require building from source on older systems.
  • Use --pixels-per-second 20 with --bits 8 for JSON peaks data intended for web players; higher values produce unnecessarily large files for overview waveforms.
  • Pre-generate waveform JSON server-side rather than decoding audio client-side; this eliminates multi-second load times for listeners on the web.
  • For social media images, use --no-axis-labels to produce cleaner graphics without time markers that clutter the visual at small sizes.
  • When processing large batches, generate the binary .dat format first, then render PNGs and JSONs from the .dat file to avoid re-reading the audio multiple times.

当前收录版本

1.0.0

核对来源版本 ↗

安全与评测信息

质量评测

满分100 · 来自 SkillPi LAB 实验室的评测报告。

场景价值95/100

亮点

  • 提供完整的音频波形可视化解决方案,涵盖 PNG/SVG 图像生成、JSON/二进制数据输出、网页播放器集成等核心功能
  • 支持多种实际应用场景:播客预览、社交媒体图像、音乐平台可视化、音频处理流水线等
  • 包含详细的安装指南、参数说明、代码示例和最佳实践,用户可直接落地使用
触发精准90/100

亮点

  • 触发词覆盖全面,包括波形图像生成、音频播放器可视化、播客预览、社交媒体波形图等多种使用场景
  • 明确指定了 audiowaveform CLI、JSON/二进制数据输出、网页播放器集成等具体技术栈
结构规范90/100

亮点

  • 结构清晰,分为安装、生成波形图像、生成波形数据、网页集成、批量处理、格式转换等逻辑步骤
  • 每个步骤都包含具体的命令示例和参数说明,便于用户理解和执行
  • 提供了完整的端到端示例,展示实际使用场景和解决方案
执行可靠85/100

待提升项

  • 缺少异常处理说明 原报告严重程度:轻微

    文档中未明确说明 audiowaveform 命令执行失败时的错误处理机制

    改进建议:建议在指南部分添加错误处理说明,如检查命令返回值、处理文件不存在等常见异常情况

亮点

  • 工具来源明确(BBC 的 audiowaveform),安装方式完整(apt/brew/源码编译)
  • 参数使用正确,提供了多种配置选项和最佳实践指导
  • 包含批量处理脚本和格式转换示例,展示了完整的执行流程
证据可验 (前四项均值)90/100

取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。

正文静态检测

100 / 100 · skillpi-20261123-no-r3-v1

正文未命中当前规则。

分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。

权限与使用前检查

根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。

  • 安装或获取外部依赖

    使用官方来源并锁定版本,在隔离环境检查安装脚本。当前文档检查不覆盖后续下载的代码。

    主文档提及 · 第 36, 39, 42 行
文档引用的域名或地址

这些地址可能用于文档链接或示例,不是已批准的联网清单。使用前核对实际目的地及发送的数据。

  • github.com
  • unpkg.com

本站展示提示不会授予权限。涉及文件改动、密钥、外部发送或费用时,仍由你使用的工具按需确认。

安全评级与访问范围

safe · 静态证据核验,不代表运行安全保证。

使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。