From e81e3817c0a4b735da47e6c45529c6f88ed4d52f Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Mon, 8 Feb 2021 21:27:18 -0500 Subject: Moved playback to backend; Menu; Size now matches --- Sirop.Backend/Playback.cs | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 Sirop.Backend/Playback.cs (limited to 'Sirop.Backend/Playback.cs') diff --git a/Sirop.Backend/Playback.cs b/Sirop.Backend/Playback.cs new file mode 100644 index 0000000..a073ce3 --- /dev/null +++ b/Sirop.Backend/Playback.cs @@ -0,0 +1,30 @@ +using Gst; + +namespace Sirop.Backend.Audio +{ + public static class Playback + { + public static void PlayAudio() + { + Application.Init(); + // Build the pipeline + var pipeline = Parse.Launch("playbin uri=file:///home/andrew/Music/4616-werq-by-kevin-macleod.mp3"); + + // Start playing + pipeline.SetState(State.Playing); + + // Wait until error or EOS + var bus = pipeline.Bus; + var msg = bus.TimedPopFiltered (Constants.CLOCK_TIME_NONE, MessageType.Eos | MessageType.Error); + + // Free resources + pipeline.SetState (State.Null); + + } + + public static void StopAudio() + { + + } + } +} \ No newline at end of file -- cgit v1.2.3