Transcript Player
transcript-playerA recording and its transcript as one surface: the line and word being spoken are marked as it plays, and a click on any line or word seeks there. Takes WhisperX output as it comes.
"use client";
import { fromWhisper, TranscriptPlayer } from "@/components/forme/blocks/transcript-player/transcript-player";
import type { WhisperSegment } from "@/components/forme/blocks/transcript-player/transcript-player";
// Harvard sentences from the Open Speech Repository, transcribed and aligned
// by WhisperX. Each word is [word, start, end]; the shape is unpacked below
// into exactly what the model returns.
const raw: [number, number, string, [string, number, number][]][] = [
[
2.699,
4.74,
" The little tales they tell are false.",
[
["The", 2.699, 2.799],
["little", 2.839, 3.079],
["tales", 3.139, 3.539],
["they", 3.599, 3.76],
["tell", 3.8, 4.08],
["are", 4.22, 4.32],
["false.", 4.4, 4.74],
],
],
[
6.781,
9.422,
"The door was barred, locked and bolted as well.",
[
["The", 6.781, 6.881],
["door", 6.921, 7.201],
["was", 7.241, 7.381],
["barred,", 7.441, 7.821],
["locked", 8.161, 8.421],
["and", 8.562, 8.662],
["bolted", 8.722, 9.042],
["as", 9.102, 9.162],
["well.", 9.222, 9.422],
],
],
[
11.123,
13.083,
"Ripe pears are fit for a queen's table.",
[
["Ripe", 11.123, 11.363],
["pears", 11.463, 11.863],
["are", 11.923, 12.003],
["fit", 12.043, 12.203],
["for", 12.243, 12.343],
["a", 12.383, 12.403],
["queen's", 12.443, 12.743],
["table.", 12.783, 13.083],
],
],
[
15.244,
17.265,
"A big wet stain was on the round carpet.",
[
["A", 15.244, 15.304],
["big", 15.344, 15.545],
["wet", 15.585, 15.805],
["stain", 15.845, 16.165],
["was", 16.205, 16.325],
["on", 16.365, 16.445],
["the", 16.465, 16.545],
["round", 16.585, 16.825],
["carpet.", 16.885, 17.265],
],
],
[
19.546,
21.787,
"The kite dipped and swayed but stayed aloft.",
[
["The", 19.546, 19.626],
["kite", 19.666, 19.946],
["dipped", 20.026, 20.267],
["and", 20.327, 20.407],
["swayed", 20.467, 20.847],
["but", 20.947, 21.067],
["stayed", 21.127, 21.407],
["aloft.", 21.447, 21.787],
],
],
[
23.988,
26.289,
"The pleasant hours fly by much too soon.",
[
["The", 23.988, 24.088],
["pleasant", 24.108, 24.448],
["hours", 24.468, 24.808],
["fly", 24.888, 25.149],
["by", 25.209, 25.449],
["much", 25.549, 25.769],
["too", 25.829, 25.969],
["soon.", 26.009, 26.289],
],
],
[
28.85,
30.791,
"The room was crowded with a mild wob.",
[
["The", 28.85, 28.95],
["room", 28.99, 29.23],
["was", 29.29, 29.39],
["crowded", 29.45, 29.831],
["with", 29.891, 30.031],
["a", 30.051, 30.091],
["mild", 30.131, 30.471],
["wob.", 30.531, 30.791],
],
],
[
33.062,
35.064,
" The room was crowded with a wild mob.",
[
["The", 33.062, 33.162],
["room", 33.202, 33.442],
["was", 33.502, 33.603],
["crowded", 33.663, 34.063],
["with", 34.123, 34.263],
["a", 34.303, 34.343],
["wild", 34.403, 34.744],
["mob.", 34.824, 35.064],
],
],
[
37.226,
39.288,
"This strong arm shall shield your honour.",
[
["This", 37.226, 37.366],
["strong", 37.426, 37.747],
["arm", 37.947, 38.147],
["shall", 38.207, 38.407],
["shield", 38.487, 38.808],
["your", 38.828, 38.988],
["honour.", 39.048, 39.288],
],
],
[
41.891,
43.953,
"She blushed when he gave her a white orchid.",
[
["She", 41.891, 41.991],
["blushed", 42.031, 42.371],
["when", 42.491, 42.631],
["he", 42.671, 42.751],
["gave", 42.791, 42.992],
["her", 43.052, 43.212],
["a", 43.272, 43.292],
["white", 43.352, 43.552],
["orchid.", 43.652, 43.953],
],
],
[
46.355,
48.457,
"The beetle droned in the hot June sun.",
[
["The", 46.355, 46.455],
["beetle", 46.495, 46.835],
["droned", 46.895, 47.296],
["in", 47.356, 47.436],
["the", 47.456, 47.536],
["hot", 47.576, 47.756],
["June", 47.876, 48.217],
["sun.", 48.257, 48.457],
],
],
];
const whisperx: WhisperSegment[] = raw.map(([start, end, text, words]) => ({
start,
end,
text,
words: words.map(([word, from, to]) => ({ word, start: from, end: to })),
}));
const segments = fromWhisper(whisperx);
export function TranscriptPlayerDemo() {
return (
<TranscriptPlayer
src="/audio/harvard-sentences.wav"
title="Harvard sentences, list 50"
meta="English · 11 segments · WhisperX"
segments={segments}
className="max-w-2xl"
/>
);
}Install
Adds the component, its registry dependencies, and the token stylesheet you import once.
API reference
Read from the source, so it is the API of the file you install. A prop marked * is required.
TranscriptPlayer
A recording and its transcript as one surface. The player is the clock: it reports the time, the transcript marks the line and word being spoken, and a click on any line or word seeks the player there and plays. The skip buttons step line by line, and the waveform is marked where each begins.
| Prop | Type | Default | Description |
|---|---|---|---|
src* | string | Blob | — | |
segments* | readonly TranscriptSegment[] | — | |
title* | ReactNode | — | |
meta | ReactNode | — | A line under the title: the language, who was recorded, when. |
className | string | — |
Related


App Shell
The frame of an app: a sidebar of sections and nav items, a header bar, a page header and a scrolling content column. On narrow screens the sidebar becomes a sheet in a native modal dialog.
application

Infinite Masonry
An endless photo feed in balanced columns. Tiles reserve their space from the image size, so nothing shifts as pages arrive; the next page loads as the shortest column nears view; and it is an ARIA feed with Page Down between items. No virtualiser, no dependencies.
application
ProKanban Board
A project board with pointer drag and drop, a full keyboard path, status or assignee swimlanes, live WIP limits, inline card capture, and a detail drawer for descriptions and checklists.
application