This commit is contained in:
Adrian Sampson 2012-01-27 15:32:02 -08:00
commit 3c7cfe1820
2 changed files with 50 additions and 0 deletions

29
.gitignore vendored Normal file
View file

@ -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/*

View file

@ -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.