Agent skill

torchaudio

Audio signal processing library for PyTorch. Covers feature extraction (spectrograms, mel-scale), waveform manipulation, and GPU-accelerated data augmentation techniques. (torchaudio, melscale, spectrogram, pitchshift, specaugment, waveform, resample)

Stars 0
Forks 0

Install this agent skill to your Project

npx add-skill https://github.com/cuba6112/skillfactory/tree/main/skills/torchaudio

SKILL.md

Overview

TorchAudio provides signal processing tools for PyTorch, enabling users to treat audio processing as part of the neural network graph. This allow transforms to be run on GPUs and handled via nn.Sequential pipelines.

When to Use

Use TorchAudio for converting raw audio waveforms into features like Mel Spectrograms, performing data augmentation (SpecAugment), or when high-performance resampling is required.

Decision Tree

  1. Do you need to transform many audio files quickly?
    • MOVE: The transform module to GPU using .to('cuda').
  2. Are you training an Automatic Speech Recognition (ASR) model?
    • USE: SpecAugment (TimeMasking, FrequencyMasking) on the spectrogram.
  3. Do you need to align text to audio?
    • USE: The forced_align functional API with a Wav2Vec2 model.

Workflows

  1. Audio Feature Extraction Pipeline

    1. Load the waveform as a PyTorch tensor.
    2. Apply Resample to match the target frequency (e.g., 16000Hz).
    3. Use Spectrogram to convert to a power/amplitude scale.
    4. Convert the spectrogram to mel-scale using MelScale.
    5. Optionally apply AmplitudeToDB to get decibel values.
  2. GPU-Accelerated Data Augmentation

    1. Define an augmentation pipeline using nn.Sequential (e.g., TimeStretch, FrequencyMasking).
    2. Move the pipeline to the GPU (.to('cuda')).
    3. Process batches of spectrograms directly on the device to avoid CPU bottlenecks.
  3. Pitch and Speed Perturbation

    1. Use torchaudio.transforms.PitchShift for pitch changes without affecting duration.
    2. Apply torchaudio.transforms.Speed for speed changes (which also affects pitch).
    3. Iterate through a range of factors to create a diverse augmented dataset for speech recognition.

Non-Obvious Insights

  • GPU Efficiency: Moving audio transformations like MelScale to the GPU allows the entire feature extraction process to happen in parallel with model training, eliminating CPU data-loading bottlenecks.
  • ASR Robustness: SpecAugment techniques (Time/Frequency Masking) should be applied to the spectrogram, not the raw waveform, as they are designed to simulate missing acoustic information in the frequency domain.
  • Library Evolution: Starting with version 2.8, TorchAudio has entered maintenance, with some low-level decoding capabilities consolidated into the TorchCodec project.

Evidence

Scripts

  • scripts/torchaudio_tool.py: Utility for building an audio feature pipeline.
  • scripts/torchaudio_tool.js: Node.js wrapper for processing audio files via TorchAudio.

Dependencies

  • torchaudio
  • torch

References

  • TorchAudio Reference

Expand your agent's capabilities with these related and highly-rated skills.

cuba6112/skillfactory

prompt-engineering

Comprehensive prompt engineering techniques for Claude models. Use this skill when crafting, optimizing, or debugging prompts for Claude API, Claude Code, or any Claude-powered application. Covers system prompts, role prompting, multishot examples, chain of thought, XML structuring, long context handling, extended thinking, prompt chaining, Claude 4.x-specific best practices, and agentic orchestration including subagents, agent loops, skills, MCP integration, and multi-agent workflows.

0 0
Explore
cuba6112/skillfactory

adk-rag-agent

Build RAG (Retrieval-Augmented Generation) agents with Google ADK and Vertex AI RAG Engine. Use when implementing document Q&A, knowledge base search, or citation-backed responses. Covers VertexAiRagRetrieval tool, corpus setup, and citation formatting.

0 0
Explore
cuba6112/skillfactory

headless-cli-agents

Build agentic systems using Claude CLI in headless mode or the Claude Agent SDK. Use when building automation pipelines, CI/CD integrations, multi-agent orchestration, or programmatic Claude interactions. Covers CLI flags (-p, --output-format), session management (--resume, --continue), Python SDK (claude-agent-sdk), custom tools, and agent loop patterns.

0 0
Explore
cuba6112/skillfactory

notion-knowledge-capture

Capture conversations and decisions into structured Notion pages; use when turning chats/notes into wiki entries, how-tos, decisions, or FAQs with proper linking.

0 0
Explore
cuba6112/skillfactory

mcp-builder

Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).

0 0
Explore
cuba6112/skillfactory

gh-fix-ci

Inspect GitHub PR checks with gh, pull failing GitHub Actions logs, summarize failure context, then create a fix plan and implement after user approval. Use when a user asks to debug or fix failing PR CI/CD checks on GitHub Actions and wants a plan + code changes; for external checks (e.g., Buildkite), only report the details URL and mark them out of scope.

0 0
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results