internal AudioFile(AudioFileType fileType, [NotNull] Stream stream) { // This constructor is for reading _readCallback = ReadCallback; _getSizeCallback = GetSizeCallback; _stream = stream; _endOfData = stream.Length; SafeNativeMethods.AudioFileOpenWithCallbacks(IntPtr.Zero, _readCallback, null, _getSizeCallback, null, fileType, out var handle); Handle = handle; }