mirror of
https://github.com/beetbox/beets.git
synced 2026-01-05 15:33:15 +01:00
Added support for channels, changed samplerate so it doesn't return if
doesn't exist. Made bitdepth only return if exists, looks like only mp4, flac and ape support bitdepth.
This commit is contained in:
parent
24a0ab847a
commit
9c70b260a6
1 changed files with 7 additions and 3 deletions
|
|
@ -950,9 +950,6 @@ class MediaFile(object):
|
|||
# Reasonably sure from checking mutagen source that all
|
||||
# formats will return this information
|
||||
return self.mgfile.info.sample_rate
|
||||
else:
|
||||
# Return and empty string, _if_ this ever happens
|
||||
return ''
|
||||
|
||||
@property
|
||||
def bitdepth(self):
|
||||
|
|
@ -961,6 +958,13 @@ class MediaFile(object):
|
|||
# formats will return this information
|
||||
return self.mgfile.info.bits_per_sample
|
||||
|
||||
@property
|
||||
def channels(self):
|
||||
if hasattr(self.mgfile.info, 'channels'):
|
||||
# Reasonably sure from checking mutagen source that all
|
||||
# formats will return this information
|
||||
return self.mgfile.info.channels
|
||||
|
||||
@property
|
||||
def bitrate(self):
|
||||
if hasattr(self.mgfile.info, 'bitrate'):
|
||||
|
|
|
|||
Loading…
Reference in a new issue