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

Add support for bytearray in chromaprint #31

Closed
wants to merge 1 commit into from

Conversation

interfect
Copy link

As noted in my comments on beetbox/beets#1958, Beets seems to want to send bytearrays into Chromaprint, which currently wants only bytes. I have no idea how to fix it on Beets's end, so here's a PR that does the conversion.

When I just pass bytearrays on through, some other type-checking code complains about it being the wrong type, so I opted for the (possibly inefficient) conversion instead.

@sampsyo
Copy link
Member

sampsyo commented Aug 1, 2016

Thanks for looking into this! You're right that something else might be going on… this could be the right fix, but let's do some due diligence if you don't mind.

Can you include some system details? Specifically:

  • What file types were you trying to fingerprint?
  • Do you have GStreamer and python-gobject installed?
  • Do you have ffmpeg installed?

In particular, I'm trying to get at the Audioread backend that's getting triggered for you, which should tell us what code is producing bytearrays.

@interfect
Copy link
Author

I was trying to fingerprint MP3 files. I have libgstreamer1.0-0
version 1.8.2-1~ubuntu1, python-gobject-2 version 2.28.6-12ubuntu1, and
ffmpeg version 7:2.8.6-1ubuntu2 all installed.

On Sun, Jul 31, 2016 at 7:55 PM, Adrian Sampson notifications@github.com
wrote:

Thanks for looking into this! You're right that something else might be
going on… this could be the right fix, but let's do some due diligence
if you don't mind.

Can you include some system details? Specifically:

  • What file types were you trying to fingerprint?
  • Do you have GStreamer and python-gobject installed?
  • Do you have ffmpeg installed?

In particular, I'm trying to get at the Audioread
https://github.com/beetbox/audioread backend that's getting triggered
for you, which should tell us what code is producing bytearrays.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#31 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAt5tqg5VXvKuqBlUPyqCiC9F5WyE2YTks5qbWAUgaJpZM4JZI_I
.

@sampsyo
Copy link
Member

sampsyo commented Aug 2, 2016

OK, sorry for the wild goose chase, but what about the package that Ubuntu calls python-gi? (Confusingly, that's the modern version of pygobject—I don't know why they couldn't choose clearer names.)

@stefanor
Copy link

I've seen bytearrays when pymad reads MP3s.

@sampsyo
Copy link
Member

sampsyo commented Aug 24, 2016

That's very useful to know; thank you!

@interfect
Copy link
Author

To answer your earlier question, I have python-gi 3.20.0-0ubuntu1 installed.

On Wed, Aug 24, 2016 at 1:01 PM, Adrian Sampson notifications@github.com
wrote:

That's very useful to know; thank you!


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#31 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAt5tlh3rzGRU-G9zbpb1cDqTTjEcpl5ks5qjKMZgaJpZM4JZI_I
.

@sampsyo
Copy link
Member

sampsyo commented Oct 29, 2016

I was finally able to nail down this problem: indeed, pymad has started returning bytearray objects. It's not in that project's changelog, but here's the commit that made the change: jaqx0r/pymad@0231d16#comments

So we now accept that type as input.

sampsyo added a commit to beetbox/audioread that referenced this pull request Oct 29, 2016
The pymad module didn't document this change, but it started returning
bytearray objects as of version 0.9:
jaqx0r/pymad@0231d16#comments

So we now might produce that type. See also beetbox/pyacoustid#31 and
beets/issues#2216.
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

Successfully merging this pull request may close these issues.

3 participants