def createMovingLightGraph():
    fg = filtergraph.FilterGraph(recordTimings=True)

    audio_in = audio.AudioInput(num_channels=2)
    fg.addEffectNode(audio_in)

    led_out = devices.LEDOutput()
    fg.addEffectNode(led_out)

    color_wheel = colors.ColorWheel()
    fg.addEffectNode(color_wheel)

    movingLight = audioreactive.MovingLight(fs=audio_in.getSampleRate())
    fg.addEffectNode(movingLight)

    mirrorLower = effects.Mirror(mirror_lower=True, recursion=0)
    fg.addEffectNode(mirrorLower)

    afterglow = effects.AfterGlow(glow_time=0.15)
    fg.addEffectNode(afterglow)

    append = effects.Append(2, flip0=True)
    fg.addEffectNode(append)

    fg.addConnection(audio_in, 0, movingLight, 0)
    fg.addConnection(color_wheel, 0, movingLight, 1)
    fg.addConnection(movingLight, 0, afterglow, 0)
    fg.addConnection(afterglow, 0, append, 0)
    fg.addConnection(afterglow, 0, append, 1)
    fg.addConnection(append, 0, led_out, 0)

    return fg
Exemplo n.º 2
0
 def test_effectDoesntProcessNullBuffers(self):
     effect = effects.Mirror()
     effect.process()
     self.assertIsNone(effect._inputBuffer)