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

Recognizing error for blank wave file. #54

Closed
joei4cm opened this issue Aug 18, 2014 · 3 comments
Closed

Recognizing error for blank wave file. #54

joei4cm opened this issue Aug 18, 2014 · 3 comments

Comments

@joei4cm
Copy link

joei4cm commented Aug 18, 2014

Dear,
I think I meet issue after get a black wave file by arecord. Sometimes the confidence value will be get and sometimes not. Could anyone pls. have a check on this?

mp3_library/Brad-Sucks--Total-Breakdown.mp3 already fingerprinted, continuing...
Recording WAVE 'test_target/blank.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
Recording Done
test_target/another_song.wav
Confidence: 6
Not match.
test_target/another_song_2.wav
Confidence: 6
Not match.
test_target/blank.wav
Traceback (most recent call last):
File "./audio_analysis.py", line 54, in
confi_value = song['confidence']
TypeError: 'NoneType' object has no attribute 'getitem'

@worldveil
Copy link
Owner

It's not a bug.

The song returned may be None if no aligning hashes were found. One might make the argument an empty dictionary is better, but that's the most compelling argument I can come up with.

See code here.

@joei4cm
Copy link
Author

joei4cm commented Aug 19, 2014

Thank you. I think I will take the dictionary check first before print the elements. 😄

@joei4cm
Copy link
Author

joei4cm commented Aug 20, 2014

I think I have success to avoid the exception, sorry for my little mis-understanding for None.

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

2 participants