class_docstr: Convolve the audio with a randomly selected impulse response.
  Impulse responses can be created using e.g. http://tulrich.com/recording/ir_capture/
  Impulse responses are represented as audio (ideally wav) files in the given ir_path.
class_docstr_tok: ["Convolve","the","audio","with","a","randomly","selected","impulse","response",".","Impulse","responses","can","be","created","using","e.g",".","http",":","\/\/tulrich.com\/recording\/ir_capture\/","Impulse","responses","are","represented","as","audio","(","ideally","wav",")","files","in","the","given","ir_path","."]
docstr: :param ir_path: A path or list of paths to audio file(s) and/or folder(s) with
      audio files. Can be str or Path instance(s). The audio files given here are
      supposed to be impulse responses.
  :param p: The probability of applying this transform
  :param lru_cache_size: Maximum size of the LRU cache for storing impulse response files
  in memory.
  :param leave_length_unchanged: When set to True, the tail of the sound (e.g. reverb at
      the end) will be chopped off so that the length of the output is equal to the
      length of the input.
docstr_tok: [":","param","ir_path",":","A","path","or","list","of","paths","to","audio","file","(","s",")","and\/or","folder","(","s",")","with","audio","files",".","Can","be","str","or","Path","instance","(","s",")",".","The","audio","files","given","here","are","supposed","to","be","impulse","responses",".",":","param","p",":","The","probability","of","applying","this","transform",":","param","lru_cache_size",":","Maximum","size","of","the","LRU","cache","for","storing","impulse","response","files","in","memory",".",":","param","leave_length_unchanged",":","When","set","to","True",",","the","tail","of","the","sound","(","e.g",".","reverb","at","the","end",")","will","be","chopped","off","so","that","the","length","of","the","output","is","equal","to","the","length","of","the","input","."]
code: def __init__(
      self,
      ir_path: Union[List[Path], List[str], str, Path],
      p=0.5,
      lru_cache_size=128,
      leave_length_unchanged: bool = True,
  ):
      """
      :param ir_path: A path or list of paths to audio file(s) and/or folder(s) with
          audio files. Can be str or Path instance(s). The audio files given here are
          supposed to be impulse responses.
      :param p: The probability of applying this transform
      :param lru_cache_size: Maximum size of the LRU cache for storing impulse response files
      in memory.
      :param leave_length_unchanged: When set to True, the tail of the sound (e.g. reverb at
          the end) will be chopped off so that the length of the output is equal to the
          length of the input.
      """
      super().__init__(p)
      self.ir_files = find_audio_files_in_paths(ir_path)
      self.ir_files = [str(p) for p in self.ir_files]
      assert len(self.ir_files) > 0
      self.__load_ir = functools.lru_cache(maxsize=lru_cache_size)(
          ApplyImpulseResponse.__load_ir
      )
  
      self.leave_length_unchanged = leave_length_unchanged
  
file_path: audiomentations/audiomentations/augmentations/apply_impulse_response.py
imports: import functools
  import random
  import warnings
  from pathlib import Path
  from typing import List, Union
  import numpy
  from numpy.typing import NDArray
  from scipy.signal import convolve
  from audiomentations.core.audio_loading_utils import load_sound_file
  from audiomentations.core.transforms_interface import BaseWaveformTransform
  from audiomentations.core.utils import find_audio_files_in_paths
label_desc: Use image node_id 1 to create a new ApplyImpulseResponse object from inherited base classes: BaseWaveformTransform with example: obj = ApplyImpulseResponse(ir_path, p, lru_cache_size, leave_length_unchanged)