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)
      ]
  
      onsets = [0.15, 0.5, 0.9]
      audio = AudioOnsetsMarker(sampleRate=sr, onsets=onsets)(input)
      MonoWriter(filename=file)(audio)
      left = MonoLoader(filename=file, downmix="left", sampleRate=sr)()
      diff = zeros(inputSize)
      for i in range(inputSize):
          # due to AudioOnsetsMarker downmixing by 0.5,
          # input[i] must be divided accordingly:
          diff[i] = left[i] - input[i] / 2
  
      os.remove(file)
      onsetWidth = 0.04 * sr
      epsilon = 1e-3
      found = zeros(len(onsets))
      j = 0
      i = 0
      while i < inputSize:
          if diff[int(i)] > epsilon:
              found[j] = float(i) / float(sr)
              j += 1
              i += onsetWidth
          else:
              i += 1
      self.assertAlmostEqualVector(found, onsets, 1e-3)
  
file_path: essentia/test/src/unittests/io/test_audioonsetsmarker.py
imports: from essentia_test import *
  from numpy import pi, sin
  import os
  import essentia.streaming
label_desc: Use image node_id 1 for calling the TestAudioOnsetsMarker obj's underlying member method code with example usage: obj.testRegression() without return types