From 008ee3dcd810fce0e7509620b29c714a1ccd7ce7 Mon Sep 17 00:00:00 2001 From: Anthony Truskinger Date: Wed, 16 Aug 2023 09:14:22 +1000 Subject: [PATCH] Fixes bug in event converter Was causing KoalaMale to fail --- src/AnalysisPrograms/AnalysisPrograms.csproj | 2 +- src/AudioAnalysisTools/Events/EventConverters.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/AnalysisPrograms/AnalysisPrograms.csproj b/src/AnalysisPrograms/AnalysisPrograms.csproj index 227ffabe8..6e2c96c2e 100644 --- a/src/AnalysisPrograms/AnalysisPrograms.csproj +++ b/src/AnalysisPrograms/AnalysisPrograms.csproj @@ -24,7 +24,7 @@ - + diff --git a/src/AudioAnalysisTools/Events/EventConverters.cs b/src/AudioAnalysisTools/Events/EventConverters.cs index 679af248b..414ecfeda 100644 --- a/src/AudioAnalysisTools/Events/EventConverters.cs +++ b/src/AudioAnalysisTools/Events/EventConverters.cs @@ -28,7 +28,7 @@ public static SpectralEvent ConvertAcousticEventToSpectralEvent(this AcousticEve public static AcousticEvent ConvertSpectralEventToAcousticEvent(this SpectralEvent se) { var segmentStartOffset = TimeSpan.FromSeconds(se.SegmentStartSeconds); - double startTime = se.EventStartSeconds; + double startTime = se.EventStartSeconds - segmentStartOffset.TotalSeconds; double duration = se.EventDurationSeconds; double minHz = se.HighFrequencyHertz; double maxHz = se.HighFrequencyHertz;