Skip to content

🎥 Make videos programmatically with React

onTranscribedChunks -> onTranscriptionChunk

Igor Samokhovets69cd727aeda2
diff --git a/packages/docs/docs/whisper-wasm/transcribe.mdx b/packages/docs/docs/whisper-wasm/transcribe.mdx
index b415cadf37..9078d0511d 100644
--- a/packages/docs/docs/whisper-wasm/transcribe.mdx
+++ b/packages/docs/docs/whisper-wasm/transcribe.mdx
@@ -46,7 +46,7 @@ const onProgress = (progress: number) => {
};
```
-### `onTranscribedChunks?`
+### `onTranscriptionChunk?`
Callback function that receives an array of `TranscriptionItemWithTimestamp` objects as transcription segments are processed. This is useful for displaying live transcription updates.
diff --git a/packages/example/src/WhisperWasm/index.tsx b/packages/example/src/WhisperWasm/index.tsx
index 856ec19a17..8e95e93270 100644
--- a/packages/example/src/WhisperWasm/index.tsx
+++ b/packages/example/src/WhisperWasm/index.tsx
@@ -51,7 +51,7 @@ export const WhisperWasm = () => {
onProgress(p) {
console.log({p});
},
- onTranscribedChunks(transcription) {
+ onTranscriptionChunk(transcription) {
console.log('New transcription chunk', transcription);
},
});
diff --git a/packages/whisper-wasm/src/transcribe.ts b/packages/whisper-wasm/src/transcribe.ts
index ca3f31dba0..2b42743ad7 100644
--- a/packages/whisper-wasm/src/transcribe.ts
+++ b/packages/whisper-wasm/src/transcribe.ts
@@ -41,7 +41,7 @@ export type TranscribeParams = {
model: WhisperWasmModel;
language?: WhisperWasmLanguage;
onProgress?: (p: number) => void;
- onTranscribedChunks?: (
+ onTranscriptionChunk?: (
transcription: TranscriptionItemWithTimestamp[],
) => void;
threads?: number;
@@ -64,7 +64,7 @@ export const transcribe = async ({
language = 'auto',
onProgress,
threads,
- onTranscribedChunks,
+ onTranscriptionChunk,
logLevel = 'info',
}: TranscribeParams): Promise<TranscriptionJson> => {
if (!channelWaveform || channelWaveform.length === 0) {
@@ -139,7 +139,7 @@ export const transcribe = async ({
reject(new Error('Another transcription is already in progress'));
},
onUpdate: (json: TranscriptionJson) => {
- onTranscribedChunks?.(json.transcription);
+ onTranscriptionChunk?.(json.transcription);
},
});