mirror of
https://github.com/fergalmoran/picard.git
synced 2026-01-03 07:03:58 +00:00
PICARD-1839: Support tagging DSDIFF (DFF) files with ID3
This commit is contained in:
@@ -39,6 +39,7 @@ from picard.formats.apev2 import (
|
||||
from picard.formats.asf import ASFFile
|
||||
from picard.formats.id3 import (
|
||||
AiffFile,
|
||||
DSDIFFFile,
|
||||
DSFFile,
|
||||
MP3File,
|
||||
TrueAudioFile,
|
||||
@@ -71,6 +72,8 @@ register_format(AACFile)
|
||||
register_format(AC3File)
|
||||
register_format(AiffFile)
|
||||
register_format(ASFFile)
|
||||
if DSDIFFFile:
|
||||
register_format(DSDIFFFile)
|
||||
register_format(DSFFile)
|
||||
register_format(FLACFile)
|
||||
register_format(MIDIFile)
|
||||
|
||||
@@ -736,3 +736,17 @@ class AiffFile(NonCompatID3File):
|
||||
EXTENSIONS = [".aiff", ".aif", ".aifc"]
|
||||
NAME = "Audio Interchange File Format (AIFF)"
|
||||
_File = mutagen.aiff.AIFF
|
||||
|
||||
|
||||
try:
|
||||
import mutagen.dsdiff
|
||||
|
||||
class DSDIFFFile(NonCompatID3File):
|
||||
|
||||
"""DSF file."""
|
||||
EXTENSIONS = [".dff"]
|
||||
NAME = "DSDIFF"
|
||||
_File = mutagen.dsdiff.DSDIFF
|
||||
|
||||
except ImportError:
|
||||
DSDIFFFile = None
|
||||
|
||||
BIN
test/data/test-dsd.dff
Normal file
BIN
test/data/test-dsd.dff
Normal file
Binary file not shown.
BIN
test/data/test-dst.dff
Normal file
BIN
test/data/test-dst.dff
Normal file
Binary file not shown.
@@ -510,6 +510,31 @@ class DSFTest(CommonId3Tests.Id3TestCase):
|
||||
unexpected_info = ['~video']
|
||||
|
||||
|
||||
if id3.DSDIFFFile:
|
||||
class DSDIFFTest(CommonId3Tests.Id3TestCase):
|
||||
testfile = 'test-dsd.dff'
|
||||
supports_ratings = True
|
||||
expected_info = {
|
||||
'length': 10,
|
||||
'~channels': '2',
|
||||
'~sample_rate': '5644800',
|
||||
'~bitrate': '11289.6',
|
||||
'~bits_per_sample': '1',
|
||||
}
|
||||
unexpected_info = ['~video']
|
||||
|
||||
class DSDIFFDSTTest(CommonId3Tests.Id3TestCase):
|
||||
testfile = 'test-dst.dff'
|
||||
supports_ratings = True
|
||||
expected_info = {
|
||||
'length': 0,
|
||||
'~channels': '2',
|
||||
'~sample_rate': '5644800',
|
||||
'~bits_per_sample': '1',
|
||||
}
|
||||
unexpected_info = ['~video']
|
||||
|
||||
|
||||
class AIFFTest(CommonId3Tests.Id3TestCase):
|
||||
testfile = 'test.aiff'
|
||||
supports_ratings = False
|
||||
|
||||
Reference in New Issue
Block a user