class_docstr: A ready-to-use class for Voice Activity Detection (VAD) using a
  pre-trained model.
  
  Example
  -------
  >>> import torchaudio
  >>> from speechbrain.inference.VAD import VAD
  >>> # Model is downloaded from the speechbrain HuggingFace repo
  >>> tmpdir = getfixture("tmpdir")
  >>> VAD = VAD.from_hparams(
  ...     source="speechbrain/vad-crdnn-libriparty",
  ...     savedir=tmpdir,
  ... )
  
  >>> # Perform VAD
  >>> boundaries = VAD.get_speech_segments("tests/samples/single-mic/example1.wav")
docstr: Upsamples the output of the vad to help visualization. It creates a
  signal that is 1 when there is speech and 0 when there is no speech.
  The vad signal has the same resolution as the input one and can be
  opened with it (e.g, using audacity) to visually figure out VAD regions.
  
  Arguments
  ---------
  vad_out: torch.Tensor
      Tensor containing 1 for each frame of speech and 0 for each non-speech
      frame.
  audio_file: path
      The original audio file used to compute vad_out
  time_resolution : float
      Time resolution of the vad_out signal.
  
  Returns
  -------
  vad_signal
      The upsampled version of the vad_out tensor.
docstr_tok: ["Upsamples","the","output","of","the","vad","to","help","visualization",".","It","creates","a","signal","that","is","1","when","there","is","speech","and","0","when","there","is","no","speech",".","The","vad","signal","has","the","same","resolution","as","the","input","one","and","can","be","opened","with","it","(","e.g",",","using","audacity",")","to","visually","figure","out","VAD","regions",".","Arguments","--","--","--","--","-","vad_out",":","torch.Tensor","Tensor","containing","1","for","each","frame","of","speech","and","0","for","each","non-speech","frame",".","audio_file",":","path","The","original","audio","file","used","to","compute","vad_out","time_resolution",":","float","Time","resolution","of","the","vad_out","signal",".","Returns","--","--","--","-","vad_signal","The","upsampled","version","of","the","vad_out","tensor","."]
code: def upsample_VAD(self, vad_out, audio_file, time_resolution=0.01):
      """Upsamples the output of the vad to help visualization. It creates a
      signal that is 1 when there is speech and 0 when there is no speech.
      The vad signal has the same resolution as the input one and can be
      opened with it (e.g, using audacity) to visually figure out VAD regions.
  
      Arguments
      ---------
      vad_out: torch.Tensor
          Tensor containing 1 for each frame of speech and 0 for each non-speech
          frame.
      audio_file: path
          The original audio file used to compute vad_out
      time_resolution : float
          Time resolution of the vad_out signal.
  
      Returns
      -------
      vad_signal
          The upsampled version of the vad_out tensor.
      """
  
      # Getting the total size of the input file
      sample_rate, sig_len = self._get_audio_info(audio_file)
  
      if sample_rate != self.sample_rate:
          raise ValueError(
              "The detected sample rate is different from that set in the hparam file"
          )
  
      beg_samp = 0
      step_size = int(time_resolution * sample_rate)
      end_samp = step_size
      index = 0
  
      # Initialize upsampled signal
      vad_signal = torch.zeros(1, sig_len, device=vad_out.device)
  
      # Upsample signal
      while end_samp < sig_len:
          vad_signal[0, beg_samp:end_samp] = vad_out[0, index, 0]
          index = index + 1
          beg_samp = beg_samp + step_size
          end_samp = beg_samp + step_size
      return vad_signal
  
imports: import torch
  import torchaudio
  from speechbrain.utils.data_utils import split_path
  from speechbrain.utils.fetching import fetch
  from speechbrain.inference.interfaces import Pretrained
label_desc: Use image node_id 13 for calling the VAD obj's underlying member method code with example usage: obj.upsample_VAD(vad_out, audio_file, time_resolution) and returns: vad_signal