def test_get_48000_frequency(self): self.assertIsInstance(audio_sample_rate(48000), SR48000)
def test_raises_for_unknown_audio_samplerate(self): self.assertRaises(ValueError, lambda: audio_sample_rate(1))
def test_get_11025_frequency(self): self.assertIsInstance(audio_sample_rate(11025), SR11025)
def test_get_22050_freuency(self): self.assertIsInstance(audio_sample_rate(22050), SR22050)
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))
def samplerate(self): return audio_sample_rate(self.samples_per_second)