Start with a completed transcription receipt
A warehouse training recording is split at exactly one minute. In the second file, the instructor says “Use shelf A & B.” at 250 milliseconds. That timestamp is correct when you play the clip by itself. In the full recording, the caption belongs at 00:01:00.250. To put it there, keep the cut point from the edit alongside the sentence timings from the transcript.
Submit the recording to POST /v1/audio/transcription-tasks using the Hy ASR 3.0 Preview example on SmarToken. Check the task at GET /v1/audio/transcription-tasks/{id} using the same API credential. When status is succeeded, result.durationMs gives the duration of the submitted audio. Each entry in result.sentences has beginMs, endMs and text. These are sentence-level cues. WAND ASR V1 uses the same result fields on SmarToken.
Try the two fictional receipts below before working with a long recording. Save the first as part1.json and the second as part2.json. The fixtures contain only the fields the exporter reads. You can pass a complete successful task response to the same script.
{"status":"succeeded","result":{"durationMs":60000,"sentences":[{"beginMs":58200,"endMs":59400,"text":"Mark the blue crate."}]}}{"status":"succeeded","result":{"durationMs":4000,"sentences":[{"beginMs":250,"endMs":1810,"text":"Use shelf A & B."}]}}Real receipt: on December 1, 2026, we transcribed approximately 3.645 seconds of synthetic English speech with hy-asr-3.0-preview on SmarToken. The playground displayed the text; we retrieved the sentence timing from the same task response. The excerpt below retains only fields needed by the exporter. One receipt does not establish timestamp accuracy across recordings.
{
"status": "succeeded",
"result": {
"durationMs": 3644,
"sentences": [
{
"beginMs": 0,
"endMs": 3644,
"text": "Welcome to the workshop. Please check the subtitles before publishing."
}
]
}
}Add the clip offset before formatting the timestamp
Save the following Python 3 script as captions.py beside the receipts. Run python3 captions.py 0=part1.json 60000=part2.json > captions.vtt. The number before each equals sign is the clip's start on the original timeline, in milliseconds. For one continuous recording, pass a single file with an offset of zero. Use the actual clip start on the master timeline, not the preceding subtitle’s end: silence may separate them.
import html
import json
import sys
from pathlib import Path
def timestamp(ms):
seconds, fraction = divmod(ms, 1000)
minutes, seconds = divmod(seconds, 60)
hours, minutes = divmod(minutes, 60)
return f"{hours:02}:{minutes:02}:{seconds:02}.{fraction:03}"
if len(sys.argv) < 2:
sys.exit("Usage: python3 captions.py 0=part1.json 60000=part2.json")
cues = []
for argument in sys.argv[1:]:
offset_text, filename = argument.split("=", 1)
offset = int(offset_text)
task = json.loads(Path(filename).read_text(encoding="utf-8"))
if offset < 0 or task["status"] != "succeeded":
sys.exit(f"Check offset or task status: {filename}")
result = task["result"]
for sentence in result["sentences"]:
begin, end = sentence["beginMs"], sentence["endMs"]
if not (0 <= begin < end <= result["durationMs"]):
sys.exit(f"Check sentence timing: {filename}")
start, finish = offset + begin, offset + end
text = " ".join(sentence["text"].split())
if text:
cues.append((start, finish, text, filename))
if not cues:
sys.exit("No timed speech to export")
cues.sort(key=lambda cue: cue[0])
previous_end = -1
output = []
for start, finish, text, filename in cues:
if start < previous_end:
print(f"Review overlapping cue: {filename} at {timestamp(start)}", file=sys.stderr)
previous_end = max(previous_end, finish)
timing = f"{timestamp(start)} --> {timestamp(finish)}"
output.append(timing + "\n" + html.escape(text, quote=False))
print("WEBVTT\n\n" + "\n\n".join(output))The ampersand in the second sentence is written as & in the WebVTT file so the player displays a literal ampersand. The script checks cue bounds, skips blank text and sorts all cues by start time. If a transcript has only paragraphs and no timed sentences, align it against the audio before exporting captions. Dividing the runtime evenly among the words would put captions over pauses and miss changes in speaking speed.
If cues overlap, the script writes a warning to standard error, keeping it out of the VTT file; it does not delete a cue. WebVTT permits overlap. Listen to the source to decide whether it is duplicated transcription or genuine simultaneous speech. The two practice receipts are fictional; the real receipt is labeled separately. Neither measures ASR recognition error.
Boundary check: with fictional receipts, we tested a first clip containing a cue at 4.5 seconds and a second clip starting at 4 seconds. The script sorts the cues and then warns about the overlap; listen to the audio before removing anything. This checks merging logic, not ASR accuracy for speech crossing a cut.
Check the join at the one-minute mark
The second cue begins at 60000 + 250 milliseconds and ends at 60000 + 1810. We opened the exported WebVTT with FFprobe; it read the following start times and durations. The end times are shown alongside them so you can compare the output with the two input receipts.
| Caption | Start on master | End on master | Duration read by FFprobe |
|---|---|---|---|
| Mark the blue crate. | 00:00:58.200 | 00:00:59.400 | 1.200 seconds |
| Use shelf A & B. | 00:01:00.250 | 00:01:01.810 | 1.560 seconds |
Load the captions beside the master recording, seek to two seconds before the cut and listen across the join. If the second line appears near the beginning of the program, check whether the second offset was set to zero. If the error grows from cut to cut, inspect the actual source time of each edit. Removing silence or changing playback speed before transcription changes the relationship between the clip clock and the master.
Some editors keep half a second of overlap so a cut does not swallow a word. If clip two actually starts at 59500 milliseconds, pass 59500 and listen through the overlap to resolve any duplicate cue. Identical text may also represent a phrase the instructor really said twice. Use the recording to decide which occurrence to keep. The fixture checks conversion and file structure; listening to your source is the final alignment check.
This script creates a standalone WebVTT file. For segmented HLS playback, subtitle times also need to map to the media timestamps; the HLS specification recommends X-TIMESTAMP-MAP in the WebVTT header. Check the packaged stream in the target player as well as the standalone file.[5]
We placed that speech at 60 seconds in a test video and passed the real receipt to the script with a 60000 ms offset, producing the WebVTT below. A browser player visibly displayed the caption at about 00:01:00.888; the screenshot was retained, but the screenshot and audio are not available on this page. This checks offset and display for one synthetic clip, not the join between two real recordings or word-level timing accuracy.
WEBVTT
00:01:00.000 --> 00:01:03.644
Welcome to the workshop. Please check the subtitles before publishing.Merge two transcribed clips into WebVTT
On December 1, 2026, we transcribed two synthetic English clips separately with hy-asr-3.0-preview on SmarToken, submitted through /api/playground/transcriptions. The clips last about 3.645 and 2.787 seconds. The second begins at 4.000 seconds on the master timeline, leaving about 0.355 seconds of silence; the combined video lasts about 6.787 seconds. These real receipts retain only fields needed for caption export.
First receipt: part1.json
{
"status": "succeeded",
"result": {
"durationMs": 3644,
"sentences": [
{
"beginMs": 0,
"endMs": 3644,
"text": "Welcome to the workshop. Please check the subtitles before publishing."
}
]
}
}Second receipt: part2.json
{
"status": "succeeded",
"result": {
"durationMs": 2786,
"sentences": [
{
"beginMs": 0,
"endMs": 2786,
"text": "The workshop ends at five. Thank you for joining."
}
]
}
}Using captions.py from above, run python3 captions.py 0=part1.json 4000=part2.json > captions.vtt. Each offset is applied once. Actual output:
WEBVTT
00:00:00.000 --> 00:00:03.644
Welcome to the workshop. Please check the subtitles before publishing.
00:00:04.000 --> 00:00:06.786
The workshop ends at five. Thank you for joining.In the browser player, the first caption appeared at about 1.005 seconds, the gap had no active caption at 3.806 seconds, and the second appeared at 4.507 seconds. The player screenshot is shown below. Both clips are synthetic; we did not measure timing error against a human annotation. Hy ASR performance on real recordings and more cut points still needs separate testing.

