code: def get_start_and_end_of_speech_frames(
      is_speech: np.array,
      speech_frame_threshold: int,
      audio_id: str = "",
  ) -> Tuple[int, int]:
      """Finds the speech frames corresponding to the start and end of speech for an utterance.
      Args:
          is_speech: [num_frames] boolean array with true entries labeling speech frames.
          speech_frame_threshold: The number of consecutive speech frames required to classify the speech boundaries.
          audio_id: String identifier (eg. file name) used for logging.
  
      Returns integers representing the frame indices of the start (inclusive) and end (exclusive) of speech.
      """
      num_frames = is_speech.shape[0]
  
      # Iterate forwards over the utterance until we find the first speech_frame_threshold consecutive speech frames.
      start_frame = None
      for i in range(0, num_frames - speech_frame_threshold + 1):
          high_i = i + speech_frame_threshold
          if all(is_speech[i:high_i]):
              start_frame = i
              break
  
      # Iterate backwards over the utterance until we find the last speech_frame_threshold consecutive speech frames.
      end_frame = None
      for i in range(num_frames, speech_frame_threshold - 1, -1):
          low_i = i - speech_frame_threshold
          if all(is_speech[low_i:i]):
              end_frame = i
              break
  
      if start_frame is None or end_frame is None:
          # Algorithm is symmetric, so if the start is not found then the end should also not be found.
          logging.warning(
              f"Could not find start or end of speech for '{audio_id}'"
          )
          return 0, 0
  
      return start_frame, end_frame
  
imports: from abc import ABC, abstractmethod
  from typing import Tuple
  import librosa
  import numpy
  import torch
  from nemo.collections.asr.models import EncDecClassificationModel
  from nemo.collections.tts.parts.utils.tts_dataset_utils import normalize_volume
  from nemo.utils import logging
label_desc: Use image node_id 1 for calling a global function with example usage: get_start_and_end_of_speech_frames(is_speech, speech_frame_threshold, audio_id) and returns: start_frame,  end_frame, int,  int