Precision chime timing and BBC pips support - #71
Conversation
|
@heath-toby have you tested this? |
|
@heath-toby I am waiting for your answer. Your pull request will block version of this addon for 2026.1 Thanks! |
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>
fbf7ac6 to
fb69d62
Compare
|
Apologies for the very late reply, @zstanecic — I missed these notifications. Yes, this has been tested: I've been running it daily on NVDA 2026.1. Chimes finish exactly on the :00 boundary with speech immediately after, the BBC pips' sixth pip lands on the minute, and sound-only/speech-only modes behave as described. I've now rebased the branch onto current master and resolved the conflicts, so it should merge cleanly. Happy to make any changes you'd like. |
|
Gentle bump on this one, @zstanecic / @hkatic — no rush, just flagging that it's ready whenever you have time. The branch is rebased onto current master and GitHub reports it as mergeable, so there's nothing outstanding from my side. Two notes in case the red cross is putting you off looking:
Happy to rebase again, split the change up, or adjust anything you'd like changed. |
|
Tested and merged. Thanks for your contribution, @heath-toby |
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