diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..b0fb5160d --- /dev/null +++ b/.gitignore @@ -0,0 +1,29 @@ + +# general hidden files/directories + +.DS_Store +.sconsign* +.svn + +# file patterns + +*.dylib +*.la +*.lo +*.o +*.pyc +*.pyo +*.so +*.tar.gz +*.tar.bz2 +*~ +*.project +*.pydevproject + +# Project Specific patterns + +dist/* +beets.egg-info/* +build/* +docs/_build/* + diff --git a/beets/mediafile.py b/beets/mediafile.py index 3d86b0750..9be8f2485 100644 --- a/beets/mediafile.py +++ b/beets/mediafile.py @@ -945,6 +945,27 @@ class MediaFile(object): return self.mgfile.info.length @property + def samplerate(self): + if hasattr(self.mgfile.info, 'sample_rate'): + # Reasonably sure from checking mutagen source that all + # formats will return this information + return self.mgfile.info.sample_rate + + @property + def bitdepth(self): + if hasattr(self.mgfile.info, 'bits_per_sample'): + # Reasonably sure from checking mutagen source that all + # 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'): # Many formats provide it explicitly.