2
0
mirror of https://github.com/9ParsonsB/Pulsar.git synced 2025-12-16 04:44:56 +01:00

ready for testing

This commit is contained in:
Xjph
2024-01-21 13:35:03 -03:30
parent d99a190869
commit 97e981bae2
92 changed files with 3061 additions and 1186 deletions

View File

@@ -0,0 +1,30 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NAudio.Wave;
namespace Observatory.Utils
{
internal static class AudioHandler
{
internal static async Task PlayFile(string filePath)
{
await Task.Run(() =>
{
using (var file = new AudioFileReader(filePath))
using (var output = new WaveOutEvent())
{
output.Init(file);
output.Play();
while (output.PlaybackState == PlaybackState.Playing)
{
Thread.Sleep(250);
}
};
});
}
}
}