def test_method(self): source = procedural.WhiteNoise(0.5) player = media.Player() player.play() player.queue(source) while player.source: player.dispatch_events()
def test_play_queue(self): """You should hear white noise (static) for 0.5 seconds. The test will exit immediately after. """ source = procedural.WhiteNoise(0.5) player = media.Player() player.play() player.queue(source)
def test_pause_queue(self): """You should hear white noise (static) for 0.5 seconds. The test will exit immediately after. """ source = procedural.WhiteNoise(0.5) player = media.Player() player.pause() player.queue(source) while player.source: player.dispatch_events() player.play()
def test_method(self): source = procedural.WhiteNoise(0.5) player = media.Player() player.queue(source) player.play() start_time = time.time() stage = 0 while player.source: if stage == 0 and time.time() - start_time > 0.25: player.pause() stage = 1 if stage == 1 and time.time() - start_time > 0.75: player.play() stage = 2 player.dispatch_events()
def test_pause(self): """You should hear white noise (static) for 0.25 seconds, then a 0.5 second pause then another 0.25 seconds of noise. The test will exit immediately after. """ source = procedural.WhiteNoise(0.5) player = media.Player() player.queue(source) player.play() start_time = time.time() stage = 0 while player.source: if stage == 0 and time.time() - start_time > 0.25: player.pause() stage = 1 if stage == 1 and time.time() - start_time > 0.75: player.play() stage = 2 player.dispatch_events()