基于Tacotron1的中文语音合成 Text to Speech TTS

目录

基于Tacotron1的中文语音合成 TTS 

一、window部署环境

二、复现

1.前处理要点

2.训练收敛与结果demo


基于Tacotron1的中文语音合成 TTS 

本文主要demo 基于tacotron1的中文语音合成结果与实现,所用语料库为:data_thchs30

参考实现

中文发音git参考  (本文引用)

英文发音git参考


一、window部署环境


二、复现

1.前处理要点

begeekmyfriend /tacotron/tree/mandarin 的 datasets 中 thchs30.py 34 行 注释掉‘.wav’:

wav_file = trn[:-4] + '.wav' 改为: wav_file = trn[:-4]

datasets 中 thchs30.py 29 行 'biaobei_48000' 替换成你训练资料的目录, 以data_thchs30可以换成data 或者train

https://www.vocabulary.com/lists/6974420

trn_files = glob.glob(os.path.join(in_dir, 'biaobei_48000', '*.trn'))
trn_files = glob.glob(os.path.join(in_dir, 'data', '*.trn'))

注意:如果是以tarin为目录,train中的trn是指向data的文件路径,而非训练所需要的拼音,如果这部分没处理好会影响后续模型的训练。
 

  如果是data_thchs30 可以将这一段替换原本代码,原本代码中有点小问题,没能提出到训练所需的拼音音标

 
  1. def build_from_path(in_dir, out_dir, num_workers=1, tqdm=lambda x: x):

  2.  
  3. executor = ProcessPoolExecutor(max_workers=num_workers)

  4. futures = []

  5. index = 1

  6. https://www.vocabulary.com/lists/6977351

  7. trn_files = glob.glob(os.path.join(in_dir, 'data', '*.trn'))

  8. for trn in trn_files:

  9. with open(trn,encoding='utf-8') as f:

  10. content = f.readline().strip('\n')

  11. #print("content",content)

  12. pinyin = f.readline().strip('\n')

  13. wav_file = trn[:-4]# + '.wav'

  14. https://www.vocabulary.com/lists/6974497

  15. #print("pinyin",pinyin)

  16. #print("wav_file",wav_file)

  17. task = partial(_process_utterance, out_dir, index, wav_file, pinyin)

  18. futures.append(executor.submit(task))

  19. https://www.vocabulary.com/lists/6975993

  20. index += 1

  21. return [future.result() for future in tqdm(futures) if future.result() is not None]

正确的前处理结果

2.训练收敛与结果demo

2.4w次训练大概收敛到0.6左右,运行eval.py已经能够合成带有杂音的声音,同时音频图也对齐,下图为对齐的音频图

https://www.vocabulary.com/lists/6975993

 

音频部分的demo

好好学习,天天向上

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值