class_docstr: Audio level analyzer
  
  Examples
  --------
  
  >>> import timeside
  >>> from timeside.core import get_processor
  >>> from timeside.core.tools.test_samples import samples
  >>> source = samples['sweep.mp3']
  >>> decoder = get_processor('file_decoder')(uri=source)
  >>> level = get_processor('level')()
  >>> (decoder | level).run()
  >>> ('level.max' in level.results.keys()) and ('level.rms' in level.results.keys() )
  True
  >>> max = level.results['level.max']
  >>> print(max.data)
  [0.]
  >>> rms = level.results['level.rms']
  >>> print(rms.data)  # doctest: +ELLIPSIS
  [-3.7...]
class_docstr_tok: ["Audio","level","analyzer","Examples","--","--","--","--",">",">",">","import","timeside",">",">",">","from","timeside.core","import","get_processor",">",">",">","from","timeside.core.tools.test_samples","import","samples",">",">",">","source","=","samples","[","'sweep.mp3","'","]",">",">",">","decoder","=","get_processor","(","'file_decoder","'",")","(","uri=source",")",">",">",">","level","=","get_processor","(","'level","'",")","(",")",">",">",">","(","decoder","|","level",")",".run","(",")",">",">",">","(","'level.max","'","in","level.results.keys","(",")",")","and","(","'level.rms","'","in","level.results.keys","(",")",")","True",">",">",">","max","=","level.results","[","'level.max","'","]",">",">",">","print","(","max.data",")","[","0",".","]",">",">",">","rms","=","level.results","[","'level.rms","'","]",">",">",">","print","(","rms.data",")","#","doctest",":","+ELLIPSIS","[","-3.7","...","]"]
code: def post_process(self):
      # Max level
      max_level = self.new_result(data_mode="value", time_mode="global")
  
      max_level.id_metadata.id += "." + "max"
      max_level.id_metadata.name += " " + "Max"
  
      if self.max_value == 0:  # Prevent np.log10(0) = Inf
          self.max_value = MACHINE_EPSILON
  
      max_level.data_object.value = np.round(
          20 * np.log10(self.max_value), 3
      )
      self.add_result(max_level)
  
      # RMS level
      rms_level = self.new_result(data_mode="value", time_mode="global")
      rms_level.id_metadata.id += "." + "rms"
      rms_level.id_metadata.name += " " + "RMS"
  
      rms_val = np.sqrt(np.mean(self.mean_values))
  
      if rms_val == 0:
          rms_val = MACHINE_EPSILON
  
      rms_level.data_object.value = np.round(20 * np.log10(rms_val), 3)
      self.add_result(rms_level)
  
file_path: TimeSide/timeside/plugins/analyzer/level.py
imports: from timeside.core import implements, interfacedoc
  from timeside.core.analyzer import Analyzer
  from timeside.core.api import IValueAnalyzer
  import numpy
  from timeside.plugins.analyzer.utils import MACHINE_EPSILON
label_desc: Use image node_id 7 for calling the Level obj's underlying member method code with example usage: obj.post_process() without return types