code: def normalize_volume(
      wav, target_dBFS, increase_only=False, decrease_only=False
  ):
      # this function implements Loudness normalization, instead of peak
      # normalization, See https://en.wikipedia.org/wiki/Audio_normalization
      # dBFS: Decibels relative to full scale
      # See https://en.wikipedia.org/wiki/DBFS for more details
      # for 16Bit PCM audio, minimal level is -96dB
      # compute the mean dBFS and adjust to target dBFS, with by increasing
      # or decreasing
      if increase_only and decrease_only:
          raise ValueError(
              "Both increase only and decrease only are set"
          )
      dBFS_change = target_dBFS - 10 * np.log10(np.mean(wav**2))
      if (dBFS_change < 0 and increase_only) or (
          dBFS_change > 0 and decrease_only
      ):
          return wav
      gain = 10 ** (dBFS_change / 20)
      return wav * gain
  
file_path: PaddleHub/modules/audio/voice_cloning/lstm_tacotron2/audio_processor.py
imports: from pathlib import Path
  from warnings import warn
  import struct
  from scipy.ndimage.morphology import binary_dilation
  import numpy
  import librosa
label_desc: Use image node_id 1 for calling a global function with example usage: normalize_volume(wav, target_dBFS, increase_only, decrease_only) and returns: unknown, wav