    def load_audiofile(self, audio_path: str) -> torch.Tensor:
        """
        Load the audio files and apply resampling and normalizaion

        Args:
            audio_path: the audio file path

        Returns:
            audio_waveform: the audio waveform as a torch.Tensor object
        """

        audio_waveform, sampling_rate = torchaudio.load(audio_path)
        if audio_waveform.dim == 2:
            audio_waveform = audio_waveform.mean(-1)
        if self.sampling_rate != sampling_rate:
            audio_waveform = torchaudio.functional.resample(
                audio_waveform, sampling_rate, self.sampling_rate
            )
        if self.normalize_input:
            # following fairseq raw audio dataset
            audio_waveform = torch.nn.functional.layer_norm(
                audio_waveform, audio_waveform.shape
            )

        return audio_waveform
Load the audio files and apply resampling and normalizaion

Args:
audio_path: the audio file path

Returns:
audio_waveform: the audio waveform as a torch.Tensor object
examples/speech_to_speech/asr_bleu/utils.py