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: Outputs the frame-level speech probability of the input audio file
  using the neural model specified in the hparam file. To make this code
  both parallelizable and scalable to long sequences, it uses a
  double-windowing approach.  First, we sequentially read non-overlapping
  large chunks of the input signal.  We then split the large chunks into
  smaller chunks and we process them in parallel.
  
  Arguments
  ---------
  audio_file: path
      Path of the audio file containing the recording. The file is read
      with torchaudio.
  large_chunk_size: float
      Size (in seconds) of the large chunks that are read sequentially
      from the input audio file.
  small_chunk_size:
      Size (in seconds) of the small chunks extracted from the large ones.
      The audio signal is processed in parallel within the small chunks.
      Note that large_chunk_size/small_chunk_size must be an integer.
  overlap_small_chunk: bool
      True, creates overlapped small chunks. The probabilities of the
      overlapped chunks are combined using hamming windows.
  
  Returns
  -------
  prob_vad: torch.Tensor
      Tensor containing the frame-level speech probabilities for the
      input audio file.
docstr_tok: ["Outputs","the","frame-level","speech","probability","of","the","input","audio","file","using","the","neural","model","specified","in","the","hparam","file",".","To","make","this","code","both","parallelizable","and","scalable","to","long","sequences",",","it","uses","a","double-windowing","approach",".","First",",","we","sequentially","read","non-overlapping","large","chunks","of","the","input","signal",".","We","then","split","the","large","chunks","into","smaller","chunks","and","we","process","them","in","parallel",".","Arguments","--","--","--","--","-","audio_file",":","path","Path","of","the","audio","file","containing","the","recording",".","The","file","is","read","with","torchaudio",".","large_chunk_size",":","float","Size","(","in","seconds",")","of","the","large","chunks","that","are","read","sequentially","from","the","input","audio","file",".","small_chunk_size",":","Size","(","in","seconds",")","of","the","small","chunks","extracted","from","the","large","ones",".","The","audio","signal","is","processed","in","parallel","within","the","small","chunks",".","Note","that","large_chunk_size\/small_chunk_size","must","be","an","integer",".","overlap_small_chunk",":","bool","True",",","creates","overlapped","small","chunks",".","The","probabilities","of","the","overlapped","chunks","are","combined","using","hamming","windows",".","Returns","--","--","--","-","prob_vad",":","torch.Tensor","Tensor","containing","the","frame-level","speech","probabilities","for","the","input","audio","file","."]
code: def get_speech_prob_file(
      self,
      audio_file,
      large_chunk_size=30,
      small_chunk_size=10,
      overlap_small_chunk=False,
  ):
      """Outputs the frame-level speech probability of the input audio file
      using the neural model specified in the hparam file. To make this code
      both parallelizable and scalable to long sequences, it uses a
      double-windowing approach.  First, we sequentially read non-overlapping
      large chunks of the input signal.  We then split the large chunks into
      smaller chunks and we process them in parallel.
  
      Arguments
      ---------
      audio_file: path
          Path of the audio file containing the recording. The file is read
          with torchaudio.
      large_chunk_size: float
          Size (in seconds) of the large chunks that are read sequentially
          from the input audio file.
      small_chunk_size:
          Size (in seconds) of the small chunks extracted from the large ones.
          The audio signal is processed in parallel within the small chunks.
          Note that large_chunk_size/small_chunk_size must be an integer.
      overlap_small_chunk: bool
          True, creates overlapped small chunks. The probabilities of the
          overlapped chunks are combined using hamming windows.
  
      Returns
      -------
      prob_vad: torch.Tensor
          Tensor containing the frame-level speech probabilities for the
          input audio file.
      """
      # Getting the total size of the input file
      sample_rate, audio_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"
          )
  
      # Computing the length (in samples) of the large and small chunks
      long_chunk_len = int(sample_rate * large_chunk_size)
      small_chunk_len = int(sample_rate * small_chunk_size)
  
      # Setting the step size of the small chunk (50% overlapping windows are supported)
      small_chunk_step = small_chunk_size
      if overlap_small_chunk:
          small_chunk_step = small_chunk_size / 2
  
      # Computing the length (in sample) of the small_chunk step size
      small_chunk_len_step = int(sample_rate * small_chunk_step)
  
      # Loop over big chunks
      prob_chunks = []
      last_chunk = False
      begin_sample = 0
      while True:
          # Reading the big chunk
          large_chunk, fs = torchaudio.load(
              str(audio_file),
              frame_offset=begin_sample,
              num_frames=long_chunk_len,
          )
          large_chunk = large_chunk.to(self.device)
  
          # Manage padding of the last small chunk
          if last_chunk or large_chunk.shape[-1] < small_chunk_len:
              padding = torch.zeros(
                  1, small_chunk_len, device=large_chunk.device
              )
              large_chunk = torch.cat([large_chunk, padding], dim=1)
  
          # Splitting the big chunk into smaller (overlapped) ones
          small_chunks = torch.nn.functional.unfold(
              large_chunk.unsqueeze(1).unsqueeze(2),
              kernel_size=(1, small_chunk_len),
              stride=(1, small_chunk_len_step),
          )
          small_chunks = small_chunks.squeeze(0).transpose(0, 1)
  
          # Getting (in parallel) the frame-level speech probabilities
          small_chunks_prob = self.get_speech_prob_chunk(small_chunks)
          small_chunks_prob = small_chunks_prob[:, :-1, :]
  
          # Manage overlapping chunks
          if overlap_small_chunk:
              small_chunks_prob = self._manage_overlapped_chunks(
                  small_chunks_prob
              )
  
          # Prepare for folding
          small_chunks_prob = small_chunks_prob.permute(2, 1, 0)
  
          # Computing lengths in samples
          out_len = int(
              large_chunk.shape[-1]
              / (sample_rate * self.time_resolution)
          )
          kernel_len = int(small_chunk_size / self.time_resolution)
          step_len = int(small_chunk_step / self.time_resolution)
  
          # Folding the frame-level predictions
          small_chunks_prob = torch.nn.functional.fold(
              small_chunks_prob,
              output_size=(1, out_len),
              kernel_size=(1, kernel_len),
              stride=(1, step_len),
          )
  
          # Appending the frame-level speech probabilities of the large chunk
          small_chunks_prob = small_chunks_prob.squeeze(1).transpose(
              -1, -2
          )
          prob_chunks.append(small_chunks_prob)
  
          # Check stop condition
          if last_chunk:
              break
  
          # Update counter to process the next big chunk
          begin_sample = begin_sample + long_chunk_len
  
          # Check if the current chunk is the last one
          if begin_sample + long_chunk_len > audio_len:
              last_chunk = True
  
      # Converting the list to a tensor
      prob_vad = torch.cat(prob_chunks, dim=1)
      last_elem = int(audio_len / (self.time_resolution * sample_rate))
      prob_vad = prob_vad[:, 0:last_elem, :]
  
      return prob_vad
  
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 2 for calling the VAD obj's underlying member method code with example usage: obj.get_speech_prob_file(audio_file, large_chunk_size, small_chunk_size, overlap_small_chunk) and returns: prob_vad