From 7b2951e64940cbc2c314185e3158199a1a73e3c4306dd6fa4f4bcc194aad80b4 Mon Sep 17 00:00:00 2001 From: copecone Date: Tue, 13 Oct 2026 11:30:42 +0900 Subject: [PATCH] Fix MP3 Header Read While Game Streams Song --- Util/Audio/Clip/MP3HeaderFrame.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Util/Audio/Clip/MP3HeaderFrame.cs b/Util/Audio/Clip/MP3HeaderFrame.cs index c74e03b..fe91fb8 100644 --- a/Util/Audio/Clip/MP3HeaderFrame.cs +++ b/Util/Audio/Clip/MP3HeaderFrame.cs @@ -31,7 +31,9 @@ internal static class MP3HeaderFrame /// public static int SilentFrames(string path) { - using var file = File.OpenRead(path); + // The game keeps the song open while it streams it (MP3Sharp.MP3Stream: new FileStream(path, FileMode.Open), + // read/write access with read sharing), so the file is opened with read/write/delete sharing. + using var file = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite | FileShare.Delete); return SilentFrames(file); }