4

VoiceCraft: 文本生成任何人的语音技术

 1 month ago
source link: https://www.jdon.com/73141.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

VoiceCraft: 文本生成任何人的语音技术

VoiceCraft 能够复制或克隆或甚至编辑你从未听过的语音。

它是一种token填充神经编解码语言模型,在有声读物、网络视频和播客等野生数据的语音编辑和零镜头文本到语音(TTS)方面都达到了最先进的性能。

 VoiceCraft 采用 Transformer 解码器架构,并引入了令牌重排过程,该过程结合了因果屏蔽和延迟堆叠,以实现在现有序列中生成。

  • 在语音编辑任务中,VoiceCraft 生成的经过编辑的语音在自然度方面与未经编辑的录音几乎没有区别(经人类评估);
  • 对于零样本 TTS,我们的模型优于之前的 SotA 模型,包括 VALL-E 和流行的商业模型 XTTS v2。

至关重要的是,这些模型是在具有挑战性和现实的野生数据集上进行训练的,这些野生数据集包括不同的口音、说话风格、录音条件以及背景噪音和音乐,并且与其他模型和真实录音相比,我们的模型始终表现良好。

能够复制或克隆或甚至编辑你从未听过的语音,VoiceCraft 只需几秒钟的参考时间。

更多案例演示参考这里论文

训练
为了训练VoiceCraft模型,您需要准备以下部分:

  1. 话语及其文字记录
  2. 使用例如 Encodec 将话语编码为代码
  3. 将转录文本转换为音素序列和音素集(我们将其命名为 vocab.txt)
  4. 清单(即元数据)
conda create -n voicecraft python=3.9.16
conda activate voicecraft

pip install torch==2.0.1 # this assumes your system is compatible with CUDA 11.7, otherwise checkout https://pytorch.org/get-started/previous-versions/v201
apt-get install ffmpeg # if you don't already have ffmpeg installed
pip install -e git+https://github.com/facebookresearch/audiocraft.git@c5157b5bf14bf83449c17ea1eeb66c19fb4bc7f0egg=audiocraft
apt-get install espeak-ng # backend for the phonemizer installed below
pip install tensorboard==2.16.2
pip install phonemizer==3.2.1
pip install torchaudio==2.0.2
pip install datasets==2.16.0
pip install torchmetrics==0.11.1
# install MFA for getting forced-alignment, this could take a few minutes
conda install -c conda-forge montreal-forced-aligner=2.2.17 openfst=1.8.2 kaldi=5.5.1068
# conda install pocl # above gives an warning for installing pocl, not sure if really need this

# to run ipynb
conda install -n voicecraft ipykernel --update-deps --force-reinstall

运行示例:

conda activate voicecraft
export CUDA_VISIBLE_DEVICES=0
cd ./data
python phonemize_encodec_encode_hf.py \
--dataset_size xs \
--download_to path/to/store_huggingface_downloads \
--save_dir path/to/store_extracted_codes_and_phonemes \
--encodec_model_path path/to/encodec_model \
--mega_batch_size 120 \
--batch_size 32 \
--max_len 30000

网友讨论:

  • 网友生成了特朗普的一段声音,听起来就像特朗普谈论爱泼斯坦岛的那段老喜剧视频。
  • 3080 上的 8 秒太疯狂了

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK