code: def remove_silence(
      model_and_utils,
      audio_path,
      out_path,
      vad_sample_rate=8000,
      trim_just_beginning_and_end=True,
      use_cuda=False,
  ):
      # get the VAD model and utils functions
      model, get_speech_timestamps, _, collect_chunks = model_and_utils
  
      # read ground truth wav and resample the audio for the VAD
      try:
          wav, gt_sample_rate = read_audio(audio_path)
      except:
          print(f"> ❗ Failed to read {audio_path}")
          return None, False
  
      # if needed, resample the audio for the VAD model
      if gt_sample_rate != vad_sample_rate:
          wav_vad = resample_wav(wav, gt_sample_rate, vad_sample_rate)
      else:
          wav_vad = wav
  
      if use_cuda:
          wav_vad = wav_vad.cuda()
  
      # get speech timestamps from full audio file
      speech_timestamps = get_speech_timestamps(
          wav_vad,
          model,
          sampling_rate=vad_sample_rate,
          window_size_samples=768,
      )
  
      # map the current speech_timestamps to the sample rate of the ground truth audio
      new_speech_timestamps = map_timestamps_to_new_sr(
          vad_sample_rate,
          gt_sample_rate,
          speech_timestamps,
          trim_just_beginning_and_end,
      )
  
      # if have speech timestamps else save the wav
      if new_speech_timestamps:
          wav = collect_chunks(new_speech_timestamps, wav)
          is_speech = True
      else:
          print(
              f"> The file {audio_path} probably does not have speech please check it !!"
          )
          is_speech = False
  
      # save
      torchaudio.save(out_path, wav[None, :], gt_sample_rate)
      return out_path, is_speech
  
imports: import torch
  import torchaudio
label_desc: Use image node_id 5 for calling a global function with example usage: remove_silence(model_and_utils, audio_path, out_path, vad_sample_rate, trim_just_beginning_and_end, use_cuda) and returns: out_path,  is_speech, None,  False