class_docstr: An audio file decoded by the ffmpeg command-line utility.
class_docstr_tok: ["An","audio","file","decoded","by","the","ffmpeg","command-line","utility","."]
code: def __init__(self, filename, block_size=DEFAULT_BUFFER_SIZE):
      # On Windows, we need to disable the subprocess's crash dialog
      # in case it dies. Passing SEM_NOGPFAULTERRORBOX to SetErrorMode
      # disables this behavior.
      windows = sys.platform.startswith("win")
      if windows:
          windows_error_mode_lock.acquire()
          SEM_NOGPFAULTERRORBOX = 0x0002
          import ctypes
  
          # We call SetErrorMode in two steps to avoid overriding
          # existing error mode.
          previous_error_mode = ctypes.windll.kernel32.SetErrorMode(
              SEM_NOGPFAULTERRORBOX
          )
          ctypes.windll.kernel32.SetErrorMode(
              previous_error_mode | SEM_NOGPFAULTERRORBOX
          )
  
      try:
          self.proc = popen_multiple(
              COMMANDS,
              ["-i", filename, "-f", "s16le", "-"],
              stdout=subprocess.PIPE,
              stderr=subprocess.PIPE,
              stdin=subprocess.DEVNULL,
              creationflags=PROC_FLAGS,
          )
  
      except OSError:
          raise NotInstalledError()
  
      finally:
          # Reset previous error mode on Windows. (We can change this
          # back now because the flag was inherited by the subprocess;
          # we don't need to keep it set in the parent process.)
          if windows:
              try:
                  import ctypes
  
                  ctypes.windll.kernel32.SetErrorMode(
                      previous_error_mode
                  )
              finally:
                  windows_error_mode_lock.release()
  
      # Start another thread to consume the standard output of the
      # process, which contains raw audio data.
      self.stdout_reader = QueueReaderThread(
          self.proc.stdout, block_size
      )
      self.stdout_reader.start()
  
      # Read relevant information from stderr.
      self._get_info()
  
      # Start a separate thread to read the rest of the data from
      # stderr. This (a) avoids filling up the OS buffer and (b)
      # collects the error output for diagnosis.
      self.stderr_reader = QueueReaderThread(self.proc.stderr)
      self.stderr_reader.start()
  
imports: import queue
  import re
  import subprocess
  import sys
  import threading
  import time
  from io import DEFAULT_BUFFER_SIZE
  from .exceptions import DecodeError
  from .base import AudioFile
label_desc: Use image node_id 1 to create a new FFmpegAudioFile object from inherited base classes: AudioFile with example: obj = FFmpegAudioFile(filename, block_size)