🎥 Make videos programmatically with React
Rename to `@remotion/whisper-web`
Jonny Burgerd64051bd2ce8
diff --git a/package.json b/package.jsonindex 83ca5a82a4..a17e5e9671 100644--- a/package.json+++ b/package.json@@ -14,7 +14,7 @@"testlambda": "turbo run testlambda --concurrency=1 --no-update-notifier","ci": "turbo run make test --concurrency=1 --no-update-notifier","watch": "turbo watch make --concurrency=2 --experimental-write-cache --ui=tui",- "watchwhisperwasm": "turbo watch make --experimental-write-cache --filter='@remotion/whisper-wasm'",+ "watchwhisperweb": "turbo watch make --experimental-write-cache --filter='@remotion/whisper-web'","watchwebcodecs": "turbo watch make --experimental-write-cache --filter='@remotion/media-parser' --filter='@remotion/webcodecs'","watchcore": "turbo watch make --experimental-write-cache --filter='remotion'","watchstudio": "turbo watch make --experimental-write-cache --filter='@remotion/studio' --filter='@remotion/studio-server'",diff --git a/packages/STATS.md b/packages/STATS.mdindex 3de5121fc0..2cda72382b 100644--- a/packages/STATS.md+++ b/packages/STATS.md@@ -1,4 +1,5 @@# Download statistics+Monthly downloads of Remotion packages[](https://npmcharts.com/compare/@remotion/animated-emoji?minimal=true)[](https://npmcharts.com/compare/@remotion/animation-utils?minimal=true)@@ -54,5 +55,5 @@ Monthly downloads of Remotion packages[](https://npmcharts.com/compare/@remotion/three?minimal=true)[](https://npmcharts.com/compare/@remotion/transitions?minimal=true)[](https://npmcharts.com/compare/@remotion/webcodecs?minimal=true)-[](https://npmcharts.com/compare/@remotion/whisper-wasm?minimal=true)-[](https://npmcharts.com/compare/@remotion/zod-types?minimal=true)+[](https://npmcharts.com/compare/@remotion/whisper-web?minimal=true)+[](https://npmcharts.com/compare/@remotion/zod-types?minimal=true)diff --git a/packages/cli/src/list-of-remotion-packages.ts b/packages/cli/src/list-of-remotion-packages.tsindex 4392b049bd..c5e6ccd296 100644--- a/packages/cli/src/list-of-remotion-packages.ts+++ b/packages/cli/src/list-of-remotion-packages.ts@@ -76,5 +76,5 @@ export const listOfRemotionPackages = ['@remotion/openai-whisper','@remotion/compositor','@remotion/example-videos',- '@remotion/whisper-wasm',+ '@remotion/whisper-web',];diff --git a/packages/create-video/src/list-of-remotion-packages.ts b/packages/create-video/src/list-of-remotion-packages.tsindex 4392b049bd..c5e6ccd296 100644--- a/packages/create-video/src/list-of-remotion-packages.ts+++ b/packages/create-video/src/list-of-remotion-packages.ts@@ -76,5 +76,5 @@ export const listOfRemotionPackages = ['@remotion/openai-whisper','@remotion/compositor','@remotion/example-videos',- '@remotion/whisper-wasm',+ '@remotion/whisper-web',];diff --git a/packages/docs/docs/whisper-wasm/get-loaded-models.mdx b/packages/docs/docs/whisper-wasm/get-loaded-models.mdxdeleted file mode 100644index 99ad627e3a..0000000000--- a/packages/docs/docs/whisper-wasm/get-loaded-models.mdx+++ /dev/null@@ -1,15 +0,0 @@-----image: /generated/articles-docs-whisper-wasm-get-loaded-models.png-title: getLoadedModels()-crumb: '@remotion/whisper-wasm'------:::warning-**Unstable API**: This package is experimental for the moment. As we test it, we might make a few changes to the API.-:::--Returns an array of Whisper models that have already been downloaded and stored in the browser's IndexedDB storage.--## Return value--Returns a Promise that resolves to an array of `WhisperWasmModel` strings, representing the models that are already downloaded and available locally.diff --git a/packages/docs/docs/whisper-wasm/can-use-whisper-wasm.mdx b/packages/docs/docs/whisper-web/can-use-whisper-web.mdxsimilarity index 77%rename from packages/docs/docs/whisper-wasm/can-use-whisper-wasm.mdxrename to packages/docs/docs/whisper-web/can-use-whisper-web.mdxindex fbd8f17c84..8da173814f 100644--- a/packages/docs/docs/whisper-wasm/can-use-whisper-wasm.mdx+++ b/packages/docs/docs/whisper-web/can-use-whisper-web.mdx@@ -1,21 +1,21 @@----image: /generated/articles-docs-whisper-wasm-can-use-whisper-wasm.png-title: canUseWhisperWasm()-crumb: '@remotion/whisper-wasm'+image: /generated/articles-docs-whisper-web-can-use-whisper-web.png+title: canUseWhisperWeb()+crumb: '@remotion/whisper-web'---:::warning-**Unstable API**: This package is experimental for the moment. As we test it, we might make a few changes to the API.+**Unstable API**: This package is experimental for the moment. As we test it, we might make a few changes to the API and switch to a WebGPU-based backend in the future.:::-# canUseWhisperWasm()+# canUseWhisperWeb()-Checks if the current browser environment supports running `@remotion/whisper-wasm` with a specified model. This function verifies various browser capabilities like `crossOriginIsolated`, `IndexedDB`, `navigator.storage.estimate()`, and available storage space.+Checks if the current browser environment supports running `@remotion/whisper-web` with a specified model. This function verifies various browser capabilities like `crossOriginIsolated`, `IndexedDB`, `navigator.storage.estimate()`, and available storage space.## Example usage```tsx twoslash-import {canUseWhisperWasm, type WhisperWasmModel} from '@remotion/whisper-wasm';+import {canUseWhisperWeb, type WhisperWebModel} from '@remotion/whisper-web';import {useState, useEffect} from 'react';export default function MyComponent() {@@ -85,7 +85,7 @@ If `supported` is `false`, this field may contain a more detailed, human-readabl## Important considerations-- **Cross-Origin Isolation:** For `SharedArrayBuffer` to work, which is required by `@remotion/whisper-wasm`, the page must be served with specific HTTP headers:+- **Cross-Origin Isolation:** For `SharedArrayBuffer` to work, which is required by `@remotion/whisper-web`, the page must be served with specific HTTP headers:- `Cross-Origin-Opener-Policy: same-origin`- `Cross-Origin-Embedder-Policy: require-corp`@@ -95,7 +95,7 @@ If `supported` is `false`, this field may contain a more detailed, human-readabl## See also-- [Source code for `canUseWhisperWasm()`](https://github.com/remotion-dev/remotion/blob/main/packages/whisper-wasm/src/can-use-whisper-wasm.ts)-- [`@remotion/whisper-wasm`](/docs/whisper-wasm)-- [`transcribe()`](/docs/whisper-wasm/transcribe)-- [`downloadWhisperModel()`](/docs/whisper-wasm/download-whisper-model)+- [Source code for `canUseWhisperWasm()`](https://github.com/remotion-dev/remotion/blob/main/packages/whisper-web/src/can-use-whisper-web.ts)+- [`@remotion/whisper-web`](/docs/whisper-web)+- [`transcribe()`](/docs/whisper-web/transcribe)+- [`downloadWhisperModel()`](/docs/whisper-web/download-whisper-model)diff --git a/packages/docs/docs/whisper-wasm/download-whisper-model.mdx b/packages/docs/docs/whisper-web/download-whisper-model.mdxsimilarity index 69%rename from packages/docs/docs/whisper-wasm/download-whisper-model.mdxrename to packages/docs/docs/whisper-web/download-whisper-model.mdxindex 95788c23d5..3c3e5af7d7 100644--- a/packages/docs/docs/whisper-wasm/download-whisper-model.mdx+++ b/packages/docs/docs/whisper-web/download-whisper-model.mdx@@ -1,18 +1,19 @@---+image: /generated/articles-docs-whisper-web-download-whisper-model.pngtitle: downloadWhisperModel()-crumb: '@remotion/whisper-wasm'+crumb: '@remotion/whisper-web'---# downloadWhisperModel():::warning-**Unstable API**: This package is experimental for the moment. As we test it, we might make a few changes to the API.+**Unstable API**: This package is experimental for the moment. As we test it, we might make a few changes to the API and switch to a WebGPU-based backend in the future.:::Downloads a Whisper model into IndexedDB.```tsx twoslash title="app.ts"-import {downloadWhisperModel} from '@remotion/whisper-wasm';+import {downloadWhisperModel} from '@remotion/whisper-web';const {alreadyDownloaded} = await downloadWhisperModel({model: 'tiny.en',@@ -33,7 +34,7 @@ The model to download. Possible values: `tiny`, `tiny.en`, `base`, `base.en`, `sAct upon download progress. This is the function signature:```tsx twoslash-import {DownloadWhisperModelOnProgress, DownloadWhisperModelProgress} from '@remotion/whisper-wasm';+import {DownloadWhisperModelOnProgress, DownloadWhisperModelProgress} from '@remotion/whisper-web';const onProgress: DownloadWhisperModelOnProgress = ({progress, totalBytes, downloadedBytes}: DownloadWhisperModelProgress) => {console.log({progress, totalBytes, downloadedBytes});@@ -48,6 +49,6 @@ Returns an object with the following properties:## See also-- [Source code for this function](https://github.com/remotion-dev/remotion/blob/main/packages/whisper-wasm/src/download-whisper-model.ts)-- [`@remotion/whisper-wasm`](/docs/whisper-wasm)-- [`transcribe()`](/docs/whisper-wasm/transcribe)+- [Source code for this function](https://github.com/remotion-dev/remotion/blob/main/packages/whisper-web/src/download-whisper-model.ts)+- [`@remotion/whisper-web`](/docs/whisper-web)+- [`transcribe()`](/docs/whisper-web/transcribe)diff --git a/packages/docs/docs/whisper-web/get-loaded-models.mdx b/packages/docs/docs/whisper-web/get-loaded-models.mdxnew file mode 100644index 0000000000..9a5129b1a3--- /dev/null+++ b/packages/docs/docs/whisper-web/get-loaded-models.mdx@@ -0,0 +1,15 @@+---+image: /generated/articles-docs-whisper-web-get-loaded-models.png+title: getLoadedModels()+crumb: '@remotion/whisper-web'+---++:::warning+**Unstable API**: This package is experimental for the moment. As we test it, we might make a few changes to the API and switch to a WebGPU-based backend in the future.+:::++Returns an array of Whisper models that have already been downloaded and stored in the browser's IndexedDB storage.++## Return value++Returns a Promise that resolves to an array of `WhisperWebModel` strings, representing the models that are already downloaded and available locally.diff --git a/packages/docs/docs/whisper-wasm/index.mdx b/packages/docs/docs/whisper-web/index.mdxsimilarity index 78%rename from packages/docs/docs/whisper-wasm/index.mdxrename to packages/docs/docs/whisper-web/index.mdxindex be50bb9db5..12aee22d0d 100644--- a/packages/docs/docs/whisper-wasm/index.mdx+++ b/packages/docs/docs/whisper-web/index.mdx@@ -1,5 +1,6 @@----title: '@remotion/whisper-wasm'+image: /generated/articles-docs-whisper-web-index.png+title: '@remotion/whisper-web'crumb: 'Transcribe audio in browser'---@@ -7,14 +8,14 @@ import Tabs from '@theme/Tabs';import TabItem from '@theme/TabItem';:::warning-**Unstable API**: This package is experimental for the moment. As we test it, we might make a few changes to the API.+**Unstable API**: This package is experimental for the moment. As we test it, we might make a few changes to the API and switch to a WebGPU-based backend in the future.:::Similar to [@remotion/install-whisper-cpp](/docs/install-whisper-cpp) but for the browser. Allows you to transcribe audio locally in the browser, with the help of WASM.-import {TableOfContents} from './whisper-wasm';+import {TableOfContents} from './whisper-web';-<Installation pkg="@remotion/whisper-wasm" />+<Installation pkg="@remotion/whisper-web" />## Example usage@@ -23,7 +24,7 @@ This library is UI-agnostic and can be integrated with any frontend framework.:::```tsx twoslash-import {transcribe, canUseWhisperWasm, resampleTo16Khz, downloadWhisperModel} from '@remotion/whisper-wasm';+import {transcribe, canUseWhisperWeb, resampleTo16Khz, downloadWhisperModel} from '@remotion/whisper-web';// HTML:// <input type="file" accept="audio/*" id="audio-input" />@@ -39,7 +40,7 @@ input.addEventListener('change', async (e) => {const modelToUse = 'tiny.en';- const {supported, detailedReason} = await canUseWhisperWasm(modelToUse);+ const {supported, detailedReason} = await canUseWhisperWeb(modelToUse);if (!supported) {throw new Error(`Whisper WASM is not supported in this environment: ${detailedReason}`);}diff --git a/packages/docs/docs/whisper-wasm/resample-to-16khz.mdx b/packages/docs/docs/whisper-web/resample-to-16khz.mdxsimilarity index 83%rename from packages/docs/docs/whisper-wasm/resample-to-16khz.mdxrename to packages/docs/docs/whisper-web/resample-to-16khz.mdxindex b097022612..af9f70ddf7 100644--- a/packages/docs/docs/whisper-wasm/resample-to-16khz.mdx+++ b/packages/docs/docs/whisper-web/resample-to-16khz.mdx@@ -1,16 +1,16 @@----image: /generated/articles-docs-whisper-wasm-resample-to-16khz.png+image: /generated/articles-docs-whisper-web-resample-to-16khz.pngtitle: resampleTo16Khz()-crumb: '@remotion/whisper-wasm'+crumb: '@remotion/whisper-web'---:::warning-**Unstable API**: This package is experimental for the moment. As we test it, we might make a few changes to the API.+**Unstable API**: This package is experimental for the moment. As we test it, we might make a few changes to the API and switch to a WebGPU-based backend in the future.:::# resampleTo16Khz()-Processes an audio `File` or `Blob` by decoding it, converting it to mono, and resampling it to a 16kHz `Float32Array`. This prepares the audio data for use with the [`transcribe()`](/docs/whisper-wasm/transcribe) function.+Processes an audio `File` or `Blob` by decoding it, converting it to mono, and resampling it to a 16kHz `Float32Array`. This prepares the audio data for use with the [`transcribe()`](/docs/whisper-web/transcribe) function.This function operates in a browser environment as it relies on the Web Audio API (`AudioContext`, `OfflineAudioContext`) and `FileReader`.@@ -36,7 +36,7 @@ Optional. Determines the level of detail for logs printed to the console during`Promise<Float32Array>`-This array contains the raw audio waveform data for a single channel (mono), sampled at 16kHz. This output is ready to be passed to the `channelWaveform` argument of the [`transcribe()`](/docs/whisper-wasm/transcribe) function.+This array contains the raw audio waveform data for a single channel (mono), sampled at 16kHz. This output is ready to be passed to the `channelWaveform` argument of the [`transcribe()`](/docs/whisper-web/transcribe) function.## Behavior notes@@ -46,5 +46,5 @@ This array contains the raw audio waveform data for a single channel (mono), sam## See also-- [`transcribe()`](/docs/whisper-wasm/transcribe)-- [`@remotion/whisper-wasm`](/docs/whisper-wasm)+- [`transcribe()`](/docs/whisper-web/transcribe)+- [`@remotion/whisper-web`](/docs/whisper-web)diff --git a/packages/docs/docs/whisper-wasm/transcribe.mdx b/packages/docs/docs/whisper-web/transcribe.mdxsimilarity index 84%rename from packages/docs/docs/whisper-wasm/transcribe.mdxrename to packages/docs/docs/whisper-web/transcribe.mdxindex 81a85f56be..5e327b96d7 100644--- a/packages/docs/docs/whisper-wasm/transcribe.mdx+++ b/packages/docs/docs/whisper-web/transcribe.mdx@@ -1,22 +1,23 @@---+image: /generated/articles-docs-whisper-web-transcribe.pngtitle: transcribe()-crumb: '@remotion/whisper-wasm'+crumb: '@remotion/whisper-web'---# transcribe():::warning-**Unstable API**: This package is experimental for the moment. As we test it, we might make a few changes to the API.+**Unstable API**: This package is experimental for the moment. As we test it, we might make a few changes to the API and switch to a WebGPU-based backend in the future.:::Transcribes pre-processed audio data (a `Float32Array` waveform) using WebAssembly-compiled Whisper.cpp, returning the transcription.-To transcribe an audio file, you first need to download a model using [`downloadWhisperModel()`](/docs/whisper-wasm/download-whisper-model) and turn the file into a 16kHz `Float32Array` using [`resampleTo16Khz()`](/docs/whisper-wasm/resample-to-16khz).+To transcribe an audio file, you first need to download a model using [`downloadWhisperModel()`](/docs/whisper-web/download-whisper-model) and turn the file into a 16kHz `Float32Array` using [`resampleTo16Khz()`](/docs/whisper-web/resample-to-16khz).## Example```tsx twoslash title="app.ts"-import {resampleTo16Khz} from '@remotion/whisper-wasm';+import {resampleTo16Khz} from '@remotion/whisper-web';const file = new File([], 'audio.wav');const channelWaveform = await resampleTo16Khz({@@ -25,7 +26,7 @@ const channelWaveform = await resampleTo16Khz({});// ---cut----import {transcribe} from '@remotion/whisper-wasm';+import {transcribe} from '@remotion/whisper-web';const {transcription} = await transcribe({channelWaveform,@@ -40,11 +41,11 @@ console.log(transcription.map((t) => t.text).join(' '));### `channelWaveform`-A `Float32Array` representing the mono audio waveform data, resampled to 16kHz. This is typically obtained by calling [`resampleTo16Khz()`](/docs/whisper-wasm/resample-to-16khz) with an audio `File` or `Blob`.+A `Float32Array` representing the mono audio waveform data, resampled to 16kHz. This is typically obtained by calling [`resampleTo16Khz()`](/docs/whisper-web/resample-to-16khz) with an audio `File` or `Blob`.### `model`-The Whisper model to use for transcription (e.g., `'tiny.en'`, `'base'`, `'small'`). This determines the size, speed, and accuracy of the model. Ensure the model has been downloaded using [`downloadWhisperModel()`](/docs/whisper-wasm/download-whisper-model) before calling `transcribe`.+The Whisper model to use for transcription (e.g., `'tiny.en'`, `'base'`, `'small'`). This determines the size, speed, and accuracy of the model. Ensure the model has been downloaded using [`downloadWhisperModel()`](/docs/whisper-web/download-whisper-model) before calling `transcribe`.Possible values: `tiny`, `tiny.en`, `base`, `base.en`, `small`, `small.en`.@@ -96,7 +97,7 @@ Determines how much info is being logged to the console.## See also-- [Source code for `transcribe()`](https://github.com/remotion-dev/remotion/blob/main/packages/whisper-wasm/src/transcribe.ts)-- [`resampleTo16Khz()`](/docs/whisper-wasm/resample-to-16khz)-- [`downloadWhisperModel()`](/docs/whisper-wasm/download-whisper-model)-- [`@remotion/whisper-wasm`](/docs/whisper-wasm)+- [Source code for `transcribe()`](https://github.com/remotion-dev/remotion/blob/main/packages/whisper-web/src/transcribe.ts)+- [`resampleTo16Khz()`](/docs/whisper-web/resample-to-16khz)+- [`downloadWhisperModel()`](/docs/whisper-web/download-whisper-model)+- [`@remotion/whisper-web`](/docs/whisper-web)diff --git a/packages/docs/docs/whisper-wasm/whisper-wasm.tsx b/packages/docs/docs/whisper-web/whisper-wasm.tsxsimilarity index 66%rename from packages/docs/docs/whisper-wasm/whisper-wasm.tsxrename to packages/docs/docs/whisper-web/whisper-wasm.tsxindex b63fe5f86c..ebce13ec6f 100644--- a/packages/docs/docs/whisper-wasm/whisper-wasm.tsx+++ b/packages/docs/docs/whisper-web/whisper-wasm.tsx@@ -6,25 +6,25 @@ export const TableOfContents: React.FC = () => {return (<div><Grid>- <TOCItem link="/docs/whisper-wasm/can-use-whisper-wasm">- <strong>canUseWhisperWasm()</strong>- <div>Check if the browser supports Whisper WASM</div>+ <TOCItem link="/docs/whisper-web/can-use-whisper-web">+ <strong>canUseWhisperWeb()</strong>+ <div>Check if the browser supports this Whisper package</div></TOCItem>- <TOCItem link="/docs/whisper-wasm/download-whisper-model">+ <TOCItem link="/docs/whisper-web/download-whisper-model"><strong>downloadWhisperModel()</strong><div>Download a Whisper model in browser</div></TOCItem>- <TOCItem link="/docs/whisper-wasm/resample-to-16khz">+ <TOCItem link="/docs/whisper-web/resample-to-16khz"><strong>resampleTo16khz()</strong><div>Prepare an audio file for transcription by resampling it to 16kHz</div></TOCItem>- <TOCItem link="/docs/whisper-wasm/transcribe">+ <TOCItem link="/docs/whisper-web/transcribe"><strong>transcribe()</strong><div>Transcribe an audio file in the WASM environemnt</div></TOCItem>- <TOCItem link="/docs/whisper-wasm/get-loaded-models">+ <TOCItem link="/docs/whisper-web/get-loaded-models"><strong>getLoadedModels()</strong><div>Get a list of Whisper models that are already downloaded</div></TOCItem>diff --git a/packages/docs/package.json b/packages/docs/package.jsonindex f0f80f87cd..8b2c7d06b7 100644--- a/packages/docs/package.json+++ b/packages/docs/package.json@@ -71,7 +71,7 @@"@remotion/transitions": "workspace:*","@remotion/media-parser": "workspace:*","@remotion/webcodecs": "workspace:*",- "@remotion/whisper-wasm": "workspace:*",+ "@remotion/whisper-web": "workspace:*","@remotion/zod-types": "workspace:*","@rive-app/canvas-advanced": "2.3.0","@shopify/react-native-skia": "2.0.0",@@ -110,4 +110,4 @@"url-loader": "^4.1.1","openai": "4.67.1"}-}\ No newline at end of file+}diff --git a/packages/docs/sidebars.js b/packages/docs/sidebars.jsindex c0440889c3..8f5d00b666 100644--- a/packages/docs/sidebars.js+++ b/packages/docs/sidebars.js@@ -715,17 +715,17 @@ module.exports = {},{type: 'category',- label: '@remotion/whisper-wasm',+ label: '@remotion/whisper-web',link: {type: 'doc',- id: 'whisper-wasm/index',+ id: 'whisper-web/index',},items: [- 'whisper-wasm/download-whisper-model',- 'whisper-wasm/transcribe',- 'whisper-wasm/resample-to-16khz',- 'whisper-wasm/can-use-whisper-wasm',- 'whisper-wasm/get-loaded-models',+ 'whisper-web/download-whisper-model',+ 'whisper-web/transcribe',+ 'whisper-web/resample-to-16khz',+ 'whisper-web/can-use-whisper-web',+ 'whisper-web/get-loaded-models',],},{diff --git a/packages/docs/src/data/articles.ts b/packages/docs/src/data/articles.tsindex ebb0637361..6dc73ecc57 100644--- a/packages/docs/src/data/articles.ts+++ b/packages/docs/src/data/articles.ts@@ -6118,58 +6118,58 @@ export const articles = [slug: 'webcodecs/webcodecs-controller',},{- id: 'whisper-wasm/can-use-whisper-wasm',- title: 'canUseWhisperWasm()',- relativePath: 'docs/whisper-wasm/can-use-whisper-wasm.mdx',- compId: 'articles-docs-whisper-wasm-can-use-whisper-wasm',- crumb: '@remotion/whisper-wasm',+ id: 'whisper-web/can-use-whisper-web',+ title: 'canUseWhisperWeb()',+ relativePath: 'docs/whisper-web/can-use-whisper-web.mdx',+ compId: 'articles-docs-whisper-web-can-use-whisper-web',+ crumb: '@remotion/whisper-web',noAi: false,- slug: 'whisper-wasm/can-use-whisper-wasm',+ slug: 'whisper-web/can-use-whisper-web',},{- id: 'whisper-wasm/download-whisper-model',+ id: 'whisper-web/download-whisper-model',title: 'downloadWhisperModel()',- relativePath: 'docs/whisper-wasm/download-whisper-model.mdx',- compId: 'articles-docs-whisper-wasm-download-whisper-model',- crumb: '@remotion/whisper-wasm',+ relativePath: 'docs/whisper-web/download-whisper-model.mdx',+ compId: 'articles-docs-whisper-web-download-whisper-model',+ crumb: '@remotion/whisper-web',noAi: false,- slug: 'whisper-wasm/download-whisper-model',+ slug: 'whisper-web/download-whisper-model',},{- id: 'whisper-wasm/get-loaded-models',+ id: 'whisper-web/get-loaded-models',title: 'getLoadedModels()',- relativePath: 'docs/whisper-wasm/get-loaded-models.mdx',- compId: 'articles-docs-whisper-wasm-get-loaded-models',- crumb: '@remotion/whisper-wasm',+ relativePath: 'docs/whisper-web/get-loaded-models.mdx',+ compId: 'articles-docs-whisper-web-get-loaded-models',+ crumb: '@remotion/whisper-web',noAi: false,- slug: 'whisper-wasm/get-loaded-models',+ slug: 'whisper-web/get-loaded-models',},{- id: 'whisper-wasm/index',- title: '@remotion/whisper-wasm',- relativePath: 'docs/whisper-wasm/index.mdx',- compId: 'articles-docs-whisper-wasm-index',+ id: 'whisper-web/index',+ title: '@remotion/whisper-web',+ relativePath: 'docs/whisper-web/index.mdx',+ compId: 'articles-docs-whisper-web-index',crumb: 'Transcribe audio in browser',noAi: false,- slug: 'whisper-wasm/index',+ slug: 'whisper-web/index',},{- id: 'whisper-wasm/resample-to-16khz',+ id: 'whisper-web/resample-to-16khz',title: 'resampleTo16Khz()',- relativePath: 'docs/whisper-wasm/resample-to-16khz.mdx',- compId: 'articles-docs-whisper-wasm-resample-to-16khz',- crumb: '@remotion/whisper-wasm',+ relativePath: 'docs/whisper-web/resample-to-16khz.mdx',+ compId: 'articles-docs-whisper-web-resample-to-16khz',+ crumb: '@remotion/whisper-web',noAi: false,- slug: 'whisper-wasm/resample-to-16khz',+ slug: 'whisper-web/resample-to-16khz',},{- id: 'whisper-wasm/transcribe',+ id: 'whisper-web/transcribe',title: 'transcribe()',- relativePath: 'docs/whisper-wasm/transcribe.mdx',- compId: 'articles-docs-whisper-wasm-transcribe',- crumb: '@remotion/whisper-wasm',+ relativePath: 'docs/whisper-web/transcribe.mdx',+ compId: 'articles-docs-whisper-web-transcribe',+ crumb: '@remotion/whisper-web',noAi: false,- slug: 'whisper-wasm/transcribe',+ slug: 'whisper-web/transcribe',},{id: 'wrong-composition-mount',diff --git a/packages/docs/static/generated/articles-docs-whisper-wasm-can-use-whisper-wasm.png b/packages/docs/static/generated/articles-docs-whisper-wasm-can-use-whisper-wasm.pngdeleted file mode 100644index e000d26e55..0000000000Binary files a/packages/docs/static/generated/articles-docs-whisper-wasm-can-use-whisper-wasm.png and /dev/null differdiff --git a/packages/docs/static/generated/articles-docs-whisper-wasm-download-whisper-model.png b/packages/docs/static/generated/articles-docs-whisper-wasm-download-whisper-model.pngdeleted file mode 100644index ddd64bcd85..0000000000Binary files a/packages/docs/static/generated/articles-docs-whisper-wasm-download-whisper-model.png and /dev/null differdiff --git a/packages/docs/static/generated/articles-docs-whisper-wasm-get-loaded-models.png b/packages/docs/static/generated/articles-docs-whisper-wasm-get-loaded-models.pngdeleted file mode 100644index 8ae66f6abf..0000000000Binary files a/packages/docs/static/generated/articles-docs-whisper-wasm-get-loaded-models.png and /dev/null differdiff --git a/packages/docs/static/generated/articles-docs-whisper-wasm-index.png b/packages/docs/static/generated/articles-docs-whisper-wasm-index.pngdeleted file mode 100644index 79303196b7..0000000000Binary files a/packages/docs/static/generated/articles-docs-whisper-wasm-index.png and /dev/null differdiff --git a/packages/docs/static/generated/articles-docs-whisper-wasm-resample-to-16khz.png b/packages/docs/static/generated/articles-docs-whisper-wasm-resample-to-16khz.pngdeleted file mode 100644index 1b3221bf29..0000000000Binary files a/packages/docs/static/generated/articles-docs-whisper-wasm-resample-to-16khz.png and /dev/null differdiff --git a/packages/docs/static/generated/articles-docs-whisper-wasm-transcribe.png b/packages/docs/static/generated/articles-docs-whisper-wasm-transcribe.pngdeleted file mode 100644index 0c236dd4c8..0000000000Binary files a/packages/docs/static/generated/articles-docs-whisper-wasm-transcribe.png and /dev/null differdiff --git a/packages/docs/static/generated/articles-docs-whisper-web-can-use-whisper-web.png b/packages/docs/static/generated/articles-docs-whisper-web-can-use-whisper-web.pngnew file mode 100644index 0000000000..d1feb9a4fdBinary files /dev/null and b/packages/docs/static/generated/articles-docs-whisper-web-can-use-whisper-web.png differdiff --git a/packages/docs/static/generated/articles-docs-whisper-web-download-whisper-model.png b/packages/docs/static/generated/articles-docs-whisper-web-download-whisper-model.pngnew file mode 100644index 0000000000..3eb8c827aaBinary files /dev/null and b/packages/docs/static/generated/articles-docs-whisper-web-download-whisper-model.png differdiff --git a/packages/docs/static/generated/articles-docs-whisper-web-get-loaded-models.png b/packages/docs/static/generated/articles-docs-whisper-web-get-loaded-models.pngnew file mode 100644index 0000000000..3fcd4fe494Binary files /dev/null and b/packages/docs/static/generated/articles-docs-whisper-web-get-loaded-models.png differdiff --git a/packages/docs/static/generated/articles-docs-whisper-web-index.png b/packages/docs/static/generated/articles-docs-whisper-web-index.pngnew file mode 100644index 0000000000..07e2fe9bbbBinary files /dev/null and b/packages/docs/static/generated/articles-docs-whisper-web-index.png differdiff --git a/packages/docs/static/generated/articles-docs-whisper-web-resample-to-16khz.png b/packages/docs/static/generated/articles-docs-whisper-web-resample-to-16khz.pngnew file mode 100644index 0000000000..5bc3ecdf29Binary files /dev/null and b/packages/docs/static/generated/articles-docs-whisper-web-resample-to-16khz.png differdiff --git a/packages/docs/static/generated/articles-docs-whisper-web-transcribe.png b/packages/docs/static/generated/articles-docs-whisper-web-transcribe.pngnew file mode 100644index 0000000000..7e85772f9cBinary files /dev/null and b/packages/docs/static/generated/articles-docs-whisper-web-transcribe.png differdiff --git a/packages/example/package.json b/packages/example/package.jsonindex bd19010039..e10b4bb41f 100644--- a/packages/example/package.json+++ b/packages/example/package.json@@ -65,7 +65,7 @@"@remotion/three": "workspace:*","@remotion/transitions": "workspace:*","@remotion/media-parser": "workspace:*",- "@remotion/whisper-wasm": "workspace:*",+ "@remotion/whisper-web": "workspace:*","@remotion/zod-types": "workspace:*","@shopify/react-native-skia": "2.0.0","@types/express": "^4.17.11",diff --git a/packages/example/src/Root.tsx b/packages/example/src/Root.tsxindex 292ca63151..8ea2df2c26 100644--- a/packages/example/src/Root.tsx+++ b/packages/example/src/Root.tsx@@ -132,7 +132,7 @@ import {Seek} from './StudioApis/Seek';import {TransitionRounding} from './TransitionRounding';import {VisualControls} from './VisualControls';import {VoiceVisualization} from './voice-visualization';-import {WhisperWasm} from './WhisperWasm';+import {WhisperWeb} from './WhisperWeb';class Vector2 {readonly x: number;@@ -1591,12 +1591,7 @@ export const Index: React.FC = () => {durationInFrames={900}/></Folder>- <Still- id="whisper-wasm"- component={WhisperWasm}- width={800}- height={800}- />+ <Still id="whisper-web" component={WhisperWeb} width={800} height={800} /><Compositionid="empty"component={Empty}diff --git a/packages/example/src/WhisperWasm/index.tsx b/packages/example/src/WhisperWeb/index.tsxsimilarity index 93%rename from packages/example/src/WhisperWasm/index.tsxrename to packages/example/src/WhisperWeb/index.tsxindex 12a449f5b5..cab9c85dc4 100644--- a/packages/example/src/WhisperWasm/index.tsx+++ b/packages/example/src/WhisperWeb/index.tsx@@ -1,18 +1,18 @@import {- type WhisperWasmModel,+ type WhisperWasmModel as WhisperWebModel,deleteModel,downloadWhisperModel,getLoadedModels,resampleTo16Khz,transcribe,-} from '@remotion/whisper-wasm';+} from '@remotion/whisper-web';import {useCallback, useEffect, useState} from 'react';import {staticFile} from 'remotion';const audioFileUrl = staticFile('16khz.wav');// Define available models-const AVAILABLE_MODELS: WhisperWasmModel[] = [+const AVAILABLE_MODELS: WhisperWebModel[] = ['tiny.en','tiny','base.en',@@ -21,10 +21,10 @@ const AVAILABLE_MODELS: WhisperWasmModel[] = ['small',];-export const WhisperWasm = () => {- const [loadedModels, setLoadedModels] = useState<WhisperWasmModel[]>([]);+export const WhisperWeb = () => {+ const [loadedModels, setLoadedModels] = useState<WhisperWebModel[]>([]);const [statusMessage, setStatusMessage] = useState<string>('');- const [selectedModel, setSelectedModel] = useState<WhisperWasmModel>(+ const [selectedModel, setSelectedModel] = useState<WhisperWebModel>(AVAILABLE_MODELS[0],);@@ -111,7 +111,7 @@ export const WhisperWasm = () => {}, [selectedModel, loadedModels]);const onDeleteModel = useCallback(- async (modelToDelete: WhisperWasmModel) => {+ async (modelToDelete: WhisperWebModel) => {setStatusMessage(`Deleting ${modelToDelete} model...`);try {await deleteModel(modelToDelete);@@ -156,7 +156,7 @@ export const WhisperWasm = () => {id="model-select"value={selectedModel}onChange={(e) =>- setSelectedModel(e.target.value as WhisperWasmModel)+ setSelectedModel(e.target.value as WhisperWebModel)}className="mt-1 block w-full pl-3 pr-10 py-2 text-base border-gray-300 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm rounded-md">diff --git a/packages/example/tsconfig.json b/packages/example/tsconfig.jsonindex 38b9f477a3..efb9fc1d2d 100644--- a/packages/example/tsconfig.json+++ b/packages/example/tsconfig.json@@ -38,7 +38,7 @@{"path": "../svg-3d-engine"},{"path": "../media-parser"},{"path": "../webcodecs"},- {"path": "../whisper-wasm"},+ {"path": "../whisper-web"},{"path": "../layout-utils"}]}diff --git a/packages/studio-shared/src/package-info.ts b/packages/studio-shared/src/package-info.tsindex 8b840ff5f5..a4a77a00f4 100644--- a/packages/studio-shared/src/package-info.ts+++ b/packages/studio-shared/src/package-info.ts@@ -75,7 +75,7 @@ export const packages = ['openai-whisper','compositor','example-videos',- 'whisper-wasm',+ 'whisper-web',] as const;export type Pkgs = (typeof packages)[number];@@ -91,7 +91,7 @@ export const descriptions: {[key in Pkgs]: string | null} = {bundler: 'Bundle Remotion compositions using Webpack','studio-server': 'Run a Remotion Studio with a server backend','install-whisper-cpp': 'Helpers for installing and using Whisper.cpp',- 'whisper-wasm': 'Helpers for using Whisper.cpp in browser using WASM',+ 'whisper-web': 'Helpers for using Whisper.cpp in browser using WASM','google-fonts': 'Use Google Fonts in Remotion',mcp: "Remotion's Model Context Protocol",'media-utils': 'Utilities for working with media files',@@ -199,7 +199,7 @@ export const installableMap: {[key in Pkgs]: boolean} = {gif: true,'google-fonts': true,'install-whisper-cpp': true,- 'whisper-wasm': true,+ 'whisper-web': true,'it-tests': false,'lambda-go-example': false,'lambda-go': false,@@ -255,7 +255,7 @@ export const apiDocs: {[key in Pkgs]: string | null} = {'serverless-client': null,'studio-server': null,'install-whisper-cpp': 'https://www.remotion.dev/docs/install-whisper-cpp',- 'whisper-wasm': 'https://www.remotion.dev/docs/whisper-wasm',+ 'whisper-web': 'https://www.remotion.dev/docs/whisper-web','google-fonts': 'https://www.remotion.dev/docs/google-fonts','media-utils': 'https://www.remotion.dev/docs/media-utils',lottie: 'https://www.remotion.dev/docs/lottie',diff --git a/packages/whisper-wasm/README.md b/packages/whisper-wasm/README.mddeleted file mode 100644index 553b3b579c..0000000000--- a/packages/whisper-wasm/README.md+++ /dev/null@@ -1,18 +0,0 @@-# @remotion/whisper-wasm--Helpers for using Whisper.cpp in browser using WASM--[](https://npmcharts.com/compare/@remotion/whisper-wasm?minimal=true)--## Installation--```bash-npm install @remotion/whisper-wasm --save-exact-```--When installing a Remotion package, make sure to align the version of all `remotion` and `@remotion/*` packages to the same version.-Remove the `^` character from the version number to use the exact version.--## Usage--See the [documentation](https://www.remotion.dev/docs/whisper-wasm) for more information.diff --git a/packages/whisper-wasm/.gitignore b/packages/whisper-web/.gitignoresimilarity index 100%rename from packages/whisper-wasm/.gitignorerename to packages/whisper-web/.gitignorediff --git a/packages/whisper-web/README.md b/packages/whisper-web/README.mdnew file mode 100644index 0000000000..13acd7d1cb--- /dev/null+++ b/packages/whisper-web/README.md@@ -0,0 +1,18 @@+# @remotion/whisper-web++Helpers for using Whisper.cpp in browser using WebAssembly++[](https://npmcharts.com/compare/@remotion/whisper-web?minimal=true)++## Installation++```bash+npm install @remotion/whisper-web --save-exact+```++When installing a Remotion package, make sure to align the version of all `remotion` and `@remotion/*` packages to the same version.+Remove the `^` character from the version number to use the exact version.++## Usage++See the [documentation](https://www.remotion.dev/docs/whisper-web) for more information.diff --git a/packages/whisper-wasm/build-wasm.ts b/packages/whisper-web/build-wasm.tssimilarity index 98%rename from packages/whisper-wasm/build-wasm.tsrename to packages/whisper-web/build-wasm.tsindex 2c80ff9d36..c257c063b8 100644--- a/packages/whisper-wasm/build-wasm.ts+++ b/packages/whisper-web/build-wasm.ts@@ -5,7 +5,7 @@ import path from 'path';const randomDir = os.tmpdir();-const wasmDir = path.join(randomDir, 'whisper-wasm');+const wasmDir = path.join(randomDir, 'whisper-web');if (fs.existsSync(wasmDir)) {fs.rmSync(wasmDir, {recursive: true});diff --git a/packages/whisper-wasm/bundle.ts b/packages/whisper-web/bundle.tssimilarity index 100%rename from packages/whisper-wasm/bundle.tsrename to packages/whisper-web/bundle.tsdiff --git a/packages/whisper-wasm/emscripten.cpp b/packages/whisper-web/emscripten.cppsimilarity index 100%rename from packages/whisper-wasm/emscripten.cpprename to packages/whisper-web/emscripten.cppdiff --git a/packages/whisper-wasm/eslint.config.mjs b/packages/whisper-web/eslint.config.mjssimilarity index 100%rename from packages/whisper-wasm/eslint.config.mjsrename to packages/whisper-web/eslint.config.mjsdiff --git a/packages/whisper-wasm/main.d.ts b/packages/whisper-web/main.d.tssimilarity index 100%rename from packages/whisper-wasm/main.d.tsrename to packages/whisper-web/main.d.tsdiff --git a/packages/whisper-wasm/main.js b/packages/whisper-web/main.jssimilarity index 100%rename from packages/whisper-wasm/main.jsrename to packages/whisper-web/main.jsdiff --git a/packages/whisper-wasm/package.json b/packages/whisper-web/package.jsonsimilarity index 90%rename from packages/whisper-wasm/package.jsonrename to packages/whisper-web/package.jsonindex 76a84c0d9d..6a8e0ca53f 100644--- a/packages/whisper-wasm/package.json+++ b/packages/whisper-web/package.json@@ -1,8 +1,8 @@{"repository": {- "url": "https://github.com/remotion-dev/remotion/tree/main/packages/whisper-wasm"+ "url": "https://github.com/remotion-dev/remotion/tree/main/packages/whisper-web"},- "name": "@remotion/whisper-wasm",+ "name": "@remotion/whisper-web","version": "4.0.300","main": "dist/index.js","sideEffects": false,@@ -47,6 +47,6 @@"whisper","wasm"],- "homepage": "https://www.remotion.dev/docs/whisper-wasm",+ "homepage": "https://www.remotion.dev/docs/whisper-web","description": "Helpers for using Whisper.cpp in browser using WASM"}diff --git a/packages/whisper-wasm/src/can-use-whisper-wasm.ts b/packages/whisper-web/src/can-use-whisper-web.tssimilarity index 89%rename from packages/whisper-wasm/src/can-use-whisper-wasm.tsrename to packages/whisper-web/src/can-use-whisper-web.tsindex 50420e2886..457a57ec47 100644--- a/packages/whisper-wasm/src/can-use-whisper-wasm.ts+++ b/packages/whisper-web/src/can-use-whisper-web.ts@@ -1,4 +1,4 @@-import type {WhisperWasmModel} from './constants';+import type {WhisperWebModel} from './constants';import {SIZES} from './constants';export enum WhisperWasmUnsupportedReason {@@ -20,7 +20,7 @@ export interface CanUseWhisperWasmResult {}export const canUseWhisperWasm = async (- model: WhisperWasmModel,+ model: WhisperWebModel,): Promise<CanUseWhisperWasmResult> => {if (typeof window === 'undefined') {return {@@ -36,7 +36,7 @@ export const canUseWhisperWasm = async (supported: false,reason: WhisperWasmUnsupportedReason.NotCrossOriginIsolated,detailedReason:- 'The document is not cross-origin isolated (window.crossOriginIsolated = false). This prevents the usage of SharedArrayBuffer, which is required by `@remotion/whisper-wasm`. Make sure the document is served with the HTTP header `Cross-Origin-Opener-Policy: same-origin` and `Cross-Origin-Embedder-Policy: require-corp`: https://developer.mozilla.org/en-US/docs/Web/API/Window/crossOriginIsolated',+ 'The document is not cross-origin isolated (window.crossOriginIsolated = false). This prevents the usage of SharedArrayBuffer, which is required by `@remotion/whisper-web`. Make sure the document is served with the HTTP header `Cross-Origin-Opener-Policy: same-origin` and `Cross-Origin-Embedder-Policy: require-corp`: https://developer.mozilla.org/en-US/docs/Web/API/Window/crossOriginIsolated',};}diff --git a/packages/whisper-wasm/src/constants.ts b/packages/whisper-web/src/constants.tssimilarity index 91%rename from packages/whisper-wasm/src/constants.tsrename to packages/whisper-web/src/constants.tsindex 8c895f9163..439f2e5edf 100644--- a/packages/whisper-wasm/src/constants.ts+++ b/packages/whisper-web/src/constants.ts@@ -1,4 +1,4 @@-export const DB_NAME = 'whisper-wasm';+export const DB_NAME = 'whisper-web';export const DB_VERSION = 1;export const DB_OBJECT_STORE_NAME = 'models';@@ -11,7 +11,7 @@ export const MODELS = ['small.en',] as const;-export type WhisperWasmModel = (typeof MODELS)[number];+export type WhisperWebModel = (typeof MODELS)[number];export const LANGUAGES = [// whisper allows passing 'auto' to auto-detect the language@@ -220,9 +220,9 @@ export const LANGUAGES = ['cantonese',] as const;-export type WhisperWasmLanguage = (typeof LANGUAGES)[number];+export type WhisperWebLanguage = (typeof LANGUAGES)[number];-export const SIZES: {[key in WhisperWasmModel]: number} = {+export const SIZES: {[key in WhisperWebModel]: number} = {tiny: 77691713,'tiny.en': 77704715,base: 147951465,diff --git a/packages/whisper-wasm/src/db/delete-object.ts b/packages/whisper-web/src/db/delete-object.tssimilarity index 100%rename from packages/whisper-wasm/src/db/delete-object.tsrename to packages/whisper-web/src/db/delete-object.tsdiff --git a/packages/whisper-wasm/src/db/get-object-from-db.ts b/packages/whisper-web/src/db/get-object-from-db.tssimilarity index 100%rename from packages/whisper-wasm/src/db/get-object-from-db.tsrename to packages/whisper-web/src/db/get-object-from-db.tsdiff --git a/packages/whisper-wasm/src/db/open-db.ts b/packages/whisper-web/src/db/open-db.tssimilarity index 100%rename from packages/whisper-wasm/src/db/open-db.tsrename to packages/whisper-web/src/db/open-db.tsdiff --git a/packages/whisper-wasm/src/db/put-object.ts b/packages/whisper-web/src/db/put-object.tssimilarity index 100%rename from packages/whisper-wasm/src/db/put-object.tsrename to packages/whisper-web/src/db/put-object.tsdiff --git a/packages/whisper-wasm/src/delete-model.ts b/packages/whisper-web/src/delete-model.tssimilarity index 58%rename from packages/whisper-wasm/src/delete-model.tsrename to packages/whisper-web/src/delete-model.tsindex 219daa9aa7..aebe4b795c 100644--- a/packages/whisper-wasm/src/delete-model.ts+++ b/packages/whisper-web/src/delete-model.ts@@ -1,8 +1,8 @@-import type {WhisperWasmModel} from './constants';+import type {WhisperWebModel} from './constants';import {deleteObject} from './db/delete-object';import {getModelUrl} from './get-model-url';-export const deleteModel = async (model: WhisperWasmModel) => {+export const deleteModel = async (model: WhisperWebModel) => {const url = getModelUrl(model);await deleteObject({key: url});};diff --git a/packages/whisper-wasm/src/download-model.ts b/packages/whisper-web/src/download-model.tssimilarity index 100%rename from packages/whisper-wasm/src/download-model.tsrename to packages/whisper-web/src/download-model.tsdiff --git a/packages/whisper-wasm/src/download-whisper-model.ts b/packages/whisper-web/src/download-whisper-model.tssimilarity index 92%rename from packages/whisper-wasm/src/download-whisper-model.tsrename to packages/whisper-web/src/download-whisper-model.tsindex 6ee93d00a3..d2c171630c 100644--- a/packages/whisper-wasm/src/download-whisper-model.ts+++ b/packages/whisper-web/src/download-whisper-model.ts@@ -1,5 +1,5 @@-import {canUseWhisperWasm} from './can-use-whisper-wasm';-import {MODELS, SIZES, type WhisperWasmModel} from './constants';+import {canUseWhisperWasm} from './can-use-whisper-web';+import {MODELS, SIZES, type WhisperWebModel} from './constants';import {getObject} from './db/get-object-from-db';import {putObject} from './db/put-object';import {fetchRemote} from './download-model';@@ -16,7 +16,7 @@ export type DownloadWhisperModelOnProgress = () => void;export interface DownloadWhisperModelParams {- model: WhisperWasmModel;+ model: WhisperWebModel;onProgress: DownloadWhisperModelOnProgress;}diff --git a/packages/whisper-wasm/src/get-loaded-models.ts b/packages/whisper-web/src/get-loaded-models.tssimilarity index 71%rename from packages/whisper-wasm/src/get-loaded-models.tsrename to packages/whisper-web/src/get-loaded-models.tsindex ce45a2ffe6..2d46be8083 100644--- a/packages/whisper-wasm/src/get-loaded-models.ts+++ b/packages/whisper-web/src/get-loaded-models.ts@@ -1,12 +1,12 @@-import type {WhisperWasmModel} from './constants';+import type {WhisperWebModel} from './constants';import {MODELS} from './constants';import {getKeysFromObjectStore} from './db/get-object-from-db';import {openDb} from './db/open-db';import {getModelUrl} from './get-model-url';-export const getLoadedModels = async (): Promise<WhisperWasmModel[]> => {+export const getLoadedModels = async (): Promise<WhisperWebModel[]> => {const objectStore = await openDb('readonly');- const loadedModels: WhisperWasmModel[] = [];+ const loadedModels: WhisperWebModel[] = [];const result = await getKeysFromObjectStore({objectStore,diff --git a/packages/whisper-wasm/src/get-model-url.ts b/packages/whisper-web/src/get-model-url.tssimilarity index 67%rename from packages/whisper-wasm/src/get-model-url.tsrename to packages/whisper-web/src/get-model-url.tsindex ffd818aa4a..fe6cedca18 100644--- a/packages/whisper-wasm/src/get-model-url.ts+++ b/packages/whisper-web/src/get-model-url.ts@@ -1,6 +1,6 @@-import type {WhisperWasmModel} from './constants';+import type {WhisperWebModel} from './constants';-export const getModelUrl = (model: WhisperWasmModel) => {+export const getModelUrl = (model: WhisperWebModel) => {return `https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-${model}.bin`;};diff --git a/packages/whisper-wasm/src/index.module.ts b/packages/whisper-web/src/index.module.tssimilarity index 100%rename from packages/whisper-wasm/src/index.module.tsrename to packages/whisper-web/src/index.module.tsdiff --git a/packages/whisper-wasm/src/index.ts b/packages/whisper-web/src/index.tssimilarity index 81%rename from packages/whisper-wasm/src/index.tsrename to packages/whisper-web/src/index.tsindex 1b943eb86f..b09a918074 100644--- a/packages/whisper-wasm/src/index.ts+++ b/packages/whisper-web/src/index.ts@@ -2,8 +2,8 @@ import type {CanUseWhisperWasmResult,canUseWhisperWasm as originalCanUseWhisperWasm,WhisperWasmUnsupportedReason,-} from './can-use-whisper-wasm';-import type {WhisperWasmLanguage, WhisperWasmModel} from './constants';+} from './can-use-whisper-web';+import type {WhisperWebLanguage, WhisperWebModel} from './constants';import type {deleteModel as originalDeleteModel} from './delete-model';import type {DownloadWhisperModelOnProgress,@@ -24,37 +24,37 @@ import type {export const transcribe: typeof originalTranscribe = () => {throw new Error(- 'Loading this module from CommonJS is not supported. Load the ESM version of @remotion/whisper-wasm.',+ 'Loading this module from CommonJS is not supported. Load the ESM version of @remotion/whisper-web.',);};export const downloadWhisperModel: typeof originalDownloadWhisperModel = () => {throw new Error(- 'Loading this module from CommonJS is not supported. Load the ESM version of @remotion/whisper-wasm.',+ 'Loading this module from CommonJS is not supported. Load the ESM version of @remotion/whisper-web.',);};export const getLoadedModels: typeof originalGetLoadedModels = () => {throw new Error(- 'Loading this module from CommonJS is not supported. Load the ESM version of @remotion/whisper-wasm.',+ 'Loading this module from CommonJS is not supported. Load the ESM version of @remotion/whisper-web.',);};export const deleteModel: typeof originalDeleteModel = () => {throw new Error(- 'Loading this module from CommonJS is not supported. Load the ESM version of @remotion/whisper-wasm.',+ 'Loading this module from CommonJS is not supported. Load the ESM version of @remotion/whisper-web.',);};export const canUseWhisperWasm: typeof originalCanUseWhisperWasm = () => {throw new Error(- 'Loading this module from CommonJS is not supported. Load the ESM version of @remotion/whisper-wasm.',+ 'Loading this module from CommonJS is not supported. Load the ESM version of @remotion/whisper-web.',);};export const resampleTo16Khz: typeof originalResampleTo16Khz = () => {throw new Error(- 'Loading this module from CommonJS is not supported. Load the ESM version of @remotion/whisper-wasm.',+ 'Loading this module from CommonJS is not supported. Load the ESM version of @remotion/whisper-web.',);};@@ -66,7 +66,7 @@ export type {DownloadWhisperModelResult,ResampleTo16KhzParams,TranscribeParams,- WhisperWasmLanguage,- WhisperWasmModel,+ WhisperWebLanguage as WhisperWasmLanguage,+ WhisperWebModel as WhisperWasmModel,WhisperWasmUnsupportedReason,};diff --git a/packages/whisper-wasm/src/load-mod/load-mod.ts b/packages/whisper-web/src/load-mod/load-mod.tssimilarity index 90%rename from packages/whisper-wasm/src/load-mod/load-mod.tsrename to packages/whisper-web/src/load-mod/load-mod.tsindex 460b59abf6..119edb72b8 100644--- a/packages/whisper-wasm/src/load-mod/load-mod.ts+++ b/packages/whisper-web/src/load-mod/load-mod.ts@@ -1,6 +1,6 @@// ⚠️⚠️⚠️⚠️⚠️!! Intentionally putting this in a subdirectory, so it is 2 directories deep// That way it can be imported when the output is dist/esm/index.js-import type {MainModule} from '../../main';+import type {MainModule} from '../../main.js';export const loadMod = async () => {// According to MDN, this is allowed:diff --git a/packages/whisper-wasm/src/log.ts b/packages/whisper-web/src/log.tssimilarity index 100%rename from packages/whisper-wasm/src/log.tsrename to packages/whisper-web/src/log.tsdiff --git a/packages/whisper-wasm/src/mod.ts b/packages/whisper-web/src/mod.tssimilarity index 100%rename from packages/whisper-wasm/src/mod.tsrename to packages/whisper-web/src/mod.tsdiff --git a/packages/whisper-wasm/src/print-handler.ts b/packages/whisper-web/src/print-handler.tssimilarity index 100%rename from packages/whisper-wasm/src/print-handler.tsrename to packages/whisper-web/src/print-handler.tsdiff --git a/packages/whisper-wasm/src/resample-to-16khz.ts b/packages/whisper-web/src/resample-to-16khz.tssimilarity index 100%rename from packages/whisper-wasm/src/resample-to-16khz.tsrename to packages/whisper-web/src/resample-to-16khz.tsdiff --git a/packages/whisper-wasm/src/result.ts b/packages/whisper-web/src/result.tssimilarity index 100%rename from packages/whisper-wasm/src/result.tsrename to packages/whisper-web/src/result.tsdiff --git a/packages/whisper-wasm/src/simulate-progress.ts b/packages/whisper-web/src/simulate-progress.tssimilarity index 100%rename from packages/whisper-wasm/src/simulate-progress.tsrename to packages/whisper-web/src/simulate-progress.tsdiff --git a/packages/whisper-wasm/src/transcribe.ts b/packages/whisper-web/src/transcribe.tssimilarity index 97%rename from packages/whisper-wasm/src/transcribe.tsrename to packages/whisper-web/src/transcribe.tsindex 2b42743ad7..61891098ea 100644--- a/packages/whisper-wasm/src/transcribe.ts+++ b/packages/whisper-web/src/transcribe.ts@@ -1,6 +1,6 @@/* eslint-disable new-cap */import type {MainModule} from '../main';-import type {WhisperWasmLanguage, WhisperWasmModel} from './constants';+import type {WhisperWebLanguage, WhisperWebModel} from './constants';import {getObject} from './db/get-object-from-db';import {getModelUrl} from './get-model-url';import {loadMod} from './load-mod/load-mod';@@ -38,8 +38,8 @@ const withResolvers = function <T>() {export type TranscribeParams = {channelWaveform: Float32Array;- model: WhisperWasmModel;- language?: WhisperWasmLanguage;+ model: WhisperWebModel;+ language?: WhisperWebLanguage;onProgress?: (p: number) => void;onTranscriptionChunk?: (transcription: TranscriptionItemWithTimestamp[],diff --git a/packages/whisper-wasm/src/transcription-speed.ts b/packages/whisper-web/src/transcription-speed.tssimilarity index 84%rename from packages/whisper-wasm/src/transcription-speed.tsrename to packages/whisper-web/src/transcription-speed.tsindex 50b621a886..8b7923d07a 100644--- a/packages/whisper-wasm/src/transcription-speed.ts+++ b/packages/whisper-web/src/transcription-speed.ts@@ -1,6 +1,6 @@export const storeActualTranscriptionSpeed = (speed: number) => {window.localStorage.setItem(- 'remotion-whisper-wasm-transcription-speed',+ 'remotion-whisper-web-transcription-speed',speed.toString(),);};@@ -11,7 +11,7 @@ export const NEW_PROGRESS_EVENT_EVERY_N_SECONDS = 30;export const getActualTranscriptionSpeedInMilliseconds = () => {const speed = window.localStorage.getItem(- 'remotion-whisper-wasm-transcription-speed',+ 'remotion-whisper-web-transcription-speed',);if (!speed) {return DEFAULT_ASSUMED_SPEED * NEW_PROGRESS_EVENT_EVERY_N_SECONDS * 1000;diff --git a/packages/whisper-wasm/tsconfig.json b/packages/whisper-web/tsconfig.jsonsimilarity index 100%rename from packages/whisper-wasm/tsconfig.jsonrename to packages/whisper-web/tsconfig.jsondiff --git a/packages/whisper-wasm/worker.js b/packages/whisper-web/worker.jssimilarity index 100%rename from packages/whisper-wasm/worker.jsrename to packages/whisper-web/worker.jsdiff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex 31f6c8679e..83b8b27b0e 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -689,9 +689,9 @@ importers:'@remotion/webcodecs':specifier: workspace:*version: link:../webcodecs- '@remotion/whisper-wasm':+ '@remotion/whisper-web':specifier: workspace:*- version: link:../whisper-wasm+ version: link:../whisper-web'@remotion/zod-types':specifier: workspace:*version: link:../zod-types@@ -1064,9 +1064,9 @@ importers:'@remotion/webcodecs':specifier: workspace:*version: link:../webcodecs- '@remotion/whisper-wasm':+ '@remotion/whisper-web':specifier: workspace:*- version: link:../whisper-wasm+ version: link:../whisper-web'@remotion/zod-types':specifier: workspace:*version: link:../zod-types@@ -3509,7 +3509,7 @@ importers:specifier: 1.51.1version: 1.51.1- packages/whisper-wasm:+ packages/whisper-web:devDependencies:'@remotion/eslint-config-internal':specifier: workspace:*@@ -30441,7 +30441,7 @@ packages:optional: truedependencies:'@types/eslint-scope': 3.7.7- '@types/estree': 1.0.6+ '@types/estree': 1.0.7'@webassemblyjs/ast': 1.12.1'@webassemblyjs/wasm-edit': 1.12.1'@webassemblyjs/wasm-parser': 1.12.1@@ -30479,7 +30479,7 @@ packages:optional: truedependencies:'@types/eslint-scope': 3.7.7- '@types/estree': 1.0.6+ '@types/estree': 1.0.7'@webassemblyjs/ast': 1.12.1'@webassemblyjs/wasm-edit': 1.12.1'@webassemblyjs/wasm-parser': 1.12.1@@ -30518,7 +30518,7 @@ packages:optional: truedependencies:'@types/eslint-scope': 3.7.7- '@types/estree': 1.0.6+ '@types/estree': 1.0.7'@webassemblyjs/ast': 1.12.1'@webassemblyjs/wasm-edit': 1.12.1'@webassemblyjs/wasm-parser': 1.12.1