opus: sample rate is always 48kHz

This commit is contained in:
Adrian Sampson 2013-09-12 10:05:22 -07:00
parent e1d34e20bf
commit 8dc1e223e9
2 changed files with 4 additions and 0 deletions

View file

@ -1322,6 +1322,9 @@ class MediaFile(object):
"""The audio's sample rate (an int)."""
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
@property

View file

@ -177,6 +177,7 @@ READ_ONLY_CORRECT_DICTS = {
'length': 1.0,
'bitrate': 63216,
'format': 'Opus',
'samplerate': 48000,
'bitdepth': 0,
'channels': 1,
},