Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

listen.py dies ValueError: zero-size array to reduction operation minimum which has no identity #2

Open
ericpardee opened this issue Jan 14, 2019 · 0 comments

Comments

@ericpardee
Copy link

Expected Behavior

Expect song artist title, song should be displayed like shazam app

Current Behavior

it crashes in listen.py step:

epardee@nhan7: /tmp/shazam-demo$ python listen.py -s 5
Listening....
Okey, enough
Took 204800 samples
Traceback (most recent call last):
  File "listen.py", line 98, in <module>
    matches.extend(find_matches(channel))
  File "listen.py", line 68, in find_matches
    hashes = analyzer.fingerprint(samples, Fs=Fs)
  File "/private/tmp/shazam-demo/src/analyzer.py", line 36, in fingerprint
    arr2D = 10 * np.log10(replaceZeroes(arr2D))
  File "/private/tmp/shazam-demo/src/analyzer.py", line 84, in replaceZeroes
    min_nonzero = np.min(data[np.nonzero(data)])
  File "/usr/local/lib/python2.7/site-packages/numpy/core/fromnumeric.py", line 2618, in amin
    initial=initial)
  File "/usr/local/lib/python2.7/site-packages/numpy/core/fromnumeric.py", line 86, in _wrapreduction
    return ufunc.reduce(obj, axis, dtype, out, **passkwargs)
ValueError: zero-size array to reduction operation minimum which has no identity

Steps to Reproduce

  1. download sample to mp3 folder: https://www.dropbox.com/s/62v1k5xo1jqa6k8/song2.mp3?dl=0
  2. python reset.py
  3. python analyze.py
  4. python listen.py -s 5

Context (Environment)

macOS 10.14
Python 2.7.15
node v11.6.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant