From 552c0fd99c3fafceb78b0085946c0fac68a504c5 Mon Sep 17 00:00:00 2001 From: Yushen CHEN <45333109+SWivid@users.noreply.github.com> Date: Fri, 1 Nov 2024 18:17:57 +0800 Subject: [PATCH] Update prepare_csv_wavs.py --- src/f5_tts/train/datasets/prepare_csv_wavs.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/f5_tts/train/datasets/prepare_csv_wavs.py b/src/f5_tts/train/datasets/prepare_csv_wavs.py index f39001a6c..dd51ef098 100644 --- a/src/f5_tts/train/datasets/prepare_csv_wavs.py +++ b/src/f5_tts/train/datasets/prepare_csv_wavs.py @@ -54,8 +54,7 @@ def prepare_csv_wavs_dir(input_dir): def get_audio_duration(audio_path): audio, sample_rate = torchaudio.load(audio_path) - num_channels = audio.shape[0] - return audio.shape[1] / (sample_rate * num_channels) + return audio.shape[1] / sample_rate def read_audio_text_pairs(csv_file_path):