def test_check_target_type(): audio_dir = join(_get_test_data_path(), 'audio') stim = AudioStim(join(audio_dir, 'barber.wav')) td = DictionaryExtractor(join(TEXT_DIR, 'test_lexical_dictionary.txt'), variables=['length', 'frequency']) with pytest.raises(TypeError): stim.extract([td])
def test_audio_stim(dummy_iter_extractor): audio_dir = join(_get_test_data_path(), 'audio') stim = AudioStim(join(audio_dir, 'barber.wav')) assert round(stim.duration) == 57 assert stim.sampling_rate == 11025 tl = stim.extract([dummy_iter_extractor]) assert isinstance(tl, Timeline)
def test_audio_stim(self): audio_dir = join(_get_test_data_path(), 'audio') stim = AudioStim(join(audio_dir, 'barber.wav')) self.assertEquals(round(stim.duration), 57) self.assertEquals(stim.sampling_rate, 11025) tl = stim.extract([self.dummy_iter_extractor]) assert isinstance(tl, Timeline)
def test_stft_extractor(): audio_dir = join(_get_test_data_path(), 'audio') stim = AudioStim(join(audio_dir, 'barber.wav')) ext = STFTExtractor(frame_size=1., spectrogram=False, bins=[(100, 300), (300, 3000), (3000, 20000)]) timeline = stim.extract([ext]) df = timeline.to_df('long') assert df.shape == (1671, 4)
def test_stft_extractor(self): audio_dir = join(_get_test_data_path(), 'audio') stim = AudioStim(join(audio_dir, 'barber.wav')) ext = STFTExtractor(frame_size=1., spectrogram=False, bins=[(100, 300), (300, 3000), (3000, 20000)]) timeline = stim.extract([ext]) df = timeline.to_df('long') self.assertEquals(df.shape, (1671, 4))
def test_audio_stim(self): audio_dir = join(_get_test_data_path(), 'audio') stim = AudioStim(join(audio_dir, 'barber.wav')) self.assertEquals(round(stim.duration), 57) self.assertEquals(stim.sampling_rate, 11025) stim.extract([self.dummy_iter_extractor])