beetbox / beetbox/pyacoustid

Check that argument to `decode_fingerprint` is bytes

Open
#39 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
408
Forks
69
PR merge metrics
No merged PRs in 30d

Description

hello,

I'm trying to play with pyacoustid but I'm encountering a mistake I can't get past.

I have the same audio recording in mp3 and ogg format on which I run the program fpcalc with the -plain option :
```
# pacman -S chromaprint
...
Packages (1) chromaprint-1.4.3-1
...

$ pip install --user pyacoustid
...
Successfully installed pyacoustid-1.1.5

$ fpcalc -plain neil.*
AQAAH5ukTWESCRcDJqFToetxRQlKCe7hX8JfpNORrEftTPAfUJRmVJJT9EiYI2SFuwq-HVvMB98adBpzeDzSPMoFzXbwZNagJ8R95CPSaZwAiAAARjkgETAUKQEQU4AoRwAB
AQAAIJukTckUCRcLJqFToWOOKwtKCe7hX8JfpNORrEftTPAfUJRmVJJT9EiYI2SFuwo-5dj-4NwadBpzeDzSPMoFzXbwzBp0JsR95CPSaZyg0wGIAABGOSARMBQpARBgChBmCCAI
```
in python3, I'm trying this piece of code inspired by https://gist.github.com/lalinsky/1132166 :
```python
import chromaprint
a = 'AQAAH5ukTWESCRcDJqFToetxRQlKCe7hX8JfpNORrEftTPAfUJRmVJJT9EiYI2SFuwq-HVvMB98adBpzeDzSPMoFzXbwZNagJ8R95CPSaZwAiAAARjkgETAUKQEQU4AoRwAB'
A = chromaprint.decode_fingerprint(a)
```
```
Traceback (most recent call last):
File "", line 1, in
File "/home/pascal/.local/lib/python3.6/site-packages/chromaprint.py", line 149, in decode_fingerprint
ctypes.byref(algorithm), 1 if base64 else 0
ctypes.ArgumentError: argument 1: : wrong type
```
`a` does not appear to be base64 encoded :
```python
import base64
base64.b64decode(a)
```
```
Traceback (most recent call last):
File "", line 1, in
File "/usr/lib/python3.6/base64.py", line 87, in b64decode
return binascii.a2b_base64(s)
binascii.Error: Incorrect padding
```
what's the mistake I'm making ?

regards, lacsaP.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.