code: def vad_split(
      audio_frames,
      audio_format=DEFAULT_FORMAT,
      num_padding_frames=10,
      threshold=0.5,
      aggressiveness=3,
  ):
      from webrtcvad import (
          Vad,
      )  # pylint: disable=import-outside-toplevel
  
      if audio_format.channels != 1:
          raise ValueError("VAD-splitting requires mono samples")
      if audio_format.width != 2:
          raise ValueError("VAD-splitting requires 16 bit samples")
      if audio_format.rate not in [8000, 16000, 32000, 48000]:
          raise ValueError(
              "VAD-splitting only supported for sample rates 8000, 16000, 32000, or 48000"
          )
      if aggressiveness not in [0, 1, 2, 3]:
          raise ValueError(
              "VAD-splitting aggressiveness mode has to be one of 0, 1, 2, or 3"
          )
      ring_buffer = collections.deque(maxlen=num_padding_frames)
      triggered = False
      vad = Vad(int(aggressiveness))
      voiced_frames = []
      frame_duration_ms = 0
      frame_index = 0
      for frame_index, frame in enumerate(audio_frames):
          frame_duration_ms = (
              get_pcm_duration(len(frame), audio_format) * 1000
          )
          if int(frame_duration_ms) not in [10, 20, 30]:
              raise ValueError(
                  "VAD-splitting only supported for frame durations 10, 20, or 30 ms"
              )
          is_speech = vad.is_speech(frame, audio_format.rate)
          if not triggered:
              ring_buffer.append((frame, is_speech))
              num_voiced = len(
                  [f for f, speech in ring_buffer if speech]
              )
              if num_voiced > threshold * ring_buffer.maxlen:
                  triggered = True
                  for f, s in ring_buffer:
                      voiced_frames.append(f)
                  ring_buffer.clear()
          else:
              voiced_frames.append(frame)
              ring_buffer.append((frame, is_speech))
              num_unvoiced = len(
                  [f for f, speech in ring_buffer if not speech]
              )
              if num_unvoiced > threshold * ring_buffer.maxlen:
                  triggered = False
                  yield b"".join(
                      voiced_frames
                  ), frame_duration_ms * max(
                      0, frame_index - len(voiced_frames)
                  ), frame_duration_ms * frame_index
                  ring_buffer.clear()
                  voiced_frames = []
      if len(voiced_frames) > 0:
          yield b"".join(voiced_frames), frame_duration_ms * (
              frame_index - len(voiced_frames)
          ), frame_duration_ms * (frame_index + 1)
  
imports: import collections
  import ctypes
  import io
  import math
  import numpy
  import os
  import pyogg
  import tempfile
  import wave
  from .helpers import LimitingPool
  from collections import namedtuple
  from .io import open_remote, remove_remote, copy_remote, is_remote_path
label_desc: Use image node_id 11 for calling a global function with example usage: vad_split(audio_frames, audio_format, num_padding_frames, threshold, aggressiveness) without return types