Exemplo n.º 1
0
    def test_method(self):
        source = procedural.WhiteNoise(0.5)
        player = media.Player()
        player.play()
        player.queue(source)

        while player.source:
            player.dispatch_events()
Exemplo n.º 2
0
 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)
Exemplo n.º 3
0
    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()
Exemplo n.º 4
0
    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()
Exemplo n.º 5
0
    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()