class_docstr: An AudioAdapter implementation that use FFMPEG binary through
  subprocess in order to perform I/O operation for audio processing.
  
  When created, FFMPEG binary path will be checked and expended,
  raising exception if not found. Such path could be infered using
  `FFMPEG_PATH` environment variable.
class_docstr_tok: ["An","AudioAdapter","implementation","that","use","FFMPEG","binary","through","subprocess","in","order","to","perform","I\/O","operation","for","audio","processing",".","When","created",",","FFMPEG","binary","path","will","be","checked","and","expended",",","raising","exception","if","not","found",".","Such","path","could","be","infered","using","`","FFMPEG_PATH","`","environment","variable","."]
docstr: Loads the audio file denoted by the given path
  and returns it data as a waveform.
  
  Parameters:
      path (Union[Path, str]:
          Path of the audio file to load data from.
      offset (Optional[float]):
          (Optional) Start offset to load from in seconds.
      duration (Optional[float]):
          (Optional) Duration to load in seconds.
      sample_rate (Optional[float]):
          (Optional) Sample rate to load audio with.
      dtype (bytes):
          (Optional) Data type to use, default to `b'float32'`.
  
  Returns:
      Signal:
          Loaded data a (waveform, sample_rate) tuple.
  
  Raises:
      SpleeterError:
          If any error occurs while loading audio.
docstr_tok: ["Loads","the","audio","file","denoted","by","the","given","path","and","returns","it","data","as","a","waveform",".","Parameters",":","path","(","Union","[","Path",",","str","]",":","Path","of","the","audio","file","to","load","data","from",".","offset","(","Optional","[","float","]",")",":","(","Optional",")","Start","offset","to","load","from","in","seconds",".","duration","(","Optional","[","float","]",")",":","(","Optional",")","Duration","to","load","in","seconds",".","sample_rate","(","Optional","[","float","]",")",":","(","Optional",")","Sample","rate","to","load","audio","with",".","dtype","(","bytes",")",":","(","Optional",")","Data","type","to","use",",","default","to","`","b'float32","'","`",".","Returns",":","Signal",":","Loaded","data","a","(","waveform",",","sample_rate",")","tuple",".","Raises",":","SpleeterError",":","If","any","error","occurs","while","loading","audio","."]
code: def load(
      _,
      path: Union[Path, str],
      offset: Optional[float] = None,
      duration: Optional[float] = None,
      sample_rate: Optional[float] = None,
      dtype: bytes = b"float32",
  ) -> Signal:
      """
      Loads the audio file denoted by the given path
      and returns it data as a waveform.
  
      Parameters:
          path (Union[Path, str]:
              Path of the audio file to load data from.
          offset (Optional[float]):
              (Optional) Start offset to load from in seconds.
          duration (Optional[float]):
              (Optional) Duration to load in seconds.
          sample_rate (Optional[float]):
              (Optional) Sample rate to load audio with.
          dtype (bytes):
              (Optional) Data type to use, default to `b'float32'`.
  
      Returns:
          Signal:
              Loaded data a (waveform, sample_rate) tuple.
  
      Raises:
          SpleeterError:
              If any error occurs while loading audio.
      """
      if isinstance(path, Path):
          path = str(path)
      if not isinstance(path, str):
          path = path.decode()
      try:
          probe = ffmpeg.probe(path)
      except ffmpeg._run.Error as e:
          raise SpleeterError(
              "An error occurs with ffprobe (see ffprobe output below)\n\n{}".format(
                  e.stderr.decode()
              )
          )
      if "streams" not in probe or len(probe["streams"]) == 0:
          raise SpleeterError("No stream was found with ffprobe")
      metadata = next(
          stream
          for stream in probe["streams"]
          if stream["codec_type"] == "audio"
      )
      n_channels = metadata["channels"]
      if sample_rate is None:
          sample_rate = metadata["sample_rate"]
      output_kwargs = {"format": "f32le", "ar": sample_rate}
      if duration is not None:
          output_kwargs["t"] = str(dt.timedelta(seconds=duration))
      if offset is not None:
          output_kwargs["ss"] = str(dt.timedelta(seconds=offset))
      process = (
          ffmpeg.input(path)
          .output("pipe:", **output_kwargs)
          .run_async(pipe_stdout=True, pipe_stderr=True)
      )
      buffer, _ = process.communicate()
      waveform = np.frombuffer(buffer, dtype="<f4").reshape(
          -1, n_channels
      )
      if not waveform.dtype == np.dtype(dtype):
          waveform = waveform.astype(dtype)
      return (waveform, sample_rate)
  
file_path: spleeter/spleeter/audio/ffmpeg.py
imports: import datetime
  import os
  import shutil
  from pathlib import Path
  from typing import Dict, Optional, Union
  import ffmpeg
  import numpy
  from ..None import SpleeterError
  from ..types import Signal
  from ..utils.logging import logger
  from .None import Codec
  from .adapter import AudioAdapter
label_desc: Use image node_id 2 for calling the FFMPEGProcessAudioAdapter obj's underlying member method code with example usage: obj.load(_, path, offset, duration, sample_rate, dtype) and returns: waveform,  sample_rate