Precision chime timing and BBC pips support#71
Open
heath-toby wants to merge 1 commit intohkatic:masterfrom
Open
Precision chime timing and BBC pips support#71heath-toby wants to merge 1 commit intohkatic:masterfrom
heath-toby wants to merge 1 commit intohkatic:masterfrom
Conversation
Chime sounds now start playing before the minute boundary so they finish exactly at :00, with speech announcing the live current time immediately after. Previously both sound and speech fired at :00, causing the spoken time to lag by the chime duration. BBC pips (clock_cuckoo7.wav) receives special handling: the five short pips lead into a sixth long pip timed to land precisely on the minute boundary, replicating a broadcast time signal. Speech fires with the sixth pip. Sound-only mode: BBC pips keeps its precision timing; all other chimes play at :00. Speech-only mode is unchanged. Also adds safeGetTimeFormatEx/safeGetDateFormatEx wrappers in formats.py for NVDA 2024.2+ ctypes compatibility (None no longer accepted for DWORD arguments). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Collaborator
|
@heath-toby have you tested this? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
When auto-announce is set to "Speech and sound", chime sounds previously started playing at the minute boundary (:00), meaning the spoken time didn't arrive until several seconds later. This PR makes chimes start early so they finish at :00, with speech announcing the live current time immediately after — just like a broadcast time signal.
What changed
Clockclass now calculates each chime's WAV duration and begins playback that many seconds before the minute boundary. Speech is deferred viawx.CallLaterand readsdatetime.now()at the moment it fires, so the announced time is always the true current time.safeGetTimeFormatExandsafeGetDateFormatExwrappers that normaliseNone→0for theflagsparameter, since newer ctypes no longer acceptsNonefor DWORD arguments. Date display format building is also wrapped to prevent import-time crashes from locale or API changes.How it works
Files changed
addon/globalPlugins/clock/clockHandler.py— precision timing logic, BBC pips handling, live time announcementaddon/globalPlugins/clock/formats.py— safe wrappers for NVDA 2024.2+ ctypes compatibilityreadme.md— documented precision timing behaviour in the configuration sectionchangelog.md— added entry for this releaseTest plan
🤖 Generated with Claude Code