worldveil / dejavu

Audio fingerprinting and recognition in Python
MIT License
6.36k stars 1.43k forks source link

Error when running example #212

Open RWOverdijk opened 4 years ago

RWOverdijk commented 4 years ago

Got this:

Fingerprinting channel 1/2 for mp3/Brad-Sucks--Total-Breakdown.mp3
Fingerprinting channel 1/2 for mp3/Sean-Fournier--Falling-For-You.mp3
Fingerprinting channel 1/2 for mp3/Josh-Woodward--I-Want-To-Destroy-Something-Beautiful.mp3
Fingerprinting channel 1/2 for mp3/Choc--Eigenvalue-Subspace-Decomposition.mp3
Fingerprinting channel 1/2 for mp3/The-Lights-Galaxia--While-She-Sleeps.mp3
Finished channel 1/2 for mp3/Brad-Sucks--Total-Breakdown.mp3
Fingerprinting channel 2/2 for mp3/Brad-Sucks--Total-Breakdown.mp3
Finished channel 1/2 for mp3/Sean-Fournier--Falling-For-You.mp3
Fingerprinting channel 2/2 for mp3/Sean-Fournier--Falling-For-You.mp3
Finished channel 1/2 for mp3/Josh-Woodward--I-Want-To-Destroy-Something-Beautiful.mp3
Fingerprinting channel 2/2 for mp3/Josh-Woodward--I-Want-To-Destroy-Something-Beautiful.mp3
Finished channel 1/2 for mp3/The-Lights-Galaxia--While-She-Sleeps.mp3
Fingerprinting channel 2/2 for mp3/The-Lights-Galaxia--While-She-Sleeps.mp3
Finished channel 2/2 for mp3/Brad-Sucks--Total-Breakdown.mp3
Finished channel 1/2 for mp3/Choc--Eigenvalue-Subspace-Decomposition.mp3
Fingerprinting channel 2/2 for mp3/Choc--Eigenvalue-Subspace-Decomposition.mp3
Finished channel 2/2 for mp3/Sean-Fournier--Falling-For-You.mp3
Finished channel 2/2 for mp3/Josh-Woodward--I-Want-To-Destroy-Something-Beautiful.mp3
Finished channel 2/2 for mp3/The-Lights-Galaxia--While-She-Sleeps.mp3
Finished channel 2/2 for mp3/Choc--Eigenvalue-Subspace-Decomposition.mp3
From file we recognized: {'song_id': 2, 'song_name': 'Sean-Fournier--Falling-For-You', 'file_sha1': 'A9D18B9B9DAA467350D1B6B249C36759282B962E', 'confidence': 127466, 'offset_seconds': 0.0, 'match_time': 26.77591609954834, 'offset': 0}

* start recording
Traceback (most recent call last):
  File "example.py", line 26, in <module>
    song = djv.recognize(MicrophoneRecognizer, seconds=secs)
  File "/Users/rwoverdijk/projects/python/dejavu/dejavu/__init__.py", line 167, in recognize
    return r.recognize(*options, **kwoptions)
  File "/Users/rwoverdijk/projects/python/dejavu/dejavu/recognize.py", line 108, in recognize
    self.start_recording()
  File "/Users/rwoverdijk/projects/python/dejavu/dejavu/recognize.py", line 79, in start_recording
    frames_per_buffer=chunksize,
  File "/usr/local/lib/python2.7/site-packages/pyaudio.py", line 750, in open
    stream = Stream(self, *args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/pyaudio.py", line 441, in __init__
    self._stream = pa.open(**arguments)
IOError: [Errno -9998] Invalid number of channels

Also I had to perform a couple more steps: