code: def load_audio(audiopath, sampling_rate):
      # better load setting following: https://github.com/faroit/python_audio_loading_benchmark
  
      # torchaudio should chose proper backend to load audio depending on platform
      audio, lsr = torchaudio.load(audiopath)
  
      # stereo to mono if needed
      if audio.size(0) != 1:
          audio = torch.mean(audio, dim=0, keepdim=True)
  
      if lsr != sampling_rate:
          audio = torchaudio.functional.resample(
              audio, lsr, sampling_rate
          )
  
      # Check some assumptions about audio range. This should be automatically fixed in load_wav_to_torch, but might not be in some edge cases, where we should squawk.
      # '10' is arbitrarily chosen since it seems like audio will often "overdrive" the [-1,1] bounds.
      if torch.any(audio > 10) or not torch.any(audio < 0):
          print(
              f"Error with {audiopath}. Max={audio.max()} min={audio.min()}"
          )
      # clip audio invalid values
      audio.clip_(-1, 1)
      return audio
  
imports: import os
  from dataclasses import dataclass
  import librosa
  import torch
  import torch.nn.functional
  import torchaudio
  from coqpit import Coqpit
  from TTS.tts.layers.xtts.gpt import GPT
  from TTS.tts.layers.xtts.hifigan_decoder import HifiDecoder
  from TTS.tts.layers.xtts.stream_generator import init_stream_support
  from TTS.tts.layers.xtts.tokenizer import VoiceBpeTokenizer, split_sentence
  from TTS.tts.layers.xtts.xtts_manager import SpeakerManager, LanguageManager
  from TTS.tts.models.base_tts import BaseTTS
  from TTS.utils.io import load_fsspec
label_desc: Use image node_id 2 for calling a global function with example usage: load_audio(audiopath, sampling_rate) and returns: audio