transcribe
Convert an asset's speech to text on-device with Whisper, saving the result in the OpenScreen project for captions, text lookup, and word edits.
Instructions
Transcribe one asset's speech with OpenScreen's on-device Whisper, as the editor does when it opens a project, and store the transcript in the project: getTranscript, getTranscriptWords, setWordText, removeWords and the captions all read it. A take from stopRecording has none until this runs. Without language, an asset that already has a transcript keeps it, and a transcription the editor is already running is waited for rather than run twice; with language, the asset is transcribed again in it (a run of the editor already in that language is waited for instead), and the word corrections that still match are carried over. The project's vocabulary (setVocabulary) primes Whisper. It runs on this computer and can take minutes on a long recording, more the first time, when the speech model downloads. Media with no audio fails with failure.kind no-audio, which the asset then remembers (assets[].transcriptionFailure in getCurrentDocument). The result gives the language and the word count; it needs no checkpoint, and restoreCheckpoint keeps a transcript made after its checkpoint.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| assetId | No | The asset to transcribe, from getCurrentDocument. Default: the primary asset. | |
| language | No | Transcribe again in this language (ISO 639-1, such as "en" or "fr"), or "auto" to let Whisper detect it. Omit it to keep a transcript the asset already has. | |
| projectId | No | The project to act on, from listProjects. Omit it only for the project open in the OpenScreen editor, which works only while the app runs. |