class_docstr: Class containing the functions that create RTTM, CTM, JSON files.
  
  Arguments in config:
  
  data_simulator:
      session_config:
          num_speakers (int): Number of unique speakers per multispeaker audio session
          session_params:
          split_buffer (float): Split RTTM labels if greater than twice this amount of silence (to avoid long gaps between 
                                  utterances as being labelled as speech)
      outputs:
          output_dir (str): Output directory for audio sessions and corresponding label files
          output_filename (str): Output filename for the wav and RTTM files
          overwrite_output (bool): If true, delete the output directory if it exists
          output_precision (int): Number of decimal places in output files
class_docstr_tok: ["Class","containing","the","functions","that","create","RTTM",",","CTM",",","JSON","files",".","Arguments","in","config",":","data_simulator",":","session_config",":","num_speakers","(","int",")",":","Number","of","unique","speakers","per","multispeaker","audio","session","session_params",":","split_buffer","(","float",")",":","Split","RTTM","labels","if","greater","than","twice","this","amount","of","silence","(","to","avoid","long","gaps","between","utterances","as","being","labelled","as","speech",")","outputs",":","output_dir","(","str",")",":","Output","directory","for","audio","sessions","and","corresponding","label","files","output_filename","(","str",")",":","Output","filename","for","the","wav","and","RTTM","files","overwrite_output","(","bool",")",":","If","true",",","delete","the","output","directory","if","it","exists","output_precision","(","int",")",":","Number","of","decimal","places","in","output","files"]
docstr: Create new RTTM entries (to write to output rttm file)
  
  Args:
      words (list): List of words in the current audio file.
      alignments (list): List of alignments (timestamps) for the current audio file.
      start (int): Current start of the audio file being inserted.
      end (int): End of the audio file being inserted.
      speaker_id (int): LibriSpeech speaker ID for the current entry.
  
  Returns:
      rttm_list (list): List of rttm entries
docstr_tok: ["Create","new","RTTM","entries","(","to","write","to","output","rttm","file",")","Args",":","words","(","list",")",":","List","of","words","in","the","current","audio","file",".","alignments","(","list",")",":","List","of","alignments","(","timestamps",")","for","the","current","audio","file",".","start","(","int",")",":","Current","start","of","the","audio","file","being","inserted",".","end","(","int",")",":","End","of","the","audio","file","being","inserted",".","speaker_id","(","int",")",":","LibriSpeech","speaker","ID","for","the","current","entry",".","Returns",":","rttm_list","(","list",")",":","List","of","rttm","entries"]
code: def create_new_rttm_entry(
      self,
      words: List[str],
      alignments: List[float],
      start: int,
      end: int,
      speaker_id: int,
  ) -> List[str]:
      """
      Create new RTTM entries (to write to output rttm file)
  
      Args:
          words (list): List of words in the current audio file.
          alignments (list): List of alignments (timestamps) for the current audio file.
          start (int): Current start of the audio file being inserted.
          end (int): End of the audio file being inserted.
          speaker_id (int): LibriSpeech speaker ID for the current entry.
  
      Returns:
          rttm_list (list): List of rttm entries
      """
      rttm_list = []
      new_start = start
      # look for split locations
      for i in range(len(words)):
          if words[i] == "" and i != 0 and i != len(words) - 1:
              silence_length = alignments[i] - alignments[i - 1]
              if (
                  silence_length
                  > 2
                  * self._params.data_simulator.session_params.split_buffer
              ):  # split utterance on silence
                  new_end = (
                      start
                      + alignments[i - 1]
                      + self._params.data_simulator.session_params.split_buffer
                  )
                  t_stt = round(
                      float(new_start),
                      self._params.data_simulator.outputs.output_precision,
                  )
                  t_end = round(
                      float(new_end),
                      self._params.data_simulator.outputs.output_precision,
                  )
                  rttm_list.append(f"{t_stt} {t_end} {speaker_id}")
                  new_start = (
                      start
                      + alignments[i]
                      - self._params.data_simulator.session_params.split_buffer
                  )
  
      t_stt = round(
          float(new_start),
          self._params.data_simulator.outputs.output_precision,
      )
      t_end = round(
          float(end),
          self._params.data_simulator.outputs.output_precision,
      )
      rttm_list.append(f"{t_stt} {t_end} {speaker_id}")
      return rttm_list
  
imports: import copy
  import os
  import shutil
  from collections import defaultdict
  from typing import IO, Dict, List, Optional, Tuple
  import numpy
  import torch
  from scipy.stats import beta, gamma
  from tqdm import tqdm
  from nemo.collections.asr.parts.preprocessing.perturb import AudioAugmentor
  from nemo.collections.asr.parts.preprocessing.segment import AudioSegment
  from nemo.collections.asr.parts.utils.manifest_utils import get_ctm_line, read_manifest, write_ctm, write_manifest, write_text
  from nemo.collections.asr.parts.utils.speaker_utils import labels_to_rttmfile
  from nemo.utils import logging
label_desc: Use image node_id 5 for calling the DataAnnotator obj's underlying member method code with example usage: obj.create_new_rttm_entry(words, alignments, start, end, speaker_id) and returns: rttm_list