code: def trim_audio(
      self, audio: np.array, sample_rate: int, audio_id: str = ""
  ) -> Tuple[np.array, int, int]:
      if self.volume_norm:
          # Normalize volume so we have a fixed scale relative to the reference amplitude
          audio = normalize_volume(audio=audio, volume_level=1.0)
  
      speech_frames = librosa.effects._signal_to_frame_nonsilent(
          audio,
          ref=self.ref_amplitude,
          frame_length=self.trim_win_length,
          hop_length=self.trim_hop_length,
          top_db=self.db_threshold,
      )
  
      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
  
      start_sample = librosa.core.frames_to_samples(
          start_frame, hop_length=self.trim_hop_length
      )
      end_sample = librosa.core.frames_to_samples(
          end_frame, hop_length=self.trim_hop_length
      )
  
      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 2 for calling the EnergyAudioTrimmer 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