Skip to content
HALOWERK

Tonwerk

caption drift fix

Decodes the audio track (16 kHz mono), detects speech with Silero VAD v6.2 (MIT, pinned SHA-256) or an energy detector, and rasterises speech and caption display times on a 20 ms grid. The constant offset is the shift within ±max_offset_s that maximises the agreement (Dice coefficient 2·|captions∩speech| / (|captions| + |speech|)); overlap is the share of caption time that has speech. With fix_drift, the cues are split into a first and a second half, each half is aligned separately (±2 s.

POST https://ton.halowerk.com/v1/caption-drift-fix

Inputs

Fields of the published input schema
FieldTypeRequiredDescription
media_base64stringNoThe audio or video file as base64 (MP4/MOV, WebM/MKV, AVI, MPEG-TS, MPEG-PS, FLV, Ogg or animated GIF; at most 10 MiB decoded; a data: URL prefix is accepted).
media_urlstringNoPublic http(s) URL of the the audio or video file (at most 10 MiB; private, local and reserved addresses are refused).
captionsstringYesCaptions or subtitles as SRT or WebVTT text.
captions_formatstringNoFormat of captions; auto detects WEBVTT headers, otherwise SRT.
max_offset_snumberNoLargest constant offset searched, in both directions.
detectorstringNoSpeech detection: silero (Silero VAD v6.2 neural voice activity detector, robust to music and noise) or energy (frame level above the noise floor; for clean recordings).
fix_driftbooleanNoAlso detect and correct a linear drift (frame-rate mismatch).
output_formatstringNoFormat of the corrected captions.
Show full input schema
{
  "type": "object",
  "additionalProperties": false,
  "required": [
    "captions"
  ],
  "properties": {
    "media_base64": {
      "type": "string",
      "minLength": 16,
      "maxLength": 14000000,
      "description": "The audio or video file as base64 (MP4/MOV, WebM/MKV, AVI, MPEG-TS, MPEG-PS, FLV, Ogg or animated GIF; at most 10 MiB decoded; a data: URL prefix is accepted)."
    },
    "media_url": {
      "type": "string",
      "format": "uri",
      "pattern": "^https?://",
      "maxLength": 2048,
      "description": "Public http(s) URL of the the audio or video file (at most 10 MiB; private, local and reserved addresses are refused)."
    },
    "captions": {
      "type": "string",
      "minLength": 10,
      "maxLength": 400000,
      "description": "Captions or subtitles as SRT or WebVTT text."
    },
    "captions_format": {
      "type": "string",
      "enum": [
        "auto",
        "srt",
        "vtt"
      ],
      "default": "auto",
      "description": "Format of captions; auto detects WEBVTT headers, otherwise SRT."
    },
    "max_offset_s": {
      "type": "number",
      "minimum": 0.5,
      "maximum": 30,
      "default": 10,
      "description": "Largest constant offset searched, in both directions."
    },
    "detector": {
      "type": "string",
      "enum": [
        "silero",
        "energy"
      ],
      "default": "silero",
      "description": "Speech detection: silero (Silero VAD v6.2 neural voice activity detector, robust to music and noise) or energy (frame level above the noise floor; for clean recordings)."
    },
    "fix_drift": {
      "type": "boolean",
      "default": true,
      "description": "Also detect and correct a linear drift (frame-rate mismatch)."
    },
    "output_format": {
      "type": "string",
      "enum": [
        "same",
        "srt",
        "vtt"
      ],
      "default": "same",
      "description": "Format of the corrected captions."
    }
  }
}

Open original schema

Published input example

{
  "media_base64": "T2dnUwACAAAAAAAAAAAAAAAAAAAAAGS5xGoBE09wdXNIZWFkAQE4AUAfAAAAAABPZ2dTAAAAAAAAAAAAAAAAAAABAAAASZW+VAEuT3B1c1RhZ3MGAAAAZmZtcGVnAQAAABQAAABlbmNvZGVyPUxhdmMgbGlib3B1c09nZ1MAAEC/AAAAAAAAAAAAAAIAAABGKji+EQ8ODg4OIh0bIjUzLiowJyUnGAL5jsjhz5S+lx76gm6wGAIrLMOM2AvXBba9ENIYAissw4zYC9cFtr0Q0hgCKyzDjNgL1wW2vRDSGAIrLMOM2AvXBba9ENIY4YWmE5syCqkfnK9PEW1FsIQwzCLP/D3y60s9bpSnvbDAGIG94nLuSIatRG2nzYZsUNxYrYZXM4iJeeUYfVAYCF4pRGs7gHqQMFihU1yFOBhbyf0A2Ths+wQYJ5aEjbhefYXs3o7sEGIMq+g3LIqPLQgegfM+MXm3RCkQGOe8kGHVUrRQvAiLUwLd5sCQ9elPFvZEEkacgIzh8gIywdTumn/XAHZmqyXGrfx5AumiMUAY7ps2W1JX3JoCe0ubaskZM+LNdHHxo3gjVFss/k12szu0ZKFSm7eze3DFswlJbamSXnAY6m3CkGH8lJjtcwfcddAom8Zkuq8Wmg4aBj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eEcLtYzCqRBqrB9cUKAK2ZXMv+KI3wh3Z5FvU0rRjN5Q/tyiLcH6D2XhjMVQQUaFOpMlIwwN/X6rXp3i1PYVQWUBRSGhGB97QV+9sof7wY5kBoZa76APWXU6rJ8oZNc+gzcYm0invGqnmTUFnTKHUfZFn9as4PTNgY4RJjZfDDCd/EvuhOmI6GibfzE/5+hWOO38toUYkX+IKQnc1QbPkX8uAY7nwA59dtBv83zQvtn/Auss3r1nvqBHNYgsqytTtocbu3KWA2dZk0T2dnUwAEmAgCAAAAAAAAAAAABAAAAJrKiSsNJjUjLyUrKy4lGx0cGhju/nfV9HdjVTLUu/7zgnLSQl88GKp8kfjWdTSWXLwCqYCuFP+gGO3b6WDgyqVseuKQmD5LUujzYfoV4IL4HXu7lANKar4GmKFHV4cIF6mbNgaHuyqAiivQBsAY6G/2o+jxbNvXrqxg8mAJLxtfXR/R1A6PtVg6bPGkVdHrgBjuBrWBeIwtYbiTxeZBWTH4Ud/gjeTcf+ZU0gBs0uB5n++NVPIzujmR8NrEcRukGO8eKpoAtXEhHIiI6Rafg2MJhNLpuBJGyyBITC+73jIrXg2vgBjvGn1EnQn02Zumhz7D8HfYJEEh1Rg6AUKTzylzzt7JjTYzEeVHS+O3VhgY7N2bme4UR/A9VcWWe5q7XxP+hx0psmuhtZ7nKjPE+NfrEnE2ZEVPX+y8GOszCnFAVIW6OaRQWlbChs52pE+sj6WV2oAcLyF+NICh0JmjQGFeW82f5unAYBjJNw93KVyMnh5wwB46uWdZ4hq724G28VZesmgzVVO7fdQOccYYDGKeydVhqXbB31RHZ+r0xLdFyyPuCtBgvqYYAV/t8ME28Dr4A0M/OG4LALCpHZDj65RfMnn1OBgIXHvUndjWtkYvMyGQCVw13ClcYhYqEGr/PqAYBUJiQm7xmSfVj57G3csL99j0F0PNE6kfYA==",
  "captions": "1\n00:00:01,300 --> 00:00:03,300\nGood morning and welcome to the program.\n",
  "max_offset_s": 3
}

Result & documentation

Machine-readable documentation of this hub

Source of this page: the published HALOWERK catalog. Updated: 2026-11-17 UTC.

More endpoints in this hub

All endpoints in this hub →