def test_ljspeech(self): dataset = ljspeech.LJSPEECH(self.root_dir) n_ite = 0 for i, (waveform, sample_rate, transcript, normalized_transcript) in enumerate( dataset ): expected_transcript = self.transcripts[i] expected_normalized_transcript = self.normalized_transcripts[i] expected_data = self.data[i] self.assertEqual(expected_data, waveform, atol=5e-5, rtol=1e-8) assert sample_rate == sample_rate assert transcript == expected_transcript assert normalized_transcript == expected_normalized_transcript n_ite += 1 assert n_ite == len(self.data)
def test_ljspeech_path(self): dataset = ljspeech.LJSPEECH(Path(self.root_dir)) self._test_ljspeech(dataset)
def test_ljspeech_str(self): dataset = ljspeech.LJSPEECH(self.root_dir) self._test_ljspeech(dataset)