public override Sound CreateSound(ReadOnlySpan <byte> pcm, short channels, short sampleSize, int frequency) { var sound = new ALSound(); sound.Write(pcm, channels, sampleSize, frequency); return(sound); }
public override Sound LoadSound(Stream stream, AudioFormat format) { using var decoder = Decoder.Create(stream, format); var sound = new ALSound(); try { decoder.Load(sound.buffer); } catch { sound.Dispose(); throw; } return(sound); }