code: def create_json(wav_list, json_file):
      """
      Creates the json file given a list of wav information.
  
      Arguments
      ---------
      wav_list : list of list
          The list of wav information (path, label, gender).
      json_file : str
          The path of the output json file
      """
  
      json_dict = {}
      for obj in wav_list:
          wav_file = obj[0]
          emo = obj[1]
          # Read the signal (to retrieve duration in seconds)
          signal = read_audio(wav_file)
          duration = signal.shape[0] / SAMPLERATE
  
          uttid = wav_file.split("/")[-1][:-4]
  
          # Create entry for this utterance
          json_dict[uttid] = {
              "wav": wav_file,
              "length": duration,
              "emo": emo,
          }
  
      # Writing the dictionary to the json file
      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/IEMOCAP/emotion_recognition/iemocap_prepare.py
imports: import os
  import re
  import json
  import random
  import logging
  from speechbrain.dataio.dataio import read_audio
label_desc: Use image node_id 2 for calling a global function with example usage: create_json(wav_list, json_file) without return types