code: def create_csv(wav_list, csv_file):
      """
      Creates the csv file given a list of wav files.
  
      Arguments
      ---------
      wav_list : list of str
          The list of wav files.
      csv_file : str
          The path of the output json file
      """
  
      # Adding some Prints
      msg = f"Creating csv lists in {csv_file} ..."
      logger.info(msg)
  
      csv_lines = []
  
      # Start processing lines
      total_duration = 0.0
  
      # Starting index
      idx = 0
  
      for wav_file in tzip(wav_list):
          wav_file = wav_file[0]
  
          path_parts = wav_file.split(os.path.sep)
          file_name, wav_format = os.path.splitext(path_parts[-1])
  
          # Peeking at the signal (to retrieve duration in seconds)
          if os.path.isfile(wav_file):
              info = torchaudio.info(wav_file)
          else:
              msg = "\tError loading: %s" % (str(len(file_name)))
              logger.info(msg)
              continue
  
          audio_duration = info.num_frames / info.sample_rate
          total_duration += audio_duration
  
          # Actual name of the language
          language = path_parts[-4]
  
          # Create a row with whole utterences
          csv_line = [
              idx,  # ID
              wav_file,  # File name
              wav_format,  # File format
              str(info.num_frames / info.sample_rate),  # Duration (sec)
              language,  # Language
          ]
  
          # Adding this line to the csv_lines list
          csv_lines.append(csv_line)
  
          # Increment index
          idx += 1
  
      # CSV column titles
      csv_header = ["ID", "wav", "wav_format", "duration", "language"]
  
      # Add titles to the list at indexx 0
      csv_lines.insert(0, csv_header)
  
      # Writing the csv lines
      with open(csv_file, mode="w", encoding="utf-8") as csv_f:
          csv_writer = csv.writer(
              csv_f,
              delimiter=",",
              quotechar='"',
              quoting=csv.QUOTE_MINIMAL,
          )
  
          for line in csv_lines:
              csv_writer.writerow(line)
  
      # Final prints
      msg = f"{csv_file} sucessfully created!"
      logger.info(msg)
      msg = f"Number of samples: {len(wav_list)}."
      logger.info(msg)
      msg = f"Total duration: {round(total_duration / 3600, 2)} hours."
      logger.info(msg)
  
file_path: speechbrain/recipes/CommonLanguage/lang_id/common_language_prepare.py
imports: import os
  import csv
  import logging
  import torchaudio
  from tqdm.contrib import tzip
  from speechbrain.utils.data_utils import get_all_files
label_desc: Use image node_id 4 for calling a global function with example usage: create_csv(wav_list, csv_file) without return types