I'm using gnsdk- to identify 15 seconds of music, which seems to be working pretty well in terms of recognising the album the song is from.

How do I then use the data returned to get the artist, song, and other information, rather than just the album title?


It's true that Gracenote metadata comes back in album-centric form. However the matching track for the fingerprint is also part of the response. On the GnAlbum object there is a TrackMatched member that will return the GnTrack object that is the matching track for the query. You can also iterate the GnTracks on the GnAlbum and check the Matched property on each GnTrack, should that way be more convenient.


Hi There,


Try integrating the code snippet below into your app and go from there. You can look at the GnTrack class in to discover more attributes of the track.


Damon @ Gracenote


    def display_track_info(track):

        print "    Title: %s" % track.title().display()

        print "      number: %s" % track.track_number()

        print "      artist: %s" % track.artist().name().display()

        print "      genre lvl 1: %s" % track.genre().level1()

        print "      genre lvl 2: %s" % track.genre().level2()

        print "      genre lvl 3: %s" % track.genre().level3()

        print "      mood lvl 1: %s" % track.mood().level1()

        print "      mood lvl 2: %s" % track.mood().level2()


    def display_album_info(album):

        print "   Title: %s" % album.title().display()

        tracks = album.tracks_matched()

        #print tracks.count()

        iterable =

        print "  matched track(s)"

        for index in range(tracks.count()):

            track =



    for test_input in test_inputs:

        album = best_album(get_fingerprint(test_input),gnsdk.kFingerprintTypeGNFPX)

        if album:

            print "Final album:"

            if not album.full_result():

                print "Title: %s" % album.title().display()

                print "Album is partial...requerying for full result."

                print "requery"

                album = best_album(album)


Great! Thank you both.

PS. track.artist().name().display() was returning "None" so I just used album.artist().name().display() instead.

Forum Discussions