def test_wrong_file(self): # ToDo: pesq does not support filenames in the moment return with self.assertRaisesRegex( ChildProcessError, r'An error of type 2 \(Reference or Degraded below 1/4 ' r'second - processing stopped \) occurred during processing.'): pesq(__file__, self.deg_path)
def test_wb_scores_with_lists_of_arrays_length_one(self): scores = pesq( [self.ref_array], [self.deg_array], sample_rate=16000, ) np.testing.assert_allclose(scores, np.asarray([1.083234]), rtol=1e-6)
def test_nb_scores_with_lists_of_arrays_length_two(self): scores = pesq( [self.ref_array, self.ref_array], [self.deg_array, self.ref_array], sample_rate=16000, mode='nb', ) np.testing.assert_allclose(scores, np.asarray([1.607208, 4.548638]))
def test_wb_scores_with_paths_directly(self): # ToDo: pesq does not support filenames in the moment return scores = pesq( self.ref_path, self.deg_path, sample_rate=16000, ) np.testing.assert_allclose(scores, np.asarray([1.083]))
def test_wb_scores_with_lists_of_paths_length_two(self): # ToDo: pesq does not support filenames in the moment return scores = pesq( [self.ref_path, self.ref_path], [self.deg_path, self.ref_path], sample_rate=16000, ) np.testing.assert_allclose(scores, np.asarray([1.083, 4.644]))
def test_nb_scores_with_lists_of_paths_length_one(self): # ToDo: pesq does not support filenames in the moment return scores = pesq( [self.ref_path], [self.deg_path], sample_rate=16000, mode='nb', ) np.testing.assert_allclose(scores, np.asarray([1.607]))