code: def trim_audio(
      self, audio: np.array, sample_rate: int, audio_id: str = ""
  ) -> Tuple[np.array, int, int]:
      if sample_rate == self.vad_sample_rate:
          vad_audio = audio
      else:
          # Resample audio to match sample rate of VAD model
          vad_audio = librosa.resample(
              audio, orig_sr=sample_rate, target_sr=self.vad_sample_rate
          )
  
      if self.volume_norm:
          # Normalize volume so we have a fixed scale relative to the reference amplitude
          vad_audio = normalize_volume(
              audio=vad_audio, volume_level=1.0
          )
  
      speech_frames = self._detect_speech(audio=vad_audio)
  
      start_frame, end_frame = get_start_and_end_of_speech_frames(
          is_speech=speech_frames,
          speech_frame_threshold=self.speech_frame_threshold,
          audio_id=audio_id,
      )
      if not start_frame and not end_frame:
          return np.array([]), 0, 0
  
      if start_frame == 0:
          start_sample = 0
      else:
          start_sample = librosa.core.frames_to_samples(
              start_frame, hop_length=self.trim_hop_length
          )
          start_sample += self.trim_shift
  
      # Avoid trimming off the end because VAD model is not trained to classify partial end frames.
      if end_frame == speech_frames.shape[0]:
          end_sample = vad_audio.shape[0]
      else:
          end_sample = librosa.core.frames_to_samples(
              end_frame, hop_length=self.trim_hop_length
          )
          end_sample += self.trim_shift
  
      if sample_rate != self.vad_sample_rate:
          # Convert sample indices back to input sample rate
          start_sample, end_sample = self._scale_sample_indices(
              start_sample=start_sample,
              end_sample=end_sample,
              sample_rate=sample_rate,
          )
  
      start_sample, end_sample = pad_sample_indices(
          start_sample=start_sample,
          end_sample=end_sample,
          max_sample=audio.shape[0],
          sample_rate=sample_rate,
          pad_seconds=self.pad_seconds,
      )
  
      trimmed_audio = audio[start_sample:end_sample]
  
      return trimmed_audio, start_sample, end_sample
  
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 4 for calling the VadAudioTrimmer obj's underlying member method code with example usage: obj.trim_audio(audio, sample_rate, audio_id) and returns: trimmed_audio,  start_sample,  end_sample, np,  int,  int