Added AvaloniaUI project.
This commit is contained in:
@@ -86,6 +86,8 @@ public class BassAudioEngine : IAudioEngine, IDisposable
|
||||
|
||||
public BassAudioEngine()
|
||||
{
|
||||
BassLoader.Initialize();
|
||||
|
||||
_mediaPlayer = new MediaPlayer();
|
||||
_mediaPlayer.MediaLoaded += OnMediaLoaded;
|
||||
_mediaPlayer.MediaFailed += OnPlaybackStopped;
|
||||
|
||||
22
Harmonia.Core/Engine/BassLoader.cs
Normal file
22
Harmonia.Core/Engine/BassLoader.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Harmonia.Core.Engine;
|
||||
|
||||
public static class BassLoader
|
||||
{
|
||||
public static void Initialize()
|
||||
{
|
||||
string archFolder = Environment.Is64BitProcess ? "x64" : "x86";
|
||||
string bassPluginPath = Path.Combine("Plugins", "Bass", "Win32", archFolder);
|
||||
|
||||
LoadLibrary(bassPluginPath, "bass.dll");
|
||||
LoadLibrary(bassPluginPath, "bassflac.dll");
|
||||
}
|
||||
|
||||
private static void LoadLibrary(string bassPluginPath, string resourceName)
|
||||
{
|
||||
string resourcePath = Path.Combine(bassPluginPath, resourceName);
|
||||
|
||||
NativeLibrary.Load(resourcePath);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user