code: def samplerate(self):
          
          if hasattr(self.mgfile.info, 'sample_rate'):
              return self.mgfile.info.sample_rate
          elif self.type == 'opus':
              # Opus is always 48kHz internally.
              return 48000
          return 0
docs: The audio's sample rate (an int).