Enhanced Timestamp Formatting and Custom Interval Grouping #50
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In this PR, I'm rolling out two significant updates to our timestamp handling:
Automatic Timestamp Formats: I've introduced an
auto
timestamp format option, which is now the default setting. With this option selected, there's no need for manual selection betweenHH:mm:ss
,mm:ss
, orss
. The format adapts automatically: if the maximum segment timestamp exceeds 60 minutes, it displays inHH:mm:ss
; for durations below 60 minutes, it switches tomm:ss
. I chose not to switch toss
automatically because, from my perspective, it can seem unusual and be somewhat confusing. The option is still there for those that want it though.Custom Timestamp Intervals for Issue 45: Tackling issue Time-Stamp intervals are too short #45, I've implemented the ability to group segments by custom timestamp intervals, though this feature is initially turned off. This method intelligently calculates the start and end times for these groups. For instance, if you're working with a 15-second interval, but the actual speech is only from 00:04 to 00:13, the timestamp will smartly be shown as
00:04 - 00:13
for that group. However, it's important to highlight that the following group will proceed to consider the 00:15 to 00:30 interval, irrespective of the precise end time of the last segment from the preceding group. This feature is compatible with segments from both Whisper ASR and Swiftink, but it shines with word-level timestamps from Whisper ASR. This is because with smaller segments, there's a significantly lower chance of them crossing into another interval, making the grouping more precise and true to the spoken content.In summary, these updates introduce a new 'Timestamp Interval' setting and involve a rewrite of the
segmentsToTimestampedString()
function. These changes enhance flexibility in timestamp formatting and segment grouping, offering users a more intuitive experience.