this was running in Windows Subsystem for Android
this was running in Windows Subsystem for Android
Error : Could not load from any of the possible library names! Please make sure that the library is installed and in the right place!
Key enum is modelled on a QWERTY English keyboard and will be the same on every keyboard regardless of layoutKeyChar event is localised, but is intended for text inputfixed or the ref overlosds


KeyKeyCharfixedrefWebGPU = WebGPU.GetApi(); public unsafe void BufferData<T0>([Flow(Silk.NET.Core.Native.FlowDirection.In)] GLEnum target, [Count(Parameter = "size"), Flow(Silk.NET.Core.Native.FlowDirection.In)] ReadOnlySpan<T0> data, [Flow(Silk.NET.Core.Native.FlowDirection.In)] GLEnum usage) where T0 : unmanaged
{
// ImplicitCountSpanOverloader
BufferData(target, (nuint) ((data.Length) * Unsafe.SizeOf<T0>()), in data.GetPinnableReference(), usage);
}using NAudio.Vorbis;
using NAudio.Wave;
using Silk.NET.OpenAL;
namespace PocketEngine.Core.Managers;
public static unsafe class AudioManager {
internal static AL AL = null!;
internal static ALContext Context = null!;
private static VorbisWaveReader? _reader;
private static Device* _device;
private static Context* _context;
private static uint _buffer;
private static uint _source;
internal static void Initialize() {
AL = AL.GetApi();
Context = ALContext.GetApi();
_device = Context.OpenDevice("");
_context = Context.CreateContext(_device, null);
Context.MakeContextCurrent(_context);
}
internal static void Deinitialize() {
CleanUp();
Context.DestroyContext(_context);
Context.CloseDevice(_device);
}
public static void Play(string path) {
CleanUp();
AL.GetError();
_source = AL.GenSource();
_buffer = AL.GenBuffer();
_reader = new VorbisWaveReader(path);
var provider = _reader.ToStereo().ToWaveProvider16();
var buffer = new byte[_reader.Length];
provider.Read(buffer, 0, buffer.Length);
AL.BufferData(_buffer, BufferFormat.Stereo16, buffer, provider.WaveFormat.SampleRate);
AL.SetSourceProperty(_source, SourceBoolean.Looping, false);
AL.SetSourceProperty(_source, SourceInteger.Buffer, _buffer);
AL.SourcePlay(_source);
AL.SetSourceProperty(_source, SourceFloat.Gain, 0.02f);
}
public static void Stop() {
AL.SourceStop(_source);
}
public static void Update(double delta) {
}
private static void CleanUp() {
if (_reader == null) {
return;
}
AL.DeleteBuffer(_buffer);
AL.DeleteSource(_source);
_reader.Dispose();
}
}AL = AL.GetApi();
Context = ALContext.GetApi();AL = AL.GetApi(true);
Context = ALContext.GetApi(true);