Audio Processing Skill
A comprehensive toolset for audio manipulation and analysis with security validations.
Security
- File paths are validated to prevent path traversal attacks
- Access to system directories (/etc, /proc, /sys, /root) is blocked
- TTS text input is limited to 10,000 characters
- All file operations use resolved absolute paths
Tool API
audio_tool
Perform audio operations like transcription, text-to-speech, and feature extraction.
- Parameters:
action (string, required): One of transcribe, tts, extract_features, vad_segments, transform.
file_path (string, optional): Path to input audio file.
text (string, optional): Text for TTS (max 10,000 chars).
output_path (string, optional): Path for output file (default: auto-generated).
model (string, optional): Whisper model size (tiny, base, small, medium, large). Default: base.
ops (string, optional): JSON string of operations for transform action.
Usage:
# Transcribe audio file
uv run --with "openai-whisper" --with "pydub" --with "numpy" skills/audio-processing/tool.py transcribe --file_path input.wav
# Transcribe with specific model
uv run --with "openai-whisper" skills/audio-processing/tool.py transcribe --file_path input.wav --model small
# Text-to-speech
uv run --with "gTTS" skills/audio-processing/tool.py tts --text "Hello world" --output_path hello.mp3
# Extract audio features
uv run --with "librosa" --with "numpy" --with "soundfile" skills/audio-processing/tool.py extract_features --file_path input.wav
# Voice activity detection (find speech segments)
uv run --with "pydub" skills/audio-processing/tool.py vad_segments --file_path input.wav
# Transform audio (trim, resample, normalize)
uv run --with "pydub" skills/audio-processing/tool.py transform --file_path input.wav --ops '[{"op": "trim", "start": 10, "end": 30}, {"op": "normalize"}]'
Actions
transcribe
Convert speech to text using OpenAI Whisper.
- Returns:
{ "text": "...", "segments": [...] }
- Models: tiny, base, small, medium, large (larger = more accurate, slower)
tts
Generate speech from text using Google TTS.
- Returns:
{ "file_path": "output.mp3", "status": "created" }
- Language: English (default)
extract_features
Extract audio features for analysis.
- Returns: duration, sample_rate, mfcc_mean, rms_mean
- Useful for audio classification, quality analysis
vad_segments
Detect speech segments using silence detection.
- Returns:
{ "segments": [{ "start": 0.5, "end": 3.2 }, ...] }
- Uses FFmpeg silencedetect filter
- Aggressiveness: 1-3 (default: 2)
transform
Apply transformations to audio files.
- Operations: trim, resample, normalize
- Returns:
{ "file_path": "output.wav" }
Requirements
- ffmpeg: Required for VAD and transform operations
- Python 3.8+: All operations
- Disk Space: Whisper models range from 100MB (tiny) to 3GB (large)
Error Handling
- Returns JSON error object on failure
- Validates all file paths before processing
- Gracefully handles missing dependencies
1---
2name: audio-processing
3description: Audio ingestion, analysis, transformation, and generation (Transcribe, TTS, VAD, Features).
4metadata:
5 source: https://skillmd.com/skills/modbender/audio-processing
6 openclaw:
7 emoji: 🎙️
8 requires:
9 bins:
10 - ffmpeg
11 - python3
12 pip:
13 - openai-whisper
14 - gTTS
15 - librosa
16 - pydub
17 - soundfile
18 - numpy
19 - webrtcvad-wheels
20 install:
21 - id: ffmpeg
22 kind: brew
23 package: ffmpeg
24 label: Install ffmpeg
25 - id: python-deps
26 kind: pip
27 package: openai-whisper gTTS librosa pydub soundfile numpy webrtcvad-wheels
28 label: Install Python dependencies
29 version: 1.1.0
30---
31
32# Audio Processing Skill
33
34A comprehensive toolset for audio manipulation and analysis with security validations.
35
36## Security
37
38- File paths are validated to prevent path traversal attacks
39- Access to system directories (/etc, /proc, /sys, /root) is blocked
40- TTS text input is limited to 10,000 characters
41- All file operations use resolved absolute paths
42
43## Tool API
44
45### audio_tool
46Perform audio operations like transcription, text-to-speech, and feature extraction.
47
48- **Parameters:**
49 - `action` (string, required): One of `transcribe`, `tts`, `extract_features`, `vad_segments`, `transform`.
50 - `file_path` (string, optional): Path to input audio file.
51 - `text` (string, optional): Text for TTS (max 10,000 chars).
52 - `output_path` (string, optional): Path for output file (default: auto-generated).
53 - `model` (string, optional): Whisper model size (tiny, base, small, medium, large). Default: `base`.
54 - `ops` (string, optional): JSON string of operations for transform action.
55
56**Usage:**
57
58```bash
59# Transcribe audio file
60uv run --with "openai-whisper" --with "pydub" --with "numpy" skills/audio-processing/tool.py transcribe --file_path input.wav
61
62# Transcribe with specific model
63uv run --with "openai-whisper" skills/audio-processing/tool.py transcribe --file_path input.wav --model small
64
65# Text-to-speech
66uv run --with "gTTS" skills/audio-processing/tool.py tts --text "Hello world" --output_path hello.mp3
67
68# Extract audio features
69uv run --with "librosa" --with "numpy" --with "soundfile" skills/audio-processing/tool.py extract_features --file_path input.wav
70
71# Voice activity detection (find speech segments)
72uv run --with "pydub" skills/audio-processing/tool.py vad_segments --file_path input.wav
73
74# Transform audio (trim, resample, normalize)
75uv run --with "pydub" skills/audio-processing/tool.py transform --file_path input.wav --ops '[{"op": "trim", "start": 10, "end": 30}, {"op": "normalize"}]'
76```
77
78## Actions
79
80### transcribe
81Convert speech to text using OpenAI Whisper.
82
83- Returns: `{ "text": "...", "segments": [...] }`
84- Models: tiny, base, small, medium, large (larger = more accurate, slower)
85
86### tts
87Generate speech from text using Google TTS.
88
89- Returns: `{ "file_path": "output.mp3", "status": "created" }`
90- Language: English (default)
91
92### extract_features
93Extract audio features for analysis.
94
95- Returns: duration, sample_rate, mfcc_mean, rms_mean
96- Useful for audio classification, quality analysis
97
98### vad_segments
99Detect speech segments using silence detection.
100
101- Returns: `{ "segments": [{ "start": 0.5, "end": 3.2 }, ...] }`
102- Uses FFmpeg silencedetect filter
103- Aggressiveness: 1-3 (default: 2)
104
105### transform
106Apply transformations to audio files.
107
108- Operations: trim, resample, normalize
109- Returns: `{ "file_path": "output.wav" }`
110
111## Requirements
112
113- **ffmpeg:** Required for VAD and transform operations
114- **Python 3.8+:** All operations
115- **Disk Space:** Whisper models range from 100MB (tiny) to 3GB (large)
116
117## Error Handling
118
119- Returns JSON error object on failure
120- Validates all file paths before processing
121- Gracefully handles missing dependencies