Skip to content

Commit

Permalink
Update prepare_csv_wavs.py
Browse files Browse the repository at this point in the history
  • Loading branch information
SWivid authored Nov 1, 2024
1 parent 27d98a5 commit 552c0fd
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/f5_tts/train/datasets/prepare_csv_wavs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 552c0fd

Please sign in to comment.