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:
Andrew 2012-01-27 17:31:10 -05:00
parent 24a0ab847a
commit 9c70b260a6

View file

@ -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'):