diff options
| author | Maze Winther <mazewinther@gmail.com> | 2026-03-25 16:47:22 +0100 |
|---|---|---|
| committer | Maze Winther <mazewinther@gmail.com> | 2026-03-29 15:48:22 +0200 |
| commit | 8db3bead13441a5882d8689dfc6a9f09c82375d9 (patch) | |
| tree | e9d0cafa93904ffcbec3188c37961bcc16c6422d /apps/web/src/lib/transcription | |
| parent | 39ea298a9ccba3104c549c0ca079c231981811f5 (diff) | |
| download | opencut-8db3bead13441a5882d8689dfc6a9f09c82375d9.tar.gz | |
feat: masks, properties refactor, shaders, storage migrations, and more
Diffstat (limited to 'apps/web/src/lib/transcription')
| -rw-r--r-- | apps/web/src/lib/transcription/caption.ts | 2 | ||||
| -rw-r--r-- | apps/web/src/lib/transcription/types.ts | 47 |
2 files changed, 48 insertions, 1 deletions
diff --git a/apps/web/src/lib/transcription/caption.ts b/apps/web/src/lib/transcription/caption.ts index c773b7b0..c7c1b7b4 100644 --- a/apps/web/src/lib/transcription/caption.ts +++ b/apps/web/src/lib/transcription/caption.ts @@ -1,4 +1,4 @@ -import type { TranscriptionSegment, CaptionChunk } from "@/types/transcription"; +import type { TranscriptionSegment, CaptionChunk } from "@/lib/transcription/types"; import { DEFAULT_WORDS_PER_CAPTION, MIN_CAPTION_DURATION_SECONDS, diff --git a/apps/web/src/lib/transcription/types.ts b/apps/web/src/lib/transcription/types.ts new file mode 100644 index 00000000..9724ad70 --- /dev/null +++ b/apps/web/src/lib/transcription/types.ts @@ -0,0 +1,47 @@ +import type { LanguageCode } from "@/constants/language-constants"; + +export type TranscriptionLanguage = LanguageCode | "auto"; + +export interface TranscriptionSegment { + text: string; + start: number; + end: number; +} + +export interface TranscriptionResult { + text: string; + segments: TranscriptionSegment[]; + language: string; +} + +export type TranscriptionStatus = + | "idle" + | "loading-model" + | "transcribing" + | "complete" + | "error"; + +export interface TranscriptionProgress { + status: TranscriptionStatus; + progress: number; + message?: string; +} + +export type TranscriptionModelId = + | "whisper-tiny" + | "whisper-small" + | "whisper-medium" + | "whisper-large-v3-turbo"; + +export interface TranscriptionModel { + id: TranscriptionModelId; + name: string; + huggingFaceId: string; + description: string; +} + +export interface CaptionChunk { + text: string; + startTime: number; + duration: number; +} |
