返回顶部
a

audio-handler音频处理

Read, analyze, convert, and process audio files (MP3, WAV, FLAC, AAC, M4A, OGG, OPUS, WMA). Use when working with audio: extracting metadata, converting formats, trimming, merging, adjusting volume, or transcribing. Triggers on mentions of audio files, file paths with audio extensions, or requests to process/convert audio.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
694
下载量
免费
免费
1
收藏
概述
安装方式
版本历史

audio-handler

音频处理器

分析、转换和处理音频文件。

支持的格式

格式扩展名读取转换元数据
MP3.mp3
WAV
.wav | ✅ | ✅ | ✅ | | FLAC | .flac | ✅ | ✅ | ✅ | | AAC/M4A | .m4a, .aac | ✅ | ✅ | ✅ | | OGG | .ogg | ✅ | ✅ | ✅ | | Opus | .opus | ✅ | ✅ | ✅ | | WMA | .wma | ✅ | ✅ | ✅ | | AIFF | .aiff, .aif | ✅ | ✅ | ✅ |

快速命令

元数据 (ffprobe)

bash

获取所有元数据


ffprobe -v quiet -printformat json -showformat -show_streams audio.mp3

仅获取时长

ffprobe -v error -showentries format=duration -of default=noprintwrappers=1:nokey=1 audio.mp3

获取比特率

ffprobe -v error -showentries format=bitrate -of default=noprint_wrappers=1:nokey=1 audio.mp3

获取采样率和声道数

ffprobe -v error -selectstreams a:0 -showentries stream=samplerate,channels -of default=noprintwrappers=1 audio.mp3

人类可读信息

ffprobe -hide_banner audio.mp3

格式转换 (ffmpeg)

bash

转换为MP3(高质量)


ffmpeg -i input.wav -codec:a libmp3lame -qscale:a 2 output.mp3

转换为MP3(指定比特率)

ffmpeg -i input.wav -codec:a libmp3lame -b:a 192k output.mp3

转换为WAV(未压缩)

ffmpeg -i input.mp3 output.wav

转换为FLAC(无损)

ffmpeg -i input.wav output.flac

转换为M4A/AAC

ffmpeg -i input.wav -codec:a aac -b:a 256k output.m4a

转换为OGG Vorbis

ffmpeg -i input.wav -codec:a libvorbis -qscale:a 5 output.ogg

转换为Opus(最适合语音)

ffmpeg -i input.wav -codec:a libopus -b:a 64k output.opus

裁剪与截取

bash

裁剪音频(从30秒到90秒)


ffmpeg -i input.mp3 -ss 30 -to 90 -c copy output.mp3

从开头裁剪指定时长

ffmpeg -i input.mp3 -t 60 -c copy output.mp3 # 前60秒

重新编码裁剪(更精确)

ffmpeg -i input.mp3 -ss 30 -to 90 output.mp3

音量与速度

bash

调整音量(2倍音量)


ffmpeg -i input.mp3 -af volume=2 output.mp3

降低音量(一半)

ffmpeg -i input.mp3 -af volume=0.5 output.mp3

标准化音频

ffmpeg -i input.mp3 -af loudnorm output.mp3

加速(1.5倍)

ffmpeg -i input.mp3 -af atempo=1.5 output.mp3

减速(0.75倍)

ffmpeg -i input.mp3 -af atempo=0.75 output.mp3

合并与拼接

bash

拼接音频文件


ffmpeg -i concat:part1.mp3|part2.mp3|part3.mp3 -acodec copy output.mp3

使用文件列表合并

echo file part1.mp3 > list.txt echo file part2.mp3 >> list.txt ffmpeg -f concat -safe 0 -i list.txt -c copy output.mp3

混合两个音轨

ffmpeg -i voice.mp3 -i music.mp3 -filter_complex amix=inputs=2:duration=longest output.mp3

从视频中提取音频

bash

提取音轨


ffmpeg -i video.mp4 -vn -acodec copy audio.aac

提取并转换

ffmpeg -i video.mp4 -vn -acodec libmp3lame -b:a 192k audio.mp3

播放 (macOS)

bash

播放音频文件


afplay audio.mp3

带音量播放(0.0到1.0)

afplay -v 0.5 audio.mp3

后台播放

afplay audio.mp3 &

停止播放

killall afplay

文字转语音 (macOS)

bash

朗读文本


say 你好,这是一个测试

保存到文件

say -o output.aiff 这段文字将被保存为音频

列出语音

say -v ?

使用特定语音

say -v Tingting 你好,我是婷婷

转换为MP3

say -o temp.aiff 要转换的文字 && ffmpeg -i temp.aiff output.mp3 && rm temp.aiff

脚本

audio_info.sh

获取全面的音频元数据。

bash
~/Dropbox/jarvis/skills/audio-handler/scripts/audio_info.sh <音频文件>

convert_audio.sh

带质量选项的格式转换。

bash
~/Dropbox/jarvis/skills/audio-handler/scripts/convert_audio.sh <输入文件> <输出文件> [质量]

trim_audio.sh

带开始/结束时间的音频裁剪。

bash
~/Dropbox/jarvis/skills/audio-handler/scripts/trim_audio.sh <输入文件> <输出文件> <开始时间> <结束时间>

normalize_audio.sh

标准化音量级别。

bash
~/Dropbox/jarvis/skills/audio-handler/scripts/normalize_audio.sh <输入文件> <输出文件>

质量指南

使用场景格式设置
音乐存档FLAC-codec:a flac
便携音乐
MP3 | -codec:a libmp3lame -qscale:a 2 | | 播客/语音 | Opus | -codec:a libopus -b:a 64k | | 语音备忘录 | M4A | -codec:a aac -b:a 128k | | 未压缩 | WAV | -codec:a pcm_s16le |

备注

  • - ffmpeg 几乎支持所有音频格式
  • -c copy 速度快,但裁剪时可能不精确
  • 重新编码(-af)可实现精确裁剪,但耗时更长
  • Opus 在低比特率下最适合语音
  • 使用 loudnorm 滤镜可统一不同文件的音量

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 audio-handler-1776196774 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 audio-handler-1776196774 技能

通过命令行安装

skillhub install audio-handler-1776196774

下载

⬇ 下载 audio-handler v1.0.0(免费)

文件大小: 5.17 KB | 发布时间: 2026-4-15 12:22

v1.0.0 最新 2026-4-15 12:22
Initial release - extract metadata, convert, trim, normalize audio (MP3, WAV, FLAC, M4A, OGG, Opus)

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部