code: def prepare_ravdess(
      data_folder,
      save_json,
      seed=12,
  ):
      """
      Prepares the json files for the RAVDESS dataset.
      Arguments
      ---------
      data_original : str
          Path to the folder where the original RAVDESS dataset is stored.
      save_json : str
          Path where the data specification file will be saved.
      seed : int
          Seed for reproducibility
      """
      random.seed(seed)
  
      # Check if this phase is already done (if so, skip it)
      if skip(save_json):
          logger.info(
              "Preparation completed in previous run, skipping."
          )
          return
  
      logger.info("Applying VAD and resampling ...")
      for repo in repos:
          source_folder = os.path.join(data_folder, repo)
          destin_folder = os.path.join(data_folder, "processed", repo)
          if not os.path.exists(destin_folder):
              os.makedirs(destin_folder)
          resampling_for_folder(source_folder, destin_folder)
          vad_for_folder(destin_folder, destin_folder)
  
      logger.info("vad and resampling finished")
      logger.info("Start RAVDESS concatenation ...")
      data_json = concat_wavs(data_folder, save_json)
      logger.info("RAVDESS concatenation finished ...")
      return data_json
  
file_path: speechbrain/recipes/ZaionEmotionDataset/emotion_diarization/datasets/prepare_RAVDESS.py
imports: import numpy
  import os
  import random
  from pydub import AudioSegment
  import json
  from datasets.vad import vad_for_folder
  from pathlib import Path
  import logging
label_desc: Use image node_id 1 for calling a global function with example usage: prepare_ravdess(data_folder, save_json, seed) and returns: data_json