Jump to content

Connect Leeroopedia MCP: Equip your AI agents to search best practices, build plans, verify code, diagnose failures, and look up hyperparameter defaults.

Implementation:Speechbrain Speechbrain Prepare Voicebank CTC

From Leeroopedia


Knowledge Sources
Domains Speech_Enhancement, Data_Preparation
Last Updated 2026-02-09 00:00 GMT

Overview

Concrete tool for preparing the Voicebank/VCTK dataset for ASR and speech enhancement tasks provided by the SpeechBrain library.

Description

This script prepares JSON manifest files for the Voicebank (VCTK) dataset, handling both clean and noisy speech recordings. It processes audio at 16kHz, splits speakers into train/valid/test sets, generates phoneme-level lexicon entries from the CMU dictionary, and creates JSON manifests containing paths to clean audio, noisy audio, and text transcriptions. The script also includes a download utility for obtaining and resampling the VCTK dataset.

Usage

Use this script when preparing data for CTC-based ASR or speech enhancement experiments on the Voicebank/VCTK corpus. It should be executed before running any Voicebank training recipe.

Code Reference

Source Location

Signature

def prepare_voicebank(
    data_folder, save_folder, valid_speaker_count=2, skip_prep=False
):

Import

from voicebank_prepare import prepare_voicebank

I/O Contract

Inputs

Name Type Required Description
data_folder str Yes Path to the folder where the original Voicebank dataset is stored
save_folder str Yes The directory where to store the JSON files
valid_speaker_count int No Number of validation speakers out of 28 in the train set (default: 2)
skip_prep bool No If True, skips data preparation (default: False)

Outputs

Name Type Description
train.json JSON file Training manifest with clean/noisy audio paths and transcriptions
valid.json JSON file Validation manifest
test.json JSON file Test manifest

Usage Examples

from voicebank_prepare import prepare_voicebank

prepare_voicebank(
    data_folder="/path/to/datasets/Voicebank",
    save_folder="exp/Voicebank_exp",
)

# With custom validation speaker count
prepare_voicebank(
    data_folder="/path/to/datasets/Voicebank",
    save_folder="exp/Voicebank_exp",
    valid_speaker_count=4,
)

Related Pages

Page Connections

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