RTTM Syntax Extension
Universal syntax highlighting support for RTTM (Rich Transcription Time Marked) files in Visual Studio Code and compatible editors.

Example

;; Speaker diarization output for CMU_001
SPEAKER CMU_001 1 0.00 5.24 <NA> <NA> spk1 <NA> <NA>
SPEAKER CMU_001 1 5.30 3.10 <NA> <NA> spk2 <NA> <NA>
LEXEME CMU_001 1 0.10 0.40 hello lex spk1 0.97 <NA>
NON-LEX CMU_001 1 5.24 0.80 <NA> laugh spk2 <NA> <NA>
NON-SPEECH CMU_001 1 6.04 1.50 <NA> music <NA> <NA> <NA>
SU CMU_001 1 0.00 5.24 <NA> statement spk1 <NA> <NA>
NOSCORE CMU_001 1 0.00 0.20 <NA> <NA> <NA> <NA> <NA>
SPKR-INFO CMU_001 <NA> <NA> <NA> <NA> adult_male spk1 <NA> <NA>
;; End of file
About RTTM

RTTM (Rich Transcription Time Marked) is a standard text-based format developed by NIST for the Rich Transcription evaluation series. It is widely used in speaker diarization, automatic speech recognition (ASR), and audio annotation.
Each RTTM line is a space-delimited UTF-8 record with exactly 10 fields:
| # |
Field |
Spec name |
Description |
Example values |
| 1 |
Type |
type |
Event classification |
SPEAKER, LEXEME, NON-LEX |
| 2 |
File ID |
file |
Recording identifier (no extension) |
CMU_001 |
| 3 |
Channel |
chnl |
Audio channel (1-indexed) or <NA> |
1, 2, <NA> |
| 4 |
Start time |
tbeg |
Onset in seconds |
130.430, 1.5e2 |
| 5 |
Duration |
tdur |
Duration in seconds |
2.350 |
| 6 |
Orthography |
ortho |
Word, noise label, or <NA> |
hello, keyboard, <NA> |
| 7 |
Subtype |
stype |
Type-dependent subtype or <NA> |
adult_male, lex, noise |
| 8 |
Speaker ID |
name |
Speaker/object identifier or <NA> |
spk1, <NA> |
| 9 |
Confidence |
conf |
Confidence score (float) or <NA> |
0.97, <NA> |
| 10 |
Signal lookahead |
slat |
Legacy lookahead time or <NA> |
0.30, <NA> |
Unknown or inapplicable values use <NA> (uppercase, angle brackets required).
Event Types
Standard RTTM types (10)
Defined by the NIST Rich Transcription specification and supported by tree-sitter-rttm:
| Type |
Description |
stype values |
SPEAKER |
Speaker diarization segment |
— |
SPKR-INFO |
Speaker metadata |
adult_male, adult_female, child, unknown |
LEXEME |
Lexical item (word/token) |
lex, fp, frag, un-lex, for-lex, alpha, acronym, interjection, propernoun, other |
NON-LEX |
Non-lexical vocalization |
laugh, breath, lipsmack, cough, sneeze, other |
NON-SPEECH |
Environmental / non-speech sound |
noise, music, other |
SU |
Sentence unit |
statement, backchannel, question, incomplete, unannotated, other |
TURN |
Conversation turn boundary |
— |
SEGMENT |
Segmentation boundary |
eval, <NA> |
FU |
Functional unit (discourse) |
statement, question, backchannel, incomplete, other |
NOSCORE |
Scoring exclusion region |
— |
MDE extension types (6)
Additional types from the NIST Metadata Detection and Extraction (MDE) evaluations:
| Type |
Description |
stype values |
FILLER |
Filler / discourse marker |
filled_pause, discourse_marker, discourse_response, explicit_editing_term, other |
EDIT |
Disfluency / edit region |
repetition, restart, revision, simple, complex, other |
IP |
Interruption point |
edit, filler, edit&filler, other |
CB |
Clause boundary |
coordinating, clausal, other |
A/P |
Aside / parenthetical |
— |
NO_RT_METADATA |
No RT metadata available |
— |
All 16 types are fully highlighted and have snippet support.
Features
- Syntax highlighting for all 16 RTTM event types (10 standard + 6 MDE)
- Per-field highlighting: type, file ID, channel, timestamps, orthography, subtype, speaker, confidence, lookahead
<NA> null literals visually dimmed (comment scope)
- Inline
;; comments at end of data lines
- Full-line comments:
;; (canonical per NIST spec), #, ;
- Code snippets for every event type with subtype autocompletion
- Scientific notation support in numeric fields (
1.5e-3, 2E+4)
Compatibility
The extension is a pure declarative package (TextMate grammar, snippets, language configuration) with no runtime code. It works in any editor that supports the VS Code extension API:
Install the .vsix file manually (see below) or from the Marketplace where available.
Grammar alignment
This extension's TextMate grammar and highlighting semantics are aligned with:
Installation
From Marketplace
Install from the VS Code Marketplace or search for RTTM Syntax HL in the Extensions view (Ctrl+Shift+X).
From VSIX
- Download the latest
.vsix from Releases
- In VS Code:
Ctrl+Shift+P → Extensions: Install from VSIX... → select the file
Or via CLI:
code --install-extension rttm-syntax-hl-0.2.1.vsix
For VSCodium use codium, for Cursor use cursor, etc.
Building from source
Requires Node.js (v18+).
git clone https://codeberg.org/z3r/rttm-vscode.git
cd rttm-vscode
npx @vscode/vsce package
This produces rttm-syntax-hl-<version>.vsix in the project root.
License
MIT
| |