Skip to content

🎥 Make videos programmatically with React

avoid name conflict of `Caption` type in `@remotion/install-whisper-cpp`

Jonny Burger54c570718df6
diff --git a/packages/install-whisper-cpp/src/convert-to-captions.ts b/packages/install-whisper-cpp/src/convert-to-captions.ts
index d371423f07..c70aa811de 100644
--- a/packages/install-whisper-cpp/src/convert-to-captions.ts
+++ b/packages/install-whisper-cpp/src/convert-to-captions.ts
@@ -1,6 +1,6 @@
import type {TranscriptionJson} from './transcribe';
-export type Caption = {
+export type ConvertToCaptionCaption = {
text: string;
startInSeconds: number;
};
@@ -16,8 +16,8 @@ export function convertToCaptions({
}: {
transcription: TranscriptionJson<true>['transcription'];
combineTokensWithinMilliseconds: number;
-}): {captions: Caption[]} {
- const merged: Caption[] = [];
+}): {captions: ConvertToCaptionCaption[]} {
+ const merged: ConvertToCaptionCaption[] = [];
let currentText = '';
let currentFrom = 0;
let currentTo = 0;
diff --git a/packages/install-whisper-cpp/src/index.ts b/packages/install-whisper-cpp/src/index.ts
index 9cacf21fb0..78269c6d76 100644
--- a/packages/install-whisper-cpp/src/index.ts
+++ b/packages/install-whisper-cpp/src/index.ts
@@ -1,4 +1,7 @@
-export {Caption, convertToCaptions} from './convert-to-captions';
+export {
+ ConvertToCaptionCaption,
+ convertToCaptions,
+} from './convert-to-captions';
export type {OnProgress} from './download';
export {WhisperModel, downloadWhisperModel} from './download-whisper-model';
export {installWhisperCpp} from './install-whisper-cpp';