示例#1
0
    def test_seek(self):
        file_name = os.path.join(test_data_dir, 'alert_pcm_16_22050_1ch.wav')
        source = WaveSource(file_name)

        seek_time = 0.3
        seek_bytes = seek_time * source.audio_format.bytes_per_second
        source.seek(seek_time)
        self._check_data(source, 23166 - seek_bytes, 0.225)
示例#2
0
    def test_pcm_8_22050_1ch(self):
        file_name = os.path.join(test_data_dir, 'alert_pcm_8_22050_1ch.wav')
        source = WaveSource(file_name)

        self._check_audio_format(source, 1, 8, 22050)
        self._check_data(source, 11583, 0.525)
示例#3
0
    def test_pcm_16_11025_1ch(self):
        file_name = os.path.join(test_data_dir, 'alert_pcm_16_11025_1ch.wav')
        source = WaveSource(file_name)

        self._check_audio_format(source, 1, 16, 11025)
        self._check_data(source, 11584, 0.525)