code: def create_json_dataset(dic, sample_rate, window_size):
      """Creates JSON file for Voice Activity Detection.
      Data are chunked in shorter clips of duration window_size"""
      sessions_iteration = dic.keys()
      example_counter = 1
      json_dataset = {}
      for sessions in sessions_iteration:
          speech_timings = dic[sessions]["speech"]
          reference_list = []
          compare_list = []
          for values in speech_timings:
              reference_list, compare_list = create_window_splits(
                  values, compare_list, reference_list, window_size
              )
              unique_list, seq_timing = remove_duplicates_sort(
                  reference_list, compare_list
              )
          speech_sequence_cleaned = []
          overlap = []
          for i, values in enumerate(unique_list):
              if len(values) == 1:
                  speech_sequence_cleaned.append(seq_timing[values[0]])
                  json_dataset = json_dataset = add_example(
                      dic[sessions]["file"],
                      [seq_timing[values[0]]],
                      compare_list[values[0]],
                      example_counter,
                      sample_rate,
                      json_dataset,
                  )
                  example_counter += 1
              else:
                  for iter in values:
                      overlap.append(seq_timing[iter])
                  json_dataset = add_example(
                      dic[sessions]["file"],
                      overlap,
                      compare_list[values[0]],
                      example_counter,
                      sample_rate,
                      json_dataset,
                  )
                  speech_sequence_cleaned.append(overlap)
                  overlap = []
                  example_counter += 1
              dic[sessions]["speech_segments"] = speech_sequence_cleaned
      return json_dataset
  
file_path: speechbrain/recipes/LibriParty/VAD/libriparty_prepare.py
imports: import numpy
  import pandas
  import json
  import logging
  from collections import OrderedDict
label_desc: Use image node_id 10 for calling a global function with example usage: create_json_dataset(dic, sample_rate, window_size) and returns: json_dataset