code: def resample(wav, sample_rate, new_sample_rate):
      if wav.shape[0] >= 2:
          wav = torch.mean(wav, dim=0)
      else:
          wav = wav.squeeze(0)
      if sample_rate > new_sample_rate:
          resampler = Resample(sample_rate, new_sample_rate)
          wav = resampler(wav)
      return wav
  
file_path: gradio/demo/musical_instrument_identification/data_setups.py
imports: import os
  import librosa
  import torch
  import numpy
  from torchaudio.transforms import Resample
label_desc: Use image node_id 2 for calling a global function with example usage: resample(wav, sample_rate, new_sample_rate) and returns: wav