本文整理汇总了Python中track.Track.fingerPrintId方法的典型用法代码示例。如果您正苦于以下问题:Python Track.fingerPrintId方法的具体用法?Python Track.fingerPrintId怎么用?Python Track.fingerPrintId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类track.Track
的用法示例。
在下文中一共展示了Track.fingerPrintId方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: str
# 需要导入模块: from track import Track [as 别名]
# 或者: from track.Track import fingerPrintId [as 别名]
# Удаляем базу перед началом добавления
if os.path.exists(baseName):
os.remove(baseName)
if os.path.exists(baseNameAdditional):
os.remove(baseNameAdditional)
# Добавляем хэш в базу, определям fingerPrintId из вывода утилиты
for track in tracks:
out = subprocess.check_output([hbTool, "-add", track.hashPath, baseName, "The Comment"])
out = str(out).replace(os.linesep, " ") # тут черная магия
idIndex = int(out.find("contains id = "))
track.fingerPrintId = int(out[idIndex + 14 :].split("\\")[0]) # 14 - длина строки "contains id = "
print()
print(track.hashPath)
print("FP_ID = " + str(track.fingerPrintId))
# print(track.hashPath)
tracks = list()
# Читаем файлы из директории для резки
for dirname, dirnames, filenames in os.walk(aifSet):
for filename in filenames:
if fnmatch.fnmatch(filename, "*.aif"):
path = os.path.join(aifSet, filename)
track = Track()
track.path = path
tracks.append(track)