Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
F

FastSpeech2

> 编程语言
Open source

Multi-Speaker Pytorch FastSpeech2: Fast and High-Quality End-to-End Text to Speech :fist:

99 stars0 likes0 views
WebsiteGitHub

About

Multi-Speaker Pytorch FastSpeech2: Fast and High-Quality End-to-End Text to Speech :fist:

Multi-speaker FastSpeech 2 - PyTorch Implementation :zap:

  • This is a PyTorch implementation of Microsoft's FastSpeech 2: Fast and High-Quality End-to-End Text to Speech.

  • Now supporting about 900 speakers in :fire: LibriTTS for multi-speaker text-to-speech.

Datasets :elephant:

This project supports 2 muti-speaker datasets:

:fire: Single-Speaker

  • LJSpeech

:fire: Multi-Speaker

  • LibriTTS

  • VCTK

Config

Configurations are in:

  • config/dataset.yaml
  • config/hparams.py

Please modify the dataest and mfa_path in hparams.

In this repo, we're using MFA v1. Migrating to MFA v2 is a TODO item.

Steps

  1. preprocess.py
  2. train.py
  3. synthesize.py

1. Preprocess

File Structures:

[DATASET] / wavs / speaker / wav_files [DATASET] / txts / speaker / txt_files

  • wav_dir : the folder containing speaker dirs ( [DATASET] / wavs )
  • txt_dir : the folder containing speaker dirs ( [DATASET] / txts )
  • save_dir : the output directory (e.g. "./processed" )
  • --prepare_mfa : create mfa_data
  • --mfa : create textgrid files
  • --create_dataset : generate mel, phone, f0 ....., metadata.json

Example commands:

  • LJSpeech:
bash
#run the script for organizing LJSpeech first
python ./script/organizeLJ.py

python preprocess.py /storage/tts2021/LJSpeech-organized/wavs /storage/tts2021/LJSpeech-organized/txts ./processed/LJSpeech --prepare_mfa --mfa --create_dataset
  • LibriTTS:
bash
python preprocess.py /storage/tts2021//LibriTTS/train-clean-360 /storage/tts2021//LibriTTS/train-clean-360 ./processed/LibriTTS --prepare_mfa --mfa --create_dataset
  • VCTK:
bash
python preprocess.py /storage/tts2021/VCTK-Corpus/wav48/ /storage/tts2021/VCTK-Corpus/txt ./processed/VCTK --prepare_mfa --mfa --create_dataset

metadata.json includes:

  1. spker table
  2. traning data
  3. validation data

2. Train

  • data_dir : the preprocessed data directory
  • --comment: some comments

Example commands:

  • LJSpeech:
bash
python train.py ./processed/LJSpeech --comment "Hello LJSpeech" 
  • LibriTTS:
bash
python train.py ./processed/LibriTTS --comment "Hello LibriTTS" 
  • VCTK:
bash
python train.py ./processed/VCTK --comment "Hello VCTK"

3. Synthesize

  • --ckpt_path: the checkpoint path
  • --output_dir: the directory to put the synthesized audios

Example commands:

bash
python synthesize.py --ckpt_path ./records/LJSpeech_2021-11-22-22:42/ckpt/checkpoint_125000.pth.tar --output_dir ./output

References :notebook_with_decorative_cover:

  • FastSpeech 2: Fast and High-Quality End-to-End Text to Speech, Y. Ren, et al.
  • FastSpeech: Fast, Robust and Controllable Text to Speech, Y. Ren, et al.
  • xcmyz's FastSpeech implementation
  • rishikksh20's FastSpeech2 implementation
  • TensorSpeech's FastSpeech2 implementation
  • NVIDIA's WaveGlow implementation
  • seungwonpark's MelGAN implementation

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Pythonfastspeech2melganmulti-speaker-ttspytorch

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言