diff --git a/MuzikaGromche/Plugin.cs b/MuzikaGromche/Plugin.cs index 9a9d629..cf0056f 100644 --- a/MuzikaGromche/Plugin.cs +++ b/MuzikaGromche/Plugin.cs @@ -198,6 +198,8 @@ namespace MuzikaGromche // [2] Start source has finished : loop.time + FixedLoopDelay; + elapsed -= Config.AudioOffset.Value; + var normalized = Mod.Positive(elapsed / LoadedLoop.length, 1f); var beat = normalized * (float)Beats; @@ -346,10 +348,17 @@ namespace MuzikaGromche public class Config : SyncedConfig2 { + public static ConfigEntry AudioOffset { get; private set; } + public static bool ShouldSkipWindingPhase { get; private set; } = false; public Config(ConfigFile configFile) : base(PluginInfo.PLUGIN_GUID) { + AudioOffset = configFile.Bind("General", "Audio Offset", 0f, new ConfigDescription( + "Adjust audio offset (in seconds).\n\nIf you are playing with Bluetooth headphones and experiencing a visual desync, try setting this to about negative 0.2.\n\nIf your video output has high latency (like a long HDMI cable etc.), try positive values instead.", + new AcceptableValueRange(-0.5f, 0.5f))); + LethalConfigManager.AddConfigItem(new FloatSliderConfigItem(AudioOffset, requiresRestart: false)); + #if DEBUG SetupEntriesToSkipWinding(configFile); #endif