code: def testRegression(self):
      sr = 44100
      inputSize = sr  # 1 second of audio
      input = [
          0.5 * sin(2.0 * pi * 440.0 * i / inputSize)
          for i in range(inputSize)
      ]
      MonoWriter(filename="foo.wav", sampleRate=sr)(input)
      left = MonoLoader(
          filename="foo.wav", downmix="left", sampleRate=sr
      )()
      os.remove("foo.wav")
      self.assertAlmostEqualVector(left, input, 5e-2)
  
      sr = 48000
      inputSize = sr  # 1 second of audio
      input = [
          0.5 * sin(2.0 * pi * 440.0 * i / inputSize)
          for i in range(inputSize)
      ]
      MonoWriter(filename="foo.wav", sampleRate=sr)(input)
      left = MonoLoader(
          filename="foo.wav", downmix="left", sampleRate=sr
      )()
      os.remove("foo.wav")
      self.assertAlmostEqualVector(left, input, 5e-2)
  
      sr = 22050
      inputSize = sr  # 1 second of audio
      input = [
          0.5 * sin(2.0 * pi * 440.0 * i / inputSize)
          for i in range(inputSize)
      ]
      MonoWriter(filename="foo.wav", sampleRate=sr)(input)
      left = MonoLoader(
          filename="foo.wav", downmix="left", sampleRate=sr
      )()
      os.remove("foo.wav")
      self.assertAlmostEqualVector(left, input, 5e-2)
  
file_path: essentia/test/src/unittests/io/test_monowriter.py
imports: from essentia_test import *
  import sys
  from numpy import pi, sin
  import os
label_desc: Use image node_id 1 for calling the TestMonoWriter obj's underlying member method code with example usage: obj.testRegression() without return types