【问题标题】:PyTaglib / Taglib DSD/DSF FormatPyTaglib / Taglib DSD/DSF 格式
【发布时间】:2018-07-12 10:35:23
【问题描述】:

目前我正在编写一个 Python 脚本来读取和编辑音频文件中的 ID3 标签。我目前正在使用基于http://taglib.org/https://github.com/supermihi/pytaglib,但这个库不支持dsf 文件。 是否有任何 Python 库或基于命令行的工具来处理 dsf 文件?另一种方法是直接从文件中写入和读取标签。字节 20-28 应该是存储 ID3 标签的指针。是否有任何文档如何将 ID3v2 标签存储在二进制数据中?

【问题讨论】:

    标签: python taglib id3v2


    【解决方案1】:

    DSD 文件符合 ID3V2。我做了一些挖掘,发现这个 Python 库 mutagen (https://mutagen.readthedocs.io/en/latest/index.html) 它支持 ID3v2 标签读取和编辑。为了破译元数据的输出,你应该打开这个网站(http://id3.org/id3v2.3.0)。这是一个示例脚本,可帮助将其组合在一起:

    # !/usr/bin/python
    # -*- coding: utf-8 -*-
    
    import mutagen
    
    x = mutagen.File("/Volumes/music/emilie-claire_barlow/seule_ce_soir_2ch64fs_dsd-dsf_2_8224_mhz/01_quand_le_soleil_dit_bonjour_aux_montagnes_2ch64.dsf")
    
    if 'TDRC' in x:
        print('Year: {}'.format(x['TDRC']))
    print('Track Number: {}'.format(x['TRCK']))
    print('Title/songname/content description: {}'.format(x['TIT2']))
    print('Content type(genre): {}'.format(x['TCON']))
    if 'TXXX:DURATION' in x:
        print('Duration: {}'.format(x['TXXX:DURATION']))
    print('Lead performer(s)/Soloist(s): {}'.format(x['TPE1']))
    print('Band/orchestra/accompaniment: {}'.format(x['TPE2']))
    print('Album/Movie/Show title: {}'.format(x['TALB']))
    if 'TCOM' in x:
        print('Composer: {}'.format(x['TCOM']))
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-03-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-01-16
      相关资源
      最近更新 更多