Пример #1
0
 def test_get_48000_frequency(self):
     self.assertIsInstance(audio_sample_rate(48000), SR48000)
Пример #2
0
 def test_raises_for_unknown_audio_samplerate(self):
     self.assertRaises(ValueError, lambda: audio_sample_rate(1))
Пример #3
0
 def test_get_11025_frequency(self):
     self.assertIsInstance(audio_sample_rate(11025), SR11025)
Пример #4
0
 def test_get_22050_freuency(self):
     self.assertIsInstance(audio_sample_rate(22050), SR22050)
Пример #5
0
 def from_file(cls, file_like_object):
     with SoundFile(file_like_object, mode='r') as f:
         samples = f.read(dtype=np.float32)
         return AudioSamples(samples, audio_sample_rate(f.samplerate))
Пример #6
0
 def samplerate(self):
     return audio_sample_rate(self.samples_per_second)