How to display a transcript in sync with a media file?
March 19, 2009 4:54 PM
Subscribe
I have a transcript with timestamps and a media file. How do I display both of them on a webpage at the same time, synchronized? Oh, and it has to work in any browser or OS.
I have a transcript (foo.txt) composed of 1000 sentences. Each sentence is given its own line, and some sentences have accompanying comment lines as well. The sentence lines are formatted as "Speaker|Sentence sentence sentence.|timestamp", and the comments lines are formatted as "comment|Comment comment comment". An example could be:
*MOT|which way we're gonna go ?|01234_02234
%com|Mother is gesturing toward train set.
*CHI|backwards .|02234_02934
With this transcript is a media file (audio or video, the solution should be able to handle both). The timestamps correspond to points in the media file (in milliseconds).
I want to display the entire transcript alongside the media file, and when playing the media file, have the corresponding lines in the transcript be highlighted (1). The transcript should also automatically scroll so that the media is always in view. Finally, users should be able to begin playback either by going to a particular point in the transcript and hitting play (or some keyboard shortcut), or a particular point in the media and hitting play (or some keyboard shortcut).
An important caveat is that this must work in older browsers and both Windows/OS X (Linux support is unnecessary/probably follows from Windows/OS X support). All my research has come up with solutions using HTML5, which obviously won't work in older browsers. Staying away from Flash is also preferable, but not mandatory.
My guess is that there's some Ajax that can grab the time in the media and compare that to the timestamp for each line, and then highlight that particular line (either by encapsulating each line with a tag, or some fancy XML or JSON parsing). I don't know! Help me, hive!
(1) Particularly, I'm not looking for closed-captioning (a la Quicktime and SMIL). The transcript should be separate from the media file, and should itself be navigable.
posted by isnotchicago to computers & internet (6 comments total)
posted by adipocere at 5:17 PM on March 19