code: def resample_files(
      input_dir, output_sr, output_dir=None, file_ext="wav", n_jobs=10
  ):
      if output_dir:
          print("Recursively copying the input folder...")
          copytree(input_dir, output_dir)
          input_dir = output_dir
  
      print("Resampling the audio files...")
      audio_files = glob.glob(
          os.path.join(input_dir, f"**/*.{file_ext}"), recursive=True
      )
      print(f"Found {len(audio_files)} files...")
      audio_files = list(
          zip(audio_files, len(audio_files) * [output_sr])
      )
      with Pool(processes=n_jobs) as p:
          with tqdm(total=len(audio_files)) as pbar:
              for _, _ in enumerate(
                  p.imap_unordered(resample_file, audio_files)
              ):
                  pbar.update()
  
      print("Done !")
  
file_path: TTS/TTS/bin/resample.py
imports: import argparse
  import glob
  import os
  from argparse import RawTextHelpFormatter
  from multiprocessing import Pool
  from shutil import copytree
  import librosa
  import soundfile
  from tqdm import tqdm
label_desc: Use image node_id 2 for calling a global function with example usage: resample_files(input_dir, output_sr, output_dir, file_ext, n_jobs) without return types