From 1c988213598c3193e3e167ebe1ff58ecd5d9b221 Mon Sep 17 00:00:00 2001 From: WeberJulian Date: Fri, 27 Oct 2023 22:27:18 +0200 Subject: [PATCH] Remove unused load_audio function --- TTS/tts/models/xtts.py | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/TTS/tts/models/xtts.py b/TTS/tts/models/xtts.py index aacdd6f177..60af2d1e8e 100644 --- a/TTS/tts/models/xtts.py +++ b/TTS/tts/models/xtts.py @@ -22,30 +22,6 @@ init_stream_support() -def load_audio(audiopath, sr=22050): - """ - Load an audio file from disk and resample it to the specified sampling rate. - - Args: - audiopath (str): Path to the audio file. - sr (int): Target sampling rate. - - Returns: - Tensor: Audio waveform tensor with shape (1, T), where T is the number of samples. - """ - audio, sampling_rate = torchaudio.load(audiopath) - - if audio.shape[0] > 1: - audio = audio.mean(0, keepdim=True) - - if sampling_rate != sr: - resampler = torchaudio.transforms.Resample(sampling_rate, sr) - audio = resampler(audio) - - audio = audio.clamp_(-1, 1) - return audio.unsqueeze(0) - - def wav_to_mel_cloning( wav, mel_norms_file="../experiments/clips_mel_norms.pth", mel_norms=None, device=torch.device("cpu") ):