code: def create_json(wav_lst, json_file, clean_folder):
      """
      Creates the json file given a list of wav files.
  
      Arguments
      ---------
      wav_lst : list
          The list of wav files.
      json_file : str
          The path of the output json file
      clean_folder : str
          The location of parallel clean samples.
      """
      logger.debug(f"Creating json lists in {json_file}")
  
      # Processing all the wav files in the list
      json_dict = {}
      for wav_file in wav_lst:  # ex:p203_122.wav
          # Example wav_file: p232_001.wav
          noisy_path, filename = os.path.split(wav_file)
          _, noisy_dir = os.path.split(noisy_path)
          _, clean_dir = os.path.split(clean_folder)
          noisy_rel_path = os.path.join(
              "{data_root}", noisy_dir, filename
          )
          clean_rel_path = os.path.join(
              "{data_root}", clean_dir, filename
          )
  
          # Reading the signal (to retrieve duration in seconds)
          signal = read_audio(wav_file)
          duration = signal.shape[0] / SAMPLERATE
  
          # Read text
          snt_id = filename.replace(".wav", "")
  
          json_dict[snt_id] = {
              "noisy_wav": noisy_rel_path,
              "clean_wav": clean_rel_path,
              "length": duration,
          }
  
      # Writing the json lines
      with open(json_file, mode="w") as json_f:
          json.dump(json_dict, json_f, indent=2)
  
      logger.info(f"{json_file} successfully created!")
  
file_path: speechbrain/recipes/Voicebank/dereverb/MetricGAN-U/voicebank_revb_prepare.py
imports: import os
  import json
  import string
  import logging
  from speechbrain.utils.data_utils import get_all_files
  from speechbrain.dataio.dataio import read_audio
label_desc: Use image node_id 4 for calling a global function with example usage: create_json(wav_lst, json_file, clean_folder) without return types