Speech across a cut: a local check
We also checked the preceding 3.645-second synthetic clip locally using whisper.cpp 1.9.2 with tiny.en-q5_1, not Hy ASR. We tried cuts at 1.6 and 2.4 seconds: the 1.6-second split recognized the two sentences in full; the 2.4-second split produced the results below. Adding 0.3 seconds of overlap moves the second clip’s actual start to 2.1 seconds, so its offset is 2100 ms. The model checksum is in the source.[6]
| Input range | Recognizer output |
|---|---|
| 0–2.4 s | Welcome to the workshop. Please check the subtitle. |
| 2.4–3.645 s | titles before publishing. |
| 2.1–3.645 s (overlap) | subtitles before publishing. |
The overlapping second clip recovered “subtitles”, but the first still ended with the incomplete “subtitle”. Do not concatenate mechanically or deduplicate only identical text: listen to the source and resolve the overlap. This is one clip, two cut points and one local recognition setup; the source audio is linked in the next section and the result does not establish Hy ASR performance.
Hy ASR test across a cut
Additional Hy ASR test: on December 1, 2026, we split the same 3.645-second synthetic clip at 2.4 seconds and separately transcribed the first clip, the non-overlapping second clip and a second clip starting 0.3 seconds earlier. All three completed on SmarToken using hy-asr-3.0-preview. The table preserves the returned text; each input was tested once.
| Original audio range | Returned text | Receipt duration |
|---|---|---|
| 0–2.400 s | Welcome to the workshop. Please check the subtitle. | 2400 ms |
| 2.400–3.645 s | Titles before publishing. | 1244 ms |
| 2.100–3.645 s (overlap) | Subtitles before publishing. | 1544 ms |
Passing the first and non-overlapping second receipts to the script with offsets 0 and 2400 ms produces cues at 00:00:00.000–00:00:02.400 and 00:00:02.400–00:00:03.644; the word is split into “subtitle” and “Titles”. With the overlapping second clip, use offset 2100 ms: its cue is 00:00:02.100–00:00:03.644 and the script warns of overlap. The first cue is still incomplete, so listen to the original and edit rather than deleting mechanically. This small sample does not establish behavior for other recordings or cut points; the source audio and three clips are linked below.
Sources
- Hy ASR 3.0 Preview model and request example on SmarToken
- WAND ASR V1 on SmarToken
- W3C WebVTT caption specification
- FFprobe documentation
- HLS WebVTT timestamp mapping
- whisper.cpp models and checksums
- Player screenshot after merging two synthetic clips; timing error was not measured against human annotation.
- Full synthetic clip (WAV)
- First clip, 0–2.4 s (WAV)
- Second clip from 2.4 s (WAV)
- Overlapping second clip from 2.1 s (WAV)