本文整理汇总了Python中track.Track.hashPath方法的典型用法代码示例。如果您正苦于以下问题:Python Track.hashPath方法的具体用法?Python Track.hashPath怎么用?Python Track.hashPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类track.Track
的用法示例。
在下文中一共展示了Track.hashPath方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Track
# 需要导入模块: from track import Track [as 别名]
# 或者: from track.Track import hashPath [as 别名]
path = os.path.join(aifSetAll, filename)
track = Track()
track.path = path
tracks.append(track)
# Преобразование aif to wav
# for track in tracks:
# wavFileName = os.path.splitext(track.path)[0] + ".wav"
# subprocess.call([sox, track.path, wavFileName])
# track.path = wavFileName
# Делаем хеши полных файлов
for track in tracks:
track.hashPath = os.path.splitext(track.path)[0] + ".hash"
subprocess.check_output([hashBuild, track.path, track.hashPath])
# Удаляем базу перед началом добавления
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, " ") # тут черная магия