MCPcopy
hub / github.com/chidiwilliams/buzz / to_timestamp

Function to_timestamp

buzz/transcriber/file_transcriber.py:229–236  ·  view source on GitHub ↗
(ms: float, ms_separator=".")

Source from the content-addressed store, hash-verified

227
228
229def to_timestamp(ms: float, ms_separator=".") -> str:
230 hr = int(ms / (1000 * 60 * 60))
231 ms -= hr * (1000 * 60 * 60)
232 min = int(ms / (1000 * 60))
233 ms -= min * (1000 * 60)
234 sec = int(ms / 1000)
235 ms = int(ms - sec * 1000)
236 return f"{hr:02d}:{min:02d}:{sec:02d}{ms_separator}{ms:03d}"
237
238# To detect when transcription source is a video
239VIDEO_EXTENSIONS = {".mp4", ".mov", ".mkv", ".avi", ".m4v", ".webm", ".ogm", ".wmv"}

Callers 7

set_millisecondsMethod · 0.90
keyPressEventMethod · 0.90
focusOutEventMethod · 0.90
displayTextMethod · 0.90
displayTextMethod · 0.90
test_to_timestampMethod · 0.90
write_outputFunction · 0.85

Calls

no outgoing calls

Tested by 1

test_to_timestampMethod · 0.72