any reason why would that happen with ReadOnlySpan instead of Span?
any reason why would that happen with ReadOnlySpan instead of Span?

<ItemGroup>
<PackageReference Include="NAudio.Core" Version="2.2.1" />
<PackageReference Include="NAudio.Vorbis" Version="1.5.0" />
<PackageReference Include="NVorbis" Version="0.10.5" />
<PackageReference Include="Silk.NET.GLFW" Version="2.17.1" />
<PackageReference Include="Silk.NET.Input.Glfw" Version="2.17.1" />
<PackageReference Include="Silk.NET.OpenAL" Version="2.17.1" />
<PackageReference Include="Silk.NET.OpenAL.Extensions.Soft" Version="2.17.1" />
<PackageReference Include="Silk.NET.OpenAL.Soft.Native" Version="1.21.1.2" />
<PackageReference Include="Silk.NET.OpenGLES" Version="2.17.1" />
<PackageReference Include="Silk.NET.OpenGLES.ANGLE.Native" Version="2022.3.11" />
<PackageReference Include="Silk.NET.Windowing.Glfw" Version="2.17.1" />
<PackageReference Include="StbImageSharp" Version="2.27.13" />
</ItemGroup> 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);