Пример #1
0
 def test_sph_files(self, file, fails):
     # Some SPHERE files can be read with soundfile, but not all.
     path = get_file_path(file)
     if fails:
         with pytest.raises(RuntimeError):
             load_audio(path)
     else:
         load_audio(path)
Пример #2
0
    def test_mfcc(self):
        path = get_file_path("sample.wav")

        y = audioread(path)[0]
        y_filtered = transform.mfcc(y)

        tc.assert_equal(y_filtered.shape, (291, 13))
        tc.assert_isreal(y_filtered)
Пример #3
0
    def test_mfcc(self):
        path = get_file_path("sample.wav")

        y = audioread(path)[0]
        yFilterd = transform.ssc(y)

        tc.assert_equal(yFilterd.shape, (294, 26))
        tc.assert_isreal(yFilterd)
Пример #4
0
    def test_fbank(self):
        path = get_file_path("sample.wav")

        y = audioread(path)[0]
        feature = transform.fbank(y)

        tc.assert_equal(feature.shape, (240, 23))
        tc.assert_isreal(feature)
        tc.assert_array_greater_equal(feature, 0)
Пример #5
0
    def setUp(self):
        path = get_file_path("sample.wav")

        self.time_signal = load_audio(path)
        # self.time_signal = np.random.randn(5, 3, 5324)
        self.torch_signal = torch.from_numpy(self.time_signal)
        self.stft = STFT(size=self.size,
                         shift=self.shift,
                         window_length=self.window_length,
                         fading=self.fading,
                         complex_representation='concat',
                         window=self.window)
        self.fbins = self.stft.size // 2 + 1
Пример #6
0
    def setUp(self):
        self.ref_path = get_file_path('speech.wav')
        self.deg_path = get_file_path('speech_bab_0dB.wav')

        self.ref_array = pb.io.load_audio(self.ref_path)
        self.deg_array = pb.io.load_audio(self.deg_path)
Пример #7
0
 def setUp(self):
     path = get_file_path("sample.wav")
     self.x = audioread(path)[0]