code: def find_endpoint(
      *,
      wav: np.ndarray = None,
      trim_db: float = -40,
      sample_rate: int = None,
      min_silence_sec=0.8,
      gain: float = None,
      base: int = None,
      **kwargs,
  ) -> int:
      """Find the last point without silence at the end of a audio signal.
  
      Args:
          wav (np.ndarray): Audio signal.
          threshold_db (int, optional): Silence threshold in decibels. Defaults to -40.
          min_silence_sec (float, optional): Ignore silences that are shorter then this in secs. Defaults to 0.8.
          gian (float, optional): Gain to be used to convert trim_db to trim_amp. Defaults to None.
          base (int, optional): Base of the logarithm used to convert trim_db to trim_amp. Defaults to 10.
  
      Returns:
          int: Last point without silence.
      """
      window_length = int(sample_rate * min_silence_sec)
      hop_length = int(window_length / 4)
      threshold = db_to_amp(x=-trim_db, gain=gain, base=base)
      for x in range(hop_length, len(wav) - window_length, hop_length):
          if np.max(wav[x : x + window_length]) < threshold:
              return x + hop_length
      return len(wav)
  
imports: from io import BytesIO
  from typing import Tuple
  import librosa
  import numpy
  import scipy
  import soundfile
  from librosa import magphase, pyin
label_desc: Use image node_id 21 for calling a global function with example usage: find_endpoint() and returns: len, unknown