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: Saves the boundaries on a file (and/or prints them)  in a readable format.
  
  Arguments
  ---------
  boundaries: torch.Tensor
      Tensor containing the speech boundaries. It can be derived using the
      get_boundaries method.
  save_path: path
      When to store the text file containing the speech/non-speech intervals.
  print_boundaries: Bool
      Prints the speech/non-speech intervals in the standard outputs.
  audio_file: path
      Path of the audio file containing the recording. The file is read
      with torchaudio. It is used here to detect the length of the
      signal.
docstr_tok: ["Saves","the","boundaries","on","a","file","(","and\/or","prints","them",")","in","a","readable","format",".","Arguments","--","--","--","--","-","boundaries",":","torch.Tensor","Tensor","containing","the","speech","boundaries",".","It","can","be","derived","using","the","get_boundaries","method",".","save_path",":","path","When","to","store","the","text","file","containing","the","speech\/non-speech","intervals",".","print_boundaries",":","Bool","Prints","the","speech\/non-speech","intervals","in","the","standard","outputs",".","audio_file",":","path","Path","of","the","audio","file","containing","the","recording",".","The","file","is","read","with","torchaudio",".","It","is","used","here","to","detect","the","length","of","the","signal","."]
code: def save_boundaries(
      self,
      boundaries,
      save_path=None,
      print_boundaries=True,
      audio_file=None,
  ):
      """Saves the boundaries on a file (and/or prints them)  in a readable format.
  
      Arguments
      ---------
      boundaries: torch.Tensor
          Tensor containing the speech boundaries. It can be derived using the
          get_boundaries method.
      save_path: path
          When to store the text file containing the speech/non-speech intervals.
      print_boundaries: Bool
          Prints the speech/non-speech intervals in the standard outputs.
      audio_file: path
          Path of the audio file containing the recording. The file is read
          with torchaudio. It is used here to detect the length of the
          signal.
      """
      # Create a new file if needed
      if save_path is not None:
          f = open(save_path, mode="w", encoding="utf-8")
  
      # Getting the total size of the input file
      if audio_file is not None:
          sample_rate, audio_len = self._get_audio_info(audio_file)
          audio_len = audio_len / sample_rate
  
      # Setting the rights format for second- or sample-based boundaries
      if boundaries.dtype == torch.int:
          value_format = "% i"
      else:
          value_format = "% .2f "
  
      # Printing speech and non-speech intervals
      last_end = 0
      cnt_seg = 0
      for i in range(boundaries.shape[0]):
          begin_value = boundaries[i, 0]
          end_value = boundaries[i, 1]
  
          if last_end != begin_value:
              cnt_seg = cnt_seg + 1
              print_str = (
                  "segment_%03d "
                  + value_format
                  + value_format
                  + "NON_SPEECH"
              )
              if print_boundaries:
                  print(print_str % (cnt_seg, last_end, begin_value))
              if save_path is not None:
                  f.write(
                      print_str % (cnt_seg, last_end, begin_value)
                      + "\n"
                  )
  
          cnt_seg = cnt_seg + 1
          print_str = (
              "segment_%03d " + value_format + value_format + "SPEECH"
          )
          if print_boundaries:
              print(print_str % (cnt_seg, begin_value, end_value))
          if save_path is not None:
              f.write(
                  print_str % (cnt_seg, begin_value, end_value) + "\n"
              )
  
          last_end = end_value
  
      # Managing last segment
      if audio_file is not None:
          if last_end < audio_len:
              cnt_seg = cnt_seg + 1
              print_str = (
                  "segment_%03d "
                  + value_format
                  + value_format
                  + "NON_SPEECH"
              )
              if print_boundaries:
                  print(print_str % (cnt_seg, end_value, audio_len))
              if save_path is not None:
                  f.write(
                      print_str % (cnt_seg, end_value, audio_len) + "\n"
                  )
  
      if save_path is not None:
          f.close()
  
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 9 for calling the VAD obj's underlying member method code with example usage: obj.save_boundaries(boundaries, save_path, print_boundaries, audio_file) without return types