code: def trim_silence(
      *,
      wav: np.ndarray = None,
      sample_rate: int = None,
      trim_db: float = None,
      win_length: int = None,
      hop_length: int = None,
      **kwargs,
  ) -> np.ndarray:
      """Trim silent parts with a threshold and 0.01 sec margin"""
      margin = int(sample_rate * 0.01)
      wav = wav[margin:-margin]
      return librosa.effects.trim(
          wav,
          top_db=trim_db,
          frame_length=win_length,
          hop_length=hop_length,
      )[0]
  
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 22 for calling a global function with example usage: trim_silence() and returns: librosa