code: def get_manifest(audio_dir, ext=".wav", rate=48000):
      """
      Find all the audio file from a directory and get the audio information.
      """
      # Find all sequences
      print(
          f"Finding all audio files with extension '{ext}' from {audio_dir}..."
      )
      stime = time()
      audio_files = list(Path(audio_dir).rglob("*." + ext.lstrip(".")))
      print(
          f"Done! Found {len(audio_files)} files in {time()-stime:.2f} seconds."
      )
  
      # Getting information
      print("Getting audio information...")
      manifest = {}
      for audio in tqdm(audio_files):
          fname = Path(audio).stem
          info = soundfile.info(audio)
          frames = info.frames
          samplerate = info.samplerate
          assert (
              samplerate == rate
          ), f"expected samplerate={rate}, found {samplerate}: {fname}"
          manifest[fname] = {
              "audio": audio,
              "frames": frames,
              "duration": frames / samplerate,
          }
      return manifest
  
file_path: textlesslib/examples/expresso/dataset/processing/create_short_segments_dataset.py
imports: import os
  from tqdm import tqdm
  import soundfile
  from pathlib import Path
  from time import time
  from collections import defaultdict
label_desc: Use image node_id 1 for calling a global function with example usage: get_manifest(audio_dir, ext, rate) and returns: manifest