Skip to content

🎥 Make videos programmatically with React

fixes

Hunain Ahmeddbd960179155
diff --git a/packages/docs/docs/whisper-wasm/download-model.mdx b/packages/docs/docs/whisper-wasm/download-whisper-model.mdx
similarity index 84%
rename from packages/docs/docs/whisper-wasm/download-model.mdx
rename to packages/docs/docs/whisper-wasm/download-whisper-model.mdx
index bf73eb602e..0269b0972f 100644
--- a/packages/docs/docs/whisper-wasm/download-model.mdx
+++ b/packages/docs/docs/whisper-wasm/download-whisper-model.mdx
@@ -1,20 +1,20 @@
---
-title: downloadModel()
+title: downloadWhisperModel()
crumb: '@remotion/whisper-wasm'
---
-# downloadModel()
+# downloadWhisperModel()
Downloads a Whisper.cpp model to the browser.
```tsx title="app.tsx"
import { useEffect, useState } from "react";
-import {downloadModel} from '@remotion/whisper-wasm';
+import {downloadWhisperModel} from '@remotion/whisper-wasm';
export default function MyApp(){
const [progress, setProgress] = useState(0)
useEffect(()=>{
- downloadModel('tiny.en', setProgress);
+ downloadWhisperModel({model: 'tiny.en', onProgress: setProgress});
},[]);
return (
@@ -23,7 +23,7 @@ export default function MyApp(){
}
```
-## Arguments
+## Options
### `model`
diff --git a/packages/docs/docs/whisper-wasm/index.mdx b/packages/docs/docs/whisper-wasm/index.mdx
index d40ab4963e..c27015b7fd 100644
--- a/packages/docs/docs/whisper-wasm/index.mdx
+++ b/packages/docs/docs/whisper-wasm/index.mdx
@@ -28,7 +28,7 @@ export default function Home() {
const [text, setText] = useState("");
useEffect(()=>{
- downloadModel('tiny.en', downloadProgress);
+ downloadModel({model:'tiny.en', onProgress: downloadProgress});
},[]);
const onTranscribeChunk = (start:string, end:string, text:string) => {
@@ -39,7 +39,7 @@ export default function Home() {
<div>
<input type="file" accept=".wav" onChange={(e)=>{
- transcribe(e.target.files[0], transcriptionProgress, onTranscribeChunk, 12)
+ transcribe({file: e.target.files[0], onProgress: transcriptionProgress, onTranscribeChunk, threads: 12})
.then(result => setText(result));
diff --git a/packages/docs/docs/whisper-wasm/transcribe.mdx b/packages/docs/docs/whisper-wasm/transcribe.mdx
index 32dbf50466..b0df6f7542 100644
--- a/packages/docs/docs/whisper-wasm/transcribe.mdx
+++ b/packages/docs/docs/whisper-wasm/transcribe.mdx
@@ -17,7 +17,7 @@ export default function MyApp(){
return(
<input type="file" accept=".wav" onChange={(e)=>{
- transcribe(e.target.files[0])
+ transcribe({file: e.target.files[0]})
.then(result => setText(result));
}} />
)
@@ -62,4 +62,4 @@ The number of threads to use for transcription, set to `8` by default.
- [Source code for this function](https://github.com/remotion-dev/remotion/blob/main/packages/whisper-wasm/src/helpers.ts)
- [`@remotion/whisper-wasm`](/docs/whisper-wasm)
-- [`downloadModel()`](/docs/whisper-wasm/download-model)
+- [`downloadWhisperModel()`](/docs/whisper-wasm/download-whisper-model)
diff --git a/packages/docs/docs/whisper-wasm/whisper-wasm.tsx b/packages/docs/docs/whisper-wasm/whisper-wasm.tsx
index 42986aa3e8..606a2dbfee 100644
--- a/packages/docs/docs/whisper-wasm/whisper-wasm.tsx
+++ b/packages/docs/docs/whisper-wasm/whisper-wasm.tsx
@@ -6,8 +6,8 @@ export const TableOfContents: React.FC = () => {
return (
<div>
<Grid>
- <TOCItem link="/docs/whisper-wasm/download-model">
- <strong>downloadModel()</strong>
+ <TOCItem link="/docs/whisper-wasm/download-whisper-model">
+ <strong>downloadWhisperModel()</strong>
<div>Download a Whisper model in browser</div>
</TOCItem>
<TOCItem link="/docs/whisper-wasm/transcribe">
diff --git a/packages/docs/sidebars.js b/packages/docs/sidebars.js
index 0ee7545194..fd092f3157 100644
--- a/packages/docs/sidebars.js
+++ b/packages/docs/sidebars.js
@@ -710,7 +710,7 @@ module.exports = {
id: 'whisper-wasm/index',
},
items: [
- 'whisper-wasm/download-model',
+ 'whisper-wasm/download-whisper-model',
'whisper-wasm/transcribe',
],
},