code: def resampler(input_dir, target_sr=16000, ext="*.wav"):
      """Resamples the audio files in input_dir to target_sr"""
      files = glob.glob(f"{input_dir}/" + ext)
      for pathname in files:
          print(pathname)
          try:
              audio, fs = audioread(pathname)
              audio_resampled = librosa.core.resample(
                  audio, fs, target_sr
              )
              audiowrite(pathname, audio_resampled, target_sr)
          except:  # noqa
              continue
  
file_path: speechbrain/recipes/DNS/noisyspeech_synthesizer/audiolib.py
imports: import os
  import numpy
  import soundfile
  import subprocess
  import glob
  import librosa
label_desc: Use image node_id 13 for calling a global function with example usage: resampler(input_dir, target_sr, ext) without return types