MCPcopy Create free account
hub / github.com/GStreamer/gst-python / main

Function main

old_examples/audio-controller.py:15–37  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

13import time
14
15def main():
16 pipeline = gst.Pipeline("audiocontroller")
17 src = gst.element_factory_make("audiotestsrc", "src")
18 sink = gst.element_factory_make("alsasink", "sink")
19 pipeline.add(src, sink)
20 src.link(sink)
21
22 control = gst.Controller(src, "freq", "volume")
23 control.set_interpolation_mode("volume", gst.INTERPOLATE_LINEAR)
24 control.set_interpolation_mode("freq", gst.INTERPOLATE_LINEAR)
25
26 control.set("volume", 0, 0.0)
27 control.set("volume", 2 * gst.SECOND, 1.0)
28 control.set("volume", 4 * gst.SECOND, 0.0)
29 control.set("volume", 6 * gst.SECOND, 1.0)
30
31 control.set("freq", 0, 440.0)
32 control.set("freq", 3 * gst.SECOND, 3000.0)
33 control.set("freq", 6 * gst.SECOND, 880.0)
34
35 pipeline.set_state(gst.STATE_PLAYING)
36
37 time.sleep(7)
38
39if __name__ == "__main__":
40 main()

Callers 1

Calls 2

addMethod · 0.80
linkMethod · 0.80

Tested by

no test coverage detected