Playing works when ran with mono debug

This commit is contained in:
watsonb8
2019-05-22 18:59:15 -04:00
parent a4276a0d5d
commit 5427d08dd7
11 changed files with 181 additions and 36 deletions

View File

@ -4,7 +4,6 @@ using System.Collections.ObjectModel;
using System.IO;
using Aurora.Backend.Models;
using Aurora.Backend.Utils;
using NAudio.Wave;
namespace Aurora.Backend.Services
{

View File

@ -0,0 +1,34 @@
using System;
using Aurora.Backend.Models;
using LibVLCSharp.Shared;
namespace Aurora.Backend.Services
{
public class PlayerService : BaseService<PlayerService>
{
public PlayerService()
{
}
public void Play(BaseSong song)
{
Core.Initialize();
using (var libVLC = new LibVLC())
{
song.Load();
var media = new Media(libVLC, song.DataStream);
using (var mp = new MediaPlayer(media))
{
media.Dispose();
mp.Play();
Console.ReadKey();
}
song.Unload();
}
}
}
}