class_docstr: Gain up or down the audio after the given transform (or set of transforms) has
  processed the audio. There are several methods that determine how the audio should
  be gained. PostGain can be useful for compensating for any gain differences introduced
  by a (set of) transform(s), or for preventing clipping in the output.
class_docstr_tok: ["Gain","up","or","down","the","audio","after","the","given","transform","(","or","set","of","transforms",")","has","processed","the","audio",".","There","are","several","methods","that","determine","how","the","audio","should","be","gained",".","PostGain","can","be","useful","for","compensating","for","any","gain","differences","introduced","by","a","(","set","of",")","transform","(","s",")",",","or","for","preventing","clipping","in","the","output","."]
docstr: :param transform: A callable to be applied. It should input
      samples (ndarray), sample_rate (int) and optionally some user-defined
      keyword arguments.
  :param method: "same_rms", "same_lufs", "peak_normalize_always" or "peak_normalize_always"
docstr_tok: [":","param","transform",":","A","callable","to","be","applied",".","It","should","input","samples","(","ndarray",")",",","sample_rate","(","int",")","and","optionally","some","user-defined","keyword","arguments",".",":","param","method",":","``","same_rms","''",",","``","same_lufs","''",",","``","peak_normalize_always","''","or","``","peak_normalize_always","''"]
code: def __init__(
      self,
      transform: Callable[
          [NDArray[np.float32], int], NDArray[np.float32]
      ],
      method: str,  # , **kwargs
  ):
      """
      :param transform: A callable to be applied. It should input
          samples (ndarray), sample_rate (int) and optionally some user-defined
          keyword arguments.
      :param method: "same_rms", "same_lufs", "peak_normalize_always" or "peak_normalize_always"
      """
      self.transform = transform
      self.method = method
      assert self.method in (
          "same_rms",
          "same_lufs",
          "peak_normalize_always",
          "peak_normalize_if_too_loud",
          # "target_rms",
          # "target_lufs",
          # "target_peak_dbfs",
          # "target_true_peak_dbfs",
      )
  
file_path: audiomentations/audiomentations/core/post_gain.py
imports: from typing import Callable
  import numpy
  import sys
  from numpy.typing import NDArray
  from audiomentations import Normalize
  from audiomentations.core.utils import calculate_rms, convert_decibels_to_amplitude_ratio
label_desc: Use image node_id 1 to create a new PostGain object  with example: obj = PostGain(transform, method)