示例#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)