mirror of
https://github.com/beetbox/beets.git
synced 2026-01-03 14:32:55 +01:00
Merge pull request #2379 from docbobo/feature/dsf-support
Support for DSF files
This commit is contained in:
commit
96350ab7db
5 changed files with 24 additions and 2 deletions
|
|
@ -40,7 +40,6 @@ import mutagen.id3
|
|||
import mutagen.mp4
|
||||
import mutagen.flac
|
||||
import mutagen.asf
|
||||
|
||||
import codecs
|
||||
import datetime
|
||||
import re
|
||||
|
|
@ -73,6 +72,7 @@ TYPES = {
|
|||
'mpc': 'Musepack',
|
||||
'asf': 'Windows Media',
|
||||
'aiff': 'AIFF',
|
||||
'dsf': 'DSD Stream File',
|
||||
}
|
||||
|
||||
PREFERRED_IMAGE_EXTENSIONS = {'jpeg': 'jpg'}
|
||||
|
|
@ -728,7 +728,7 @@ class MP4ImageStorageStyle(MP4ListStorageStyle):
|
|||
class MP3StorageStyle(StorageStyle):
|
||||
"""Store data in ID3 frames.
|
||||
"""
|
||||
formats = ['MP3', 'AIFF']
|
||||
formats = ['MP3', 'AIFF', 'DSF']
|
||||
|
||||
def __init__(self, key, id3_lang=None, **kwargs):
|
||||
"""Create a new ID3 storage style. `id3_lang` is the value for
|
||||
|
|
@ -1475,6 +1475,8 @@ class MediaFile(object):
|
|||
self.type = 'asf'
|
||||
elif type(self.mgfile).__name__ == 'AIFF':
|
||||
self.type = 'aiff'
|
||||
elif type(self.mgfile).__name__ == 'DSF':
|
||||
self.type = 'dsf'
|
||||
else:
|
||||
raise FileTypeError(path, type(self.mgfile).__name__)
|
||||
|
||||
|
|
|
|||
BIN
test/rsrc/empty.dsf
Normal file
BIN
test/rsrc/empty.dsf
Normal file
Binary file not shown.
BIN
test/rsrc/full.dsf
Normal file
BIN
test/rsrc/full.dsf
Normal file
Binary file not shown.
BIN
test/rsrc/unparseable.dsf
Normal file
BIN
test/rsrc/unparseable.dsf
Normal file
Binary file not shown.
|
|
@ -901,6 +901,26 @@ class AIFFTest(ReadWriteTestBase, unittest.TestCase):
|
|||
'channels': 1,
|
||||
}
|
||||
|
||||
try:
|
||||
import mutagen.dsf
|
||||
except:
|
||||
HAVE_DSF = False
|
||||
else:
|
||||
HAVE_DSF = True
|
||||
|
||||
@unittest.skipIf(not HAVE_DSF, "mutagen < 1.37")
|
||||
class DSFTest(ReadWriteTestBase,
|
||||
ExtendedImageStructureTestMixin, unittest.TestCase):
|
||||
extension = 'dsf'
|
||||
audio_properties = {
|
||||
'length': 0.01,
|
||||
'bitrate': 11289600,
|
||||
'format': u'DSD Stream File',
|
||||
'samplerate': 5644800,
|
||||
'bitdepth': 1,
|
||||
'channels': 2,
|
||||
}
|
||||
|
||||
|
||||
class MediaFieldTest(unittest.TestCase):
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue