跳到正文
Skillpedia
音频与语音7.8k · #12841

incremental-audio-workflow

它能做什么

这项技能为 AI 提供一份清单,用于分步骤、经过验证地制作音频。它适合用多个独立分轨制作音乐或声音的人。

适用场景

  • ✓当我要用多个独立部分制作曲目,并希望检查每一部分的时候。
  • ✓当我希望在生成任何音频之前,先根据速度算出时间安排的时候。
  • ✓当我需要把鼓作为独立分轨,并进行节奏处理的时候。

技能链接

https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/audio-track-production-enhanced/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/audio-track-production-enhanced/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“我想制作一首带有已验证分轨的曲目。请从速度和长度开始,带我一步步完成。”

每周 5 个新技能,1 分钟读完。

工作原理

AI 会先算出各段落的时间安排,然后逐一制作并检查每个分轨,应用效果,最后导出并归档母带。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Incremental Audio Production Workflow

This skill provides a resilient pattern for audio production that emphasizes incremental verification and fail-fast principles. Each major step produces verified outputs before proceeding, reducing iteration count and catching errors early.

Overview

Follow these steps in strict order. Each step must complete successfully and pass verification before proceeding to the next:

  1. Early timing calculation - Derive section transitions from BPM and duration first
  2. Verify reference audio - Validate input file properties
  3. Generate and verify each stem individually - One stem at a time with immediate verification
  4. Generate drum stem separately - Dedicated drum extension with rhythm patterns
  5. Apply effects with verification - Process each stem and verify output
  6. Export master track - Mix all verified stems
  7. Archive and final verification - Package deliverables with comprehensive checks

Key Differences from Standard Workflow

  • Incremental verification: Verify each stem immediately after generation, not just at the end
  • Fail-fast approach: Stop and report errors at each step rather than accumulating failures
  • Early timing: Calculate section transitions before any audio generation
  • Separated drums: Drum stem generation is a distinct step with rhythm-specific processing
  • Memory-efficient: Process stems individually to avoid large array operations that cause sandbox failures

Step 1: Calculate Timing Parameters (Early)

Calculate all timing parameters before generating any audio. This ensures consistent timing across all stems:

def calculate_section_transitions(bpm, total_duration_sec, sections):
    """Calculate beat-aligned transition points for song sections."""
    beats_per_second = bpm / 60.0
    
    section_durations = {}
    cumulative_time = 0
    
    for section_name, beat_count in sections.items():
        duration = beat_count / beats_per_second
        section_durations[section_name] = {
            'start': cumulative_time,
            'end': cumulative_time + duration,
            'beats': beat_count,
            'start_beat': cumulative_time * beats_per_second
        }
        cumulative_time += duration
    
    return section_durations

# Configuration
BPM = 120
DURATION = 137
SECTIONS = {'intro': 16, 'verse': 32, 'chorus': 32, 'bridge': 16, 'outro': 16}

timing = calculate_section_transitions(BPM, DURATION, SECTIONS)
print("Timing calculated:")
for section, data in timing.items():
    print(f"  {section}: {data['start']:.2f}s - {data['end']:.2f}s ({data['beats']} beats)")

Step 2: Verify Reference Audio

Validate the reference file exists and has expected properties:

import soundfile as sf
import os

def verify_reference_file(filepath, expected_sample_rate=None, min_duration=None):
    """Verify reference audio file and return info dict."""
    if not os.path.exists(filepath):
        raise FileNotFoundError(f"Reference file not found: {filepath}")
    
    info = sf.info(filepath)
    errors = []
    
    if expected_sample_rate and info.samplerate != expected_sample_rate:
        errors.append(f"Sample rate mismatch: expected {expected_sample_rate}, got {info.samplerate}")
    
    if min_duration and info.duration < min_duration:
        errors.append(f"Duration too short: expected >= {min_duration}s, got {info.duration}s")
    
    if errors:
        raise ValueError(f"Reference file validation failed: {'; '.join(errors)}")
    
    print(f"Reference verified: {info.duration:.2f}s @ {info.samplerate}Hz, {info.channels}ch, {info.subtype}")
    return {
        'sample_rate': info.samplerate,
        'duration': info.duration,
        'channels': info.channels,
        'subtype': info.subtype
    }

# Verify reference
ref_info = verify_reference_file('reference.wav', expected_sample_rate=48000, min_duration=130)

Step 3: Generate and Verify Each Stem Individually

Generate one stem at a time, verify it immediately before proceeding to the next:

import numpy as np

def generate_stem(name, duration_sec, sample_rate, subtype='FLOAT', section_timing=None):
    """Generate a single stem with explicit sample type."""
    frames = int(duration_sec * sample_rate)
    t = np.linspace(0, duration_sec, frames)
    
    # Generate stem-specific content (customize per stem type)
    if name == 'bass':
        freq = 110  # A2
        audio_data = 
常见问题

为什么要先计算时间?

根据速度和长度了解段落的变化,可以让分轨保持同步。

最后会发生什么?

经过最终检查后,所有交付文件会被打包在一起。

这和标准工作流程有什么不同?

每个分轨在制作完成后就立即检查,而不是只在最后检查。

详情

作者的原始描述

Step-by-step audio production with per-stem verification, timing alignment, and incremental quality gates

repo: HKUDS/AgentPilot

热度

GitHub 星标
7.8k
排名
#12841
许可证
MIT
更新时间
2026/11/1

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能