code: def testRegression(self):
      # The test audio files for loudness are provided in EBU Tech 3341
      # https://tech.ebu.ch/docs/tech/tech3341.pdf
  
      # M, S, I = -20 +- 0.1 LUFS
      filename = join(
          testdata.audio_dir,
          "generated",
          "ebur128",
          "1kHz_sine_-20LUFS-16bit.flac",
      )
      audio, samplerate, _, _, _, _ = AudioLoader(filename=filename)()
      m, s, i, r = LoudnessEBUR128(sampleRate=samplerate)(audio)
      self.assertAlmostEqualVector(
          m, essentia.array([-20.0] * len(m)), 0.1
      )
      self.assertAlmostEqualVector(
          s, essentia.array([-20.0] * len(s)), 0.1
      )
      self.assertAlmostEqual(i, -20.0, 0.1)
  
      # M, S, I = -26 +- 0.1 LUFS
      filename = join(
          testdata.audio_dir,
          "generated",
          "ebur128",
          "1kHz_sine_-26LUFS-16bit.flac",
      )
      audio, samplerate, _, _, _, _ = AudioLoader(filename=filename)()
      m, s, i, r = LoudnessEBUR128(sampleRate=samplerate)(audio)
      self.assertAlmostEqualVector(
          m, essentia.array([-26.0] * len(m)), 0.1
      )
      self.assertAlmostEqualVector(
          s, essentia.array([-26.0] * len(s)), 0.1
      )
      self.assertAlmostEqual(i, -26.0, 0.1)
  
      # M, S, I = -40 +- 0.1 LUFS
      filename = join(
          testdata.audio_dir,
          "generated",
          "ebur128",
          "1kHz_sine_-40LUFS-16bit.flac",
      )
      audio, samplerate, _, _, _, _ = AudioLoader(filename=filename)()
      m, s, i, r = LoudnessEBUR128(sampleRate=samplerate)(audio)
      self.assertAlmostEqualVector(
          m, essentia.array([-40.0] * len(m)), 0.1
      )
      self.assertAlmostEqualVector(
          s, essentia.array([-40.0] * len(s)), 0.1
      )
      self.assertAlmostEqual(i, -40.0, 0.1)
  
      # M, S, I = -23 +- 0.1 LUFS
      filename = join(
          testdata.audio_dir,
          "generated",
          "ebur128",
          "seq-3341-1-16bit.flac",
      )
      audio, samplerate, _, _, _, _ = AudioLoader(filename=filename)()
      m, s, i, r = LoudnessEBUR128(sampleRate=samplerate)(audio)
      self.assertAlmostEqualVector(
          m, essentia.array([-23.0] * len(m)), 0.1
      )
      self.assertAlmostEqualVector(
          s, essentia.array([-23.0] * len(s)), 0.1
      )
      self.assertAlmostEqual(i, -23.0, 0.1)
  
      # M, S, I = -33 +- 0.1 LUFS
      filename = join(
          testdata.audio_dir,
          "generated",
          "ebur128",
          "seq-3341-2-16bit.flac",
      )
      audio, samplerate, _, _, _, _ = AudioLoader(filename=filename)()
      m, s, i, r = LoudnessEBUR128(sampleRate=samplerate)(audio)
      self.assertAlmostEqualVector(
          m, essentia.array([-33.0] * len(m)), 0.1
      )
      self.assertAlmostEqualVector(
          s, essentia.array([-33.0] * len(s)), 0.1
      )
      self.assertAlmostEqual(i, -33.0, 0.1)
  
      # I = -23 +- 0.1 LUFS
      filename = join(
          testdata.audio_dir,
          "generated",
          "ebur128",
          "seq-3341-3-16bit-v02.flac",
      )
      audio, samplerate, _, _, _, _ = AudioLoader(filename=filename)()
      _, _, i, _ = LoudnessEBUR128(sampleRate=samplerate)(audio)
      self.assertAlmostEqual(i, -23.0, 0.1)
  
      # I = -23 +- 0.1 LUFS
      filename = join(
          testdata.audio_dir,
          "generated",
          "ebur128",
          "seq-3341-4-16bit-v02.flac",
      )
      audio, samplerate, _, _, _, _ = AudioLoader(filename=filename)()
      _, _, i, _ = LoudnessEBUR128(sampleRate=samplerate)(audio)
      self.assertAlmostEqual(i, -23.0, 0.1)
  
      # I = -23 +- 0.1 LUFS
      filename = join(
          testdata.audio_dir,
          "generated",
          "ebur128",
          "seq-3341-5-16bit-v02.flac",
      )
      audio, samplerate, _, _, _, _ = AudioLoader(filename=filename)()
      _, _, i, _ = LoudnessEBUR128(sampleRate=samplerate)(audio)
      self.assertAlmostEqual(i, -23.0, 0.1)
  
      # I = -23 +- 0.1 LUFS
      filename = join(
          testdata.audio_dir,
          "generated",
          "ebur128",
          "seq-3341-7_seq-3342-5-16bit.flac",
      )
      audio, samplerate, _, _, _, _ = AudioLoader(filename=filename)()
      _, _, i, _ = LoudnessEBUR128(sampleRate=samplerate)(audio)
      self.assertAlmostEqual(i, -23.0, 0.1)
  
      # Test audio files for dynamic range are provided in EBU Tech Doc 3342
      # https://tech.ebu.ch/docs/tech/tech3342.pdf
  
      # LRA = 10 +- 1 LU
      filename = join(
          testdata.audio_dir,
          "generated",
          "ebur128",
          "seq-3342-1-16bit.flac",
      )
      audio, samplerate, _, _, _, _ = AudioLoader(filename=filename)()
      _, _, _, r = LoudnessEBUR128(sampleRate=samplerate)(audio)
      self.assertAlmostEqual(r, 10.0, 1.0)
  
      # LRA = 5 +- 1 LU
      filename = join(
          testdata.audio_dir,
          "generated",
          "ebur128",
          "seq-3342-2-16bit.flac",
      )
      audio, samplerate, _, _, _, _ = AudioLoader(filename=filename)()
      _, _, _, r = LoudnessEBUR128(sampleRate=samplerate)(audio)
      self.assertAlmostEqual(r, 5.0, 1.0)
  
      # LRA = 20 +- 1 LU
      filename = join(
          testdata.audio_dir,
          "generated",
          "ebur128",
          "seq-3342-3-16bit.flac",
      )
      audio, samplerate, _, _, _, _ = AudioLoader(filename=filename)()
      _, _, _, r = LoudnessEBUR128(sampleRate=samplerate)(audio)
      self.assertAlmostEqual(r, 20.0, 1.0)
  
      # LRA = 15 +- 1 LU
      filename = join(
          testdata.audio_dir,
          "generated",
          "ebur128",
          "seq-3342-4-16bit.flac",
      )
      audio, samplerate, _, _, _, _ = AudioLoader(filename=filename)()
      _, _, _, r = LoudnessEBUR128(sampleRate=samplerate)(audio)
      self.assertAlmostEqual(r, 15.0, 1.0)
  
imports: from essentia_test import *
label_desc: Use image node_id 1 for calling the TestLoudnessEBUR128 obj's underlying member method code with example usage: obj.testRegression() without return types