code: def resample_folder(input_folder, output_folder, fs, regex):
      """Resamples the wav files within an input folder.
  
      Arguments
      ---------
      input_folder : path
          Path of the folder to resample.
      output_folder : path
          Path of the output folder with the resampled data.
      fs : int
          Target sampling frequency.
      reg_exp: str
          Regular expression for search.
      """
      # filedir = os.path.dirname(os.path.realpath(__file__))
      # octave.addpath(filedir)
      # add the matlab functions to octave dir here
  
      files = glob.glob(
          os.path.join(input_folder, regex), recursive=True
      )
      for f in tqdm.tqdm(files):
          audio, fs_read = torchaudio.load(f)
          audio = audio[0].numpy()
          audio = signal.resample_poly(audio, fs, fs_read)
  
          # tmp = octave.activlev(audio.tolist(), fs, "n")
          # audio, _ = tmp[:-1].squeeze(), tmp[-1]
  
          peak = np.max(np.abs(audio))
          audio = audio / peak
          audio = torch.from_numpy(audio).float()
  
          relative_path = os.path.join(
              Path(f).relative_to(Path(input_folder)).parent,
              Path(f).relative_to(Path(input_folder)).stem
              + "_peak_{}.wav".format(peak),
          )
  
          os.makedirs(
              Path(
                  os.path.join(
                      output_folder,
                      Path(f).relative_to(Path(input_folder)),
                  )
              ).parent,
              exist_ok=True,
          )
  
          torchaudio.save(
              os.path.join(output_folder, relative_path),
              audio.reshape(1, -1),
              fs,
          )
  
file_path: speechbrain/recipes/REAL-M/sisnr-estimation/preprocess_dynamic_mixing_librimix.py
imports: import os
  import argparse
  from pathlib import Path
  import tqdm
  import torchaudio
  import glob
  from scipy import signal
  import numpy
  import torch
label_desc: Use image node_id 1 for calling a global function with example usage: resample_folder(input_folder, output_folder, fs, regex) without return types