From 5c24a172b51972344a301570b9589e8e90b491ec Mon Sep 17 00:00:00 2001 From: liyulingyue <852433440@qq.com> Date: Fri, 17 Jan 2025 04:24:26 +0800 Subject: [PATCH] fit with praatio>=6.0.0 --- examples/other/g2p/get_g2p_data.py | 2 +- paddlespeech/t2s/exps/ernie_sat/align.py | 4 ++-- setup.py | 2 +- utils/gen_duration_from_textgrid.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/other/g2p/get_g2p_data.py b/examples/other/g2p/get_g2p_data.py index 8fa3e53cd..3b4abe17b 100644 --- a/examples/other/g2p/get_g2p_data.py +++ b/examples/other/g2p/get_g2p_data.py @@ -32,7 +32,7 @@ def get_baker_data(root_dir): alignment_fp, includeEmptyIntervals=True) # only with baker's annotation utt_id = alignment.tierNameList[0].split(".")[0] - intervals = alignment.tierDict[alignment.tierNameList[0]].entryList + intervals = alignment.getTier(alignment.tierNameList[0]).entryList phones = [] for interval in intervals: label = interval.label diff --git a/paddlespeech/t2s/exps/ernie_sat/align.py b/paddlespeech/t2s/exps/ernie_sat/align.py index a802d0295..e7c8083a8 100755 --- a/paddlespeech/t2s/exps/ernie_sat/align.py +++ b/paddlespeech/t2s/exps/ernie_sat/align.py @@ -41,11 +41,11 @@ def _readtg(tg_path: str, lang: str='en', fs: int=24000, n_shift: int=300): ends = [] words = [] - for interval in alignment.tierDict['words'].entryList: + for interval in alignment.getTier('words').entries: word = interval.label if word: words.append(word) - for interval in alignment.tierDict['phones'].entryList: + for interval in alignment.getTier('phones').entries: phone = interval.label phones.append(phone) ends.append(interval.end) diff --git a/setup.py b/setup.py index 129ae7fc1..6ae3eb7db 100644 --- a/setup.py +++ b/setup.py @@ -56,7 +56,7 @@ base = [ "paddleslim>=2.3.4", "ppdiffusers>=0.9.0", "paddlespeech_feat", - "praatio", + "praatio>=6.0.0", "prettytable", "pydantic", "pypinyin", diff --git a/utils/gen_duration_from_textgrid.py b/utils/gen_duration_from_textgrid.py index 9ee0c05cc..54427665a 100755 --- a/utils/gen_duration_from_textgrid.py +++ b/utils/gen_duration_from_textgrid.py @@ -26,7 +26,7 @@ def readtg(tg_path, sample_rate=24000, n_shift=300): alignment = textgrid.openTextgrid(tg_path, includeEmptyIntervals=True) phones = [] ends = [] - for interval in alignment.tierDict["phones"].entryList: + for interval in alignment.getTier("phones").entries: phone = interval.label phones.append(phone) ends.append(interval.end)