code: def audio_segmenter(input_dir, dest_dir, segment_len=10, ext="*.wav"):
      """Segments the audio clips in dir to segment_len in secs"""
      files = glob.glob(f"{input_dir}/" + ext)
      for i in range(len(files)):
          audio, fs = audioread(files[i])
  
          if (
              len(audio) > (segment_len * fs)
              and len(audio) % (segment_len * fs) != 0
          ):
              audio = np.append(
                  audio,
                  audio[
                      0 : segment_len * fs
                      - (len(audio) % (segment_len * fs))
                  ],
              )
          if len(audio) < (segment_len * fs):
              while len(audio) < (segment_len * fs):
                  audio = np.append(audio, audio)
              audio = audio[: segment_len * fs]
  
          num_segments = int(len(audio) / (segment_len * fs))
          audio_segments = np.split(audio, num_segments)
  
          basefilename = os.path.basename(files[i])
          basename, ext = os.path.splitext(basefilename)
  
          for j in range(len(audio_segments)):
              newname = basename + "_" + str(j) + ext
              destpath = os.path.join(dest_dir, newname)
              audiowrite(destpath, audio_segments[j], fs)
  
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 14 for calling a global function with example usage: audio_segmenter(input_dir, dest_dir, segment_len, ext) without return types