code: def trim_ref(cutoff_db, ref, frame_length, hop_length, input_data):
      yt, index = librosa.effects.trim(
          y=input_data,
          top_db=-cutoff_db,
          ref=ref,
          frame_length=frame_length,
          hop_length=hop_length,
      )
      # librosa's trim function calculates power with reference to center of window,
      # while DALI uses beginning of window. Hence the subtraction below
      begin = index[0] - frame_length // 2
      length = index[1] - index[0]
      if length != 0:
          length += frame_length - 1
      return np.array(begin), np.array(length)
  
file_path: DALI/dali/test/python/operator_1/test_nonsilence.py
imports: import librosa
  import numpy
  import nvidia.dali.types
  import test_utils
  import os
  import nvidia.dali.fn
  from nvidia.dali import pipeline_def
label_desc: Use image node_id 1 for calling a global function with example usage: trim_ref(cutoff_db, ref, frame_length, hop_length, input_data) and returns: np,  np