blob: 76701935c7219006281fffebcdbe8ab45660e13f (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
using System;
using Gst;
namespace Sirop.Backend
{
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()
{
}
}
}
|