bishoph / sopare

Real time sound pattern recognition in Python for Raspberry/Banana Pi.
Other
321 stars 86 forks source link

Unable to change the frequency window #88

Closed nmenoni closed 4 years ago

nmenoni commented 4 years ago

If I use sopare with the default frequency window (20-60) it works ok, but if I change it to for example: LOW_FREQ = 50 HIGH_FREQ = 4000

it always gives me the following error:

INFO:sopare.analyze:checking for plugins...
DEBUG:sopare.analyze:loading and initialzing plugins/print
DEBUG:sopare.audio_factory:#### Default input device info #####
DEBUG:sopare.audio_factory:defaultSampleRate: 44100.0
DEBUG:sopare.audio_factory:defaultLowOutputLatency: -1.0
INFO:sopare.worker:worker queue runner started
DEBUG:sopare.audio_factory:defaultLowInputLatency: 0.00868480725624
DEBUG:sopare.audio_factory:maxInputChannels: 1
DEBUG:sopare.audio_factory:structVersion: 2
DEBUG:sopare.audio_factory:hostApi: 0
DEBUG:sopare.audio_factory:index: 0
DEBUG:sopare.audio_factory:defaultHighOutputLatency: -1.0
DEBUG:sopare.audio_factory:maxOutputChannels: 0
DEBUG:sopare.audio_factory:name: WordForum USB: Audio (hw:1,0)
DEBUG:sopare.audio_factory:defaultHighInputLatency: 0.0348299319728
DEBUG:sopare.recorder:SAMPLE_RATE: 48000
DEBUG:sopare.recorder:CHUNK: 512
INFO:sopare.recorder:start endless recording
INFO:sopare.buffering:buffering queue runner
INFO:sopare.processing:starting append mode
DEBUG:sopare.filter:New window!
Process buffering queue:
Traceback (most recent call last):
  File "/usr/lib/python2.7/multiprocessing/process.py", line 267, in _bootstrap
    self.run()
  File "/home/pi/dev/sopare/sopare/buffering.py", line 43, in run
    self.proc.check_silence(buf)
  File "/home/pi/dev/sopare/sopare/processing.py", line 74, in check_silence
    self.prepare.prepare(buf, volume)
  File "/home/pi/dev/sopare/sopare/prepare.py", line 125, in prepare
    self.tokenize(meta)
  File "/home/pi/dev/sopare/sopare/prepare.py", line 50, in tokenize
    self.filter.filter(self.buffer, meta)
  File "/home/pi/dev/sopare/sopare/filter.py", line 126, in filter
    chunked_norm = self.get_chunked_norm(nfft)
  File "/home/pi/dev/sopare/sopare/filter.py", line 61, in get_chunked_norm
    progessive += progessive * pf
NameError: global name 'pf' is not defined
INFO:sopare.recorder:Buffering not alive, stop recording
INFO:sopare.recorder:stop endless recording

Do you have any idea of what this could be happening?

Thanks!

bishoph commented 4 years ago

This is an older bug that was already fixed...AFAIR it was issue #11