Skip to content

Instantly share code, notes, and snippets.

@andrewdunndev
Created January 27, 2012 21:56
Show Gist options
  • Select an option

  • Save andrewdunndev/1691149 to your computer and use it in GitHub Desktop.

Select an option

Save andrewdunndev/1691149 to your computer and use it in GitHub Desktop.
@property
def samplerate(self):
if hasattr(self.mgfile.info, 'sample_rate'):
# Reasonably sure from checking documentation that all formats
# have this available.
return self.mgfile.info.sample_rate
else:
# Return and empty string, _if_ this ever happens
return ''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment