當前位置: 首頁>>代碼示例>>Python>>正文


Python Dejavu.get_fingerprinted_songs方法代碼示例

本文整理匯總了Python中dejavu.Dejavu.get_fingerprinted_songs方法的典型用法代碼示例。如果您正苦於以下問題:Python Dejavu.get_fingerprinted_songs方法的具體用法?Python Dejavu.get_fingerprinted_songs怎麽用?Python Dejavu.get_fingerprinted_songs使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在dejavu.Dejavu的用法示例。


在下文中一共展示了Dejavu.get_fingerprinted_songs方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: Lilo

# 需要導入模塊: from dejavu import Dejavu [as 別名]
# 或者: from dejavu.Dejavu import get_fingerprinted_songs [as 別名]
class Lilo():
    """
    The class for JamJar which will be used to identify video matches and add fingerprints to the database
    """

    def __init__(self, config, filename, video_id):
        """
        usage:
            fingerprinter = Lilo('/path/to/video/file','unique_video_id')
        """
        self.djv = Dejavu(config)
        self.filename = filename
        self.video_id = video_id

        # cache these after first fingerprint
        self.hashes = None

    def recognize_track(self):
        # Try to match the song to the existing database
        hashes, songs = self.djv.recognize(FileRecognizer, self.filename)

        self.hashes = hashes

        return songs

    def fingerprint_song(self):
        # Now let's add this song to the DB
        data = self.djv.fingerprint_file(self.filename, self.video_id, cached_hashes=self.hashes)
        return data

    def check_if_fingerprinted(self):
        video_hash = unique_hash(self.filename)
        # Set self.djv.songhashes_set
        fingerprinted_video_hashes = self.djv.get_fingerprinted_songs()
        return video_hash in self.djv.songhashes_set
開發者ID:projectjamjar,項目名稱:lilo,代碼行數:37,代碼來源:__init__.py


注:本文中的dejavu.Dejavu.get_fingerprinted_songs方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。