mirror of
https://github.com/shivammehta25/Matcha-TTS.git
synced 2026-02-04 17:59:19 +08:00
Adding the possibility of get durations out of pretrained model
This commit is contained in:
@@ -15,7 +15,6 @@ import logging
|
||||
import re
|
||||
|
||||
import phonemizer
|
||||
import piper_phonemize
|
||||
from unidecode import unidecode
|
||||
|
||||
# To avoid excessive logging we set the log level of the phonemizer package to Critical
|
||||
@@ -106,11 +105,17 @@ def english_cleaners2(text):
|
||||
return phonemes
|
||||
|
||||
|
||||
def english_cleaners_piper(text):
|
||||
"""Pipeline for English text, including abbreviation expansion. + punctuation + stress"""
|
||||
text = convert_to_ascii(text)
|
||||
text = lowercase(text)
|
||||
text = expand_abbreviations(text)
|
||||
phonemes = "".join(piper_phonemize.phonemize_espeak(text=text, voice="en-US")[0])
|
||||
phonemes = collapse_whitespace(phonemes)
|
||||
return phonemes
|
||||
# I am removing this due to incompatibility with several version of python
|
||||
# However, if you want to use it, you can uncomment it
|
||||
# and install piper-phonemize with the following command:
|
||||
# pip install piper-phonemize
|
||||
|
||||
# import piper_phonemize
|
||||
# def english_cleaners_piper(text):
|
||||
# """Pipeline for English text, including abbreviation expansion. + punctuation + stress"""
|
||||
# text = convert_to_ascii(text)
|
||||
# text = lowercase(text)
|
||||
# text = expand_abbreviations(text)
|
||||
# phonemes = "".join(piper_phonemize.phonemize_espeak(text=text, voice="en-US")[0])
|
||||
# phonemes = collapse_whitespace(phonemes)
|
||||
# return phonemes
|
||||
|
||||
Reference in New Issue
Block a user