Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Speechbrain Speechbrain Create Aishell1Mix From Metadata

From Leeroopedia


Knowledge Sources
Domains Speech Separation, Data Preparation
Last Updated 2026-02-09 00:00 GMT

Overview

Concrete tool for creating Aishell1Mix audio mixtures from pre-generated metadata provided by the SpeechBrain library.

Description

This script reads metadata CSV files generated by the companion metadata creation script and produces the actual mixed audio files for the Aishell1Mix speech separation dataset. It combines source utterances from AISHELL-1 with optional WHAM! noise at specified frequencies (8kHz, 16kHz), modes (min, max), and mixture types (mix_clean, mix_both, mix_single). The script supports parallel processing for efficient generation of large-scale mixture datasets.

Usage

Use this when generating the Aishell1Mix mixed audio files from previously created metadata for speech separation training with SpeechBrain recipes.

Code Reference

Source Location

Signature

def create_aishell1mix(
    aishell1_dir, wham_dir, out_dir, metadata_dir, freqs, n_src, modes, types
):

CLI Interface

python create_aishell1mix_from_metadata.py \
    --aishell1_dir /path/to/aishell1/data_aishell/wav \
    --wham_dir /path/to/wham_noise \
    --metadata_dir /path/to/aishell1mix/metadata \
    --aishell1mix_outdir /path/to/aishell1mix \
    --n_src 2 \
    --freqs 8k 16k \
    --modes min max \
    --types mix_clean mix_both mix_single

I/O Contract

Inputs

Name Type Required Description
aishell1_dir str Yes Path to AISHELL-1 root directory containing WAV files
wham_dir str Yes Path to WHAM! noise root directory
metadata_dir str Yes Path to the Aishell1Mix metadata directory with CSV files
aishell1mix_outdir str Yes Path to the desired output dataset root directory
n_src int No Number of sources in mixtures (default: 2)
freqs list[str] No Target frequencies, e.g., ["8k", "16k"] (default: ["8k", "16k"])
modes list[str] No Mixing modes, e.g., ["min", "max"] (default: ["min", "max"])
types list[str] No Mixture types (default: ["mix_clean", "mix_both", "mix_single"])

Outputs

Name Type Description
Mixed WAV files WAV Audio Files Generated mixture and source audio files organized by frequency, mode, and type

Usage Examples

# Typically invoked via command line:
# python create_aishell1mix_from_metadata.py --aishell1_dir /data/aishell1/wav --wham_dir /data/wham_noise --metadata_dir /data/aishell1mix/metadata --aishell1mix_outdir /data/aishell1mix

# Or programmatically:
from create_aishell1mix_from_metadata import create_aishell1mix

create_aishell1mix(
    aishell1_dir="/data/aishell1/data_aishell/wav",
    wham_dir="/data/wham_noise",
    out_dir="/data/Aishell1Mix2",
    metadata_dir="/data/aishell1mix/metadata",
    freqs=["8k", "16k"],
    n_src=2,
    modes=["min", "max"],
    types=["mix_clean", "mix_both", "mix_single"],
)

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment