@mcut/transcription-local 0.1.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +187 -0
- package/README.md +11 -0
- package/dist/index.d.ts +174 -0
- package/dist/index.js +357 -0
- package/dist/whisper-worker.js +29053 -0
- package/package.json +58 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
https://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction, and
|
|
10
|
+
distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by the
|
|
13
|
+
copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all other
|
|
16
|
+
entities that control, are controlled by, or are under common control with
|
|
17
|
+
that entity. For the purposes of this definition, "control" means (i) the
|
|
18
|
+
power, direct or indirect, to cause the direction or management of such
|
|
19
|
+
entity, whether by contract or otherwise, or (ii) ownership of fifty percent
|
|
20
|
+
(50%) or more of the outstanding shares, or (iii) beneficial ownership of
|
|
21
|
+
such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity exercising
|
|
24
|
+
permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation source, and
|
|
28
|
+
configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical transformation
|
|
31
|
+
or translation of a Source form, including but not limited to compiled object
|
|
32
|
+
code, generated documentation, and conversions to other media types.
|
|
33
|
+
|
|
34
|
+
"Work" shall mean the work of authorship, whether in Source or Object form,
|
|
35
|
+
made available under the License, as indicated by a copyright notice that is
|
|
36
|
+
included in or attached to the work (an example is provided in the Appendix
|
|
37
|
+
below).
|
|
38
|
+
|
|
39
|
+
"Derivative Works" shall mean any work, whether in Source or Object form,
|
|
40
|
+
that is based on (or derived from) the Work and for which the editorial
|
|
41
|
+
revisions, annotations, elaborations, or other modifications represent, as a
|
|
42
|
+
whole, an original work of authorship. For the purposes of this License,
|
|
43
|
+
Derivative Works shall not include works that remain separable from, or
|
|
44
|
+
merely link (or bind by name) to the interfaces of, the Work and Derivative
|
|
45
|
+
Works thereof.
|
|
46
|
+
|
|
47
|
+
"Contribution" shall mean any work of authorship, including the original
|
|
48
|
+
version of the Work and any modifications or additions to that Work or
|
|
49
|
+
Derivative Works thereof, that is intentionally submitted to Licensor for
|
|
50
|
+
inclusion in the Work by the copyright owner or by an individual or Legal
|
|
51
|
+
Entity authorized to submit on behalf of the copyright owner. For the
|
|
52
|
+
purposes of this definition, "submitted" means any form of electronic,
|
|
53
|
+
verbal, or written communication sent to the Licensor or its representatives,
|
|
54
|
+
including but not limited to communication on electronic mailing lists,
|
|
55
|
+
source code control systems, and issue tracking systems that are managed by,
|
|
56
|
+
or on behalf of, the Licensor for the purpose of discussing and improving the
|
|
57
|
+
Work, but excluding communication that is conspicuously marked or otherwise
|
|
58
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
59
|
+
|
|
60
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity on
|
|
61
|
+
behalf of whom a Contribution has been received by Licensor and subsequently
|
|
62
|
+
incorporated within the Work.
|
|
63
|
+
|
|
64
|
+
2. Grant of Copyright License. Subject to the terms and conditions of this
|
|
65
|
+
License, each Contributor hereby grants to You a perpetual, worldwide,
|
|
66
|
+
non-exclusive, no-charge, royalty-free, irrevocable copyright license to
|
|
67
|
+
reproduce, prepare Derivative Works of, publicly display, publicly perform,
|
|
68
|
+
sublicense, and distribute the Work and such Derivative Works in Source or
|
|
69
|
+
Object form.
|
|
70
|
+
|
|
71
|
+
3. Grant of Patent License. Subject to the terms and conditions of this
|
|
72
|
+
License, each Contributor hereby grants to You a perpetual, worldwide,
|
|
73
|
+
non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this
|
|
74
|
+
section) patent license to make, have made, use, offer to sell, sell, import,
|
|
75
|
+
and otherwise transfer the Work, where such license applies only to those
|
|
76
|
+
patent claims licensable by such Contributor that are necessarily infringed
|
|
77
|
+
by their Contribution(s) alone or by combination of their Contribution(s)
|
|
78
|
+
with the Work to which such Contribution(s) was submitted. If You institute
|
|
79
|
+
patent litigation against any entity (including a cross-claim or counterclaim
|
|
80
|
+
in a lawsuit) alleging that the Work or a Contribution incorporated within
|
|
81
|
+
the Work constitutes direct or contributory patent infringement, then any
|
|
82
|
+
patent licenses granted to You under this License for that Work shall
|
|
83
|
+
terminate as of the date such litigation is filed.
|
|
84
|
+
|
|
85
|
+
4. Redistribution. You may reproduce and distribute copies of the Work or
|
|
86
|
+
Derivative Works thereof in any medium, with or without modifications, and in
|
|
87
|
+
Source or Object form, provided that You meet the following conditions:
|
|
88
|
+
|
|
89
|
+
(a) You must give any other recipients of the Work or Derivative Works a
|
|
90
|
+
copy of this License; and
|
|
91
|
+
|
|
92
|
+
(b) You must cause any modified files to carry prominent notices stating that
|
|
93
|
+
You changed the files; and
|
|
94
|
+
|
|
95
|
+
(c) You must retain, in the Source form of any Derivative Works that You
|
|
96
|
+
distribute, all copyright, patent, trademark, and attribution notices from
|
|
97
|
+
the Source form of the Work, excluding those notices that do not pertain to
|
|
98
|
+
any part of the Derivative Works; and
|
|
99
|
+
|
|
100
|
+
(d) If the Work includes a "NOTICE" text file as part of its distribution,
|
|
101
|
+
then any Derivative Works that You distribute must include a readable copy of
|
|
102
|
+
the attribution notices contained within such NOTICE file, excluding those
|
|
103
|
+
notices that do not pertain to any part of the Derivative Works, in at least
|
|
104
|
+
one of the following places: within a NOTICE text file distributed as part of
|
|
105
|
+
the Derivative Works; within the Source form or documentation, if provided
|
|
106
|
+
along with the Derivative Works; or, within a display generated by the
|
|
107
|
+
Derivative Works, if and wherever such third-party notices normally appear.
|
|
108
|
+
The contents of the NOTICE file are for informational purposes only and do
|
|
109
|
+
not modify the License. You may add Your own attribution notices within
|
|
110
|
+
Derivative Works that You distribute, alongside or as an addendum to the
|
|
111
|
+
NOTICE text from the Work, provided that such additional attribution notices
|
|
112
|
+
cannot be construed as modifying the License.
|
|
113
|
+
|
|
114
|
+
You may add Your own copyright statement to Your modifications and may
|
|
115
|
+
provide additional or different license terms and conditions for use,
|
|
116
|
+
reproduction, or distribution of Your modifications, or for any such
|
|
117
|
+
Derivative Works as a whole, provided Your use, reproduction, and
|
|
118
|
+
distribution of the Work otherwise complies with the conditions stated in
|
|
119
|
+
this License.
|
|
120
|
+
|
|
121
|
+
5. Submission of Contributions. Unless You explicitly state otherwise, any
|
|
122
|
+
Contribution intentionally submitted for inclusion in the Work by You to the
|
|
123
|
+
Licensor shall be under the terms and conditions of this License, without any
|
|
124
|
+
additional terms or conditions. Notwithstanding the above, nothing herein
|
|
125
|
+
shall supersede or modify the terms of any separate license agreement you may
|
|
126
|
+
have executed with Licensor regarding such Contributions.
|
|
127
|
+
|
|
128
|
+
6. Trademarks. This License does not grant permission to use the trade names,
|
|
129
|
+
trademarks, service marks, or product names of the Licensor, except as
|
|
130
|
+
required for reasonable and customary use in describing the origin of the
|
|
131
|
+
Work and reproducing the content of the NOTICE file.
|
|
132
|
+
|
|
133
|
+
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in
|
|
134
|
+
writing, Licensor provides the Work (and each Contributor provides its
|
|
135
|
+
Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
136
|
+
KIND, either express or implied, including, without limitation, any warranties
|
|
137
|
+
or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
138
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
139
|
+
appropriateness of using or redistributing the Work and assume any risks
|
|
140
|
+
associated with Your exercise of permissions under this License.
|
|
141
|
+
|
|
142
|
+
8. Limitation of Liability. In no event and under no legal theory, whether in
|
|
143
|
+
tort (including negligence), contract, or otherwise, unless required by
|
|
144
|
+
applicable law (such as deliberate and grossly negligent acts) or agreed to
|
|
145
|
+
in writing, shall any Contributor be liable to You for damages, including any
|
|
146
|
+
direct, indirect, special, incidental, or consequential damages of any
|
|
147
|
+
character arising as a result of this License or out of the use or inability
|
|
148
|
+
to use the Work (including but not limited to damages for loss of goodwill,
|
|
149
|
+
work stoppage, computer failure or malfunction, or any and all other
|
|
150
|
+
commercial damages or losses), even if such Contributor has been advised of
|
|
151
|
+
the possibility of such damages.
|
|
152
|
+
|
|
153
|
+
9. Accepting Warranty or Additional Liability. While redistributing the Work
|
|
154
|
+
or Derivative Works thereof, You may choose to offer, and charge a fee for,
|
|
155
|
+
acceptance of support, warranty, indemnity, or other liability obligations
|
|
156
|
+
and/or rights consistent with this License. However, in accepting such
|
|
157
|
+
obligations, You may act only on Your own behalf and on Your sole
|
|
158
|
+
responsibility, not on behalf of any other Contributor, and only if You agree
|
|
159
|
+
to indemnify, defend, and hold each Contributor harmless for any liability
|
|
160
|
+
incurred by, or claims asserted against, such Contributor by reason of your
|
|
161
|
+
accepting any such warranty or additional liability.
|
|
162
|
+
|
|
163
|
+
END OF TERMS AND CONDITIONS
|
|
164
|
+
|
|
165
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
166
|
+
|
|
167
|
+
To apply the Apache License to your work, attach the following boilerplate
|
|
168
|
+
notice, with the fields enclosed by brackets "[]" replaced with your own
|
|
169
|
+
identifying information. (Don't include the brackets!) The text should be
|
|
170
|
+
enclosed in the appropriate comment syntax for the file format. We also
|
|
171
|
+
recommend that a file or class name and description of purpose be included on
|
|
172
|
+
the same "printed page" as the copyright notice for easier identification
|
|
173
|
+
within third-party archives.
|
|
174
|
+
|
|
175
|
+
Copyright [yyyy] [name of copyright owner]
|
|
176
|
+
|
|
177
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
178
|
+
you may not use this file except in compliance with the License.
|
|
179
|
+
You may obtain a copy of the License at
|
|
180
|
+
|
|
181
|
+
https://www.apache.org/licenses/LICENSE-2.0
|
|
182
|
+
|
|
183
|
+
Unless required by applicable law or agreed to in writing, software
|
|
184
|
+
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
185
|
+
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
186
|
+
See the License for the specific language governing permissions and
|
|
187
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# @mcut/transcription-local
|
|
2
|
+
|
|
3
|
+
On-device Whisper transcription provider for mcut.
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
bun add @mcut/transcription-local @mcut/transcription
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
This package runs local transcription through Transformers.js in a browser
|
|
10
|
+
worker. It includes chunk planning, repetition guards, VAD helpers, and a
|
|
11
|
+
self-contained worker bundle for WebGPU-capable browser environments.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { TranscriptResult, TranscriptSegment, TranscriptWord, TranscriptionProvider } from "@mcut/transcription";
|
|
2
|
+
|
|
3
|
+
//#region src/protocol.d.ts
|
|
4
|
+
/** Wire protocol between the provider façade and the Whisper worker. */
|
|
5
|
+
/** Quantization levels the worker accepts (transformers.js DataType subset). */
|
|
6
|
+
type WhisperDtype = 'auto' | 'fp32' | 'fp16' | 'q8' | 'int8' | 'uint8' | 'q4' | 'q4f16';
|
|
7
|
+
interface WhisperWorkerConfig {
|
|
8
|
+
/** HF model id, e.g. "onnx-community/whisper-base". */
|
|
9
|
+
model: string;
|
|
10
|
+
device: 'webgpu' | 'wasm';
|
|
11
|
+
/** Quantization, e.g. "q8". */
|
|
12
|
+
dtype: WhisperDtype;
|
|
13
|
+
}
|
|
14
|
+
interface WhisperTranscribeRequest {
|
|
15
|
+
type: 'transcribe';
|
|
16
|
+
id: number;
|
|
17
|
+
config: WhisperWorkerConfig;
|
|
18
|
+
/** Mono PCM at 16kHz (transferred). */
|
|
19
|
+
audio: Float32Array;
|
|
20
|
+
language?: string;
|
|
21
|
+
}
|
|
22
|
+
type WhisperWorkerRequest = WhisperTranscribeRequest;
|
|
23
|
+
type WhisperWorkerResponse = {
|
|
24
|
+
type: 'ready';
|
|
25
|
+
} | {
|
|
26
|
+
type: 'progress';
|
|
27
|
+
id: number; /** 0–1 within the phase. */
|
|
28
|
+
progress: number; /** Model download/load vs. actual transcription. */
|
|
29
|
+
phase: 'model' | 'transcribe';
|
|
30
|
+
} | {
|
|
31
|
+
type: 'result';
|
|
32
|
+
id: number;
|
|
33
|
+
result: TranscriptResult;
|
|
34
|
+
} | {
|
|
35
|
+
type: 'error';
|
|
36
|
+
id: number;
|
|
37
|
+
message: string;
|
|
38
|
+
};
|
|
39
|
+
//#endregion
|
|
40
|
+
//#region src/chunking.d.ts
|
|
41
|
+
/**
|
|
42
|
+
* Chunked-streaming plan for long audio: fixed windows with overlap, merged
|
|
43
|
+
* back together on word timestamps. Whisper's native receptive field is 30s;
|
|
44
|
+
* processing window-by-window keeps the tab responsive (progress per chunk)
|
|
45
|
+
* and lets the worker skip non-speech windows and retry hallucinating ones
|
|
46
|
+
* without redoing the whole file.
|
|
47
|
+
*/
|
|
48
|
+
interface AudioChunk {
|
|
49
|
+
/** Window start in the source audio, seconds. */
|
|
50
|
+
startS: number;
|
|
51
|
+
/** Window end (exclusive), seconds. */
|
|
52
|
+
endS: number;
|
|
53
|
+
}
|
|
54
|
+
declare const CHUNK_WINDOW_S = 30;
|
|
55
|
+
declare const CHUNK_OVERLAP_S = 5;
|
|
56
|
+
/** Split a duration into overlapping windows (last window may be shorter). */
|
|
57
|
+
declare function planChunks(durationS: number, windowS?: number, overlapS?: number): AudioChunk[];
|
|
58
|
+
interface ChunkResult {
|
|
59
|
+
chunk: AudioChunk;
|
|
60
|
+
/** Words with ABSOLUTE timestamps (chunk offset already applied), ms. */
|
|
61
|
+
words: TranscriptWord[];
|
|
62
|
+
}
|
|
63
|
+
interface ChunkSegmentResult {
|
|
64
|
+
chunk: AudioChunk;
|
|
65
|
+
/** Segments with ABSOLUTE timestamps (chunk offset already applied), ms. */
|
|
66
|
+
segments: TranscriptSegment[];
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Merge consecutive chunk transcripts on word timestamps rather than
|
|
70
|
+
* concatenating: inside each overlap the cut lands on the largest silence
|
|
71
|
+
* between the incoming chunk's words (falling back to the overlap midpoint),
|
|
72
|
+
* the outgoing chunk keeps words before the cut, the incoming one after.
|
|
73
|
+
* This absorbs the timestamp drift Whisper accumulates near window edges.
|
|
74
|
+
*/
|
|
75
|
+
declare function mergeChunkWords(results: ChunkResult[]): TranscriptWord[];
|
|
76
|
+
/** Same overlap-cut strategy as {@link mergeChunkWords}, for segment-timed models. */
|
|
77
|
+
declare function mergeChunkSegments(results: ChunkSegmentResult[]): TranscriptSegment[];
|
|
78
|
+
//#endregion
|
|
79
|
+
//#region src/repetition.d.ts
|
|
80
|
+
/**
|
|
81
|
+
* Whisper's classic failure mode on silence/noise: the decoder locks into a
|
|
82
|
+
* loop and emits the same phrase over and over. Detect n-gram repetition so
|
|
83
|
+
* the worker can drop the chunk and retry with a temperature bump.
|
|
84
|
+
*/
|
|
85
|
+
interface RepetitionOptions {
|
|
86
|
+
/** Longest phrase length (in tokens) checked for looping. Default 4. */
|
|
87
|
+
maxNgram?: number;
|
|
88
|
+
/** Consecutive repeats that count as a loop. Default 4 (3 for bigrams+). */
|
|
89
|
+
minRepeats?: number;
|
|
90
|
+
}
|
|
91
|
+
/** True when the token stream ends up looping the same n-gram. */
|
|
92
|
+
declare function hasRepetitionLoop(tokens: readonly string[], options?: RepetitionOptions): boolean;
|
|
93
|
+
/** Convenience for plain text output. */
|
|
94
|
+
declare function textHasRepetitionLoop(text: string, options?: RepetitionOptions): boolean;
|
|
95
|
+
//#endregion
|
|
96
|
+
//#region src/vad.d.ts
|
|
97
|
+
/**
|
|
98
|
+
* Lightweight energy-based voice activity pre-pass: windows that are
|
|
99
|
+
* essentially silent never reach the model, which is where Whisper
|
|
100
|
+
* hallucinates text. Deliberately conservative — it only skips clear
|
|
101
|
+
* silence, anything ambiguous (music, low speech) still gets transcribed.
|
|
102
|
+
* The seam is shaped so a silero-vad WASM pass can replace it later.
|
|
103
|
+
*/
|
|
104
|
+
interface SpeechActivity {
|
|
105
|
+
/** Fraction of frames above the activity threshold (0–1). */
|
|
106
|
+
activeFraction: number;
|
|
107
|
+
/** Peak frame RMS. */
|
|
108
|
+
peakRms: number;
|
|
109
|
+
}
|
|
110
|
+
declare function measureActivity(samples: Float32Array, sampleRate: number): SpeechActivity;
|
|
111
|
+
/** Whether a window plausibly contains any speech at all. */
|
|
112
|
+
declare function hasSpeech(samples: Float32Array, sampleRate: number): boolean;
|
|
113
|
+
//#endregion
|
|
114
|
+
//#region src/wav.d.ts
|
|
115
|
+
/**
|
|
116
|
+
* Minimal WAV reader → 16kHz mono Float32Array (Whisper's input format).
|
|
117
|
+
* The editor extracts clip audio as 16kHz WAV already (`extractAudioToWav`),
|
|
118
|
+
* so this covers the hot path without any AudioContext — it runs in workers
|
|
119
|
+
* and tests alike. Non-WAV input falls back to decodeAudioData upstream.
|
|
120
|
+
*/
|
|
121
|
+
declare const WHISPER_SAMPLE_RATE = 16000;
|
|
122
|
+
interface DecodedAudio {
|
|
123
|
+
samples: Float32Array;
|
|
124
|
+
sampleRate: number;
|
|
125
|
+
}
|
|
126
|
+
/** Parse a PCM/float WAV file. Returns null when it isn't one. */
|
|
127
|
+
declare function parseWav(buffer: ArrayBuffer): DecodedAudio | null;
|
|
128
|
+
/** Linear-interpolation resample (fine for speech models). */
|
|
129
|
+
declare function resampleTo(audio: DecodedAudio, targetRate: number): Float32Array;
|
|
130
|
+
//#endregion
|
|
131
|
+
//#region src/index.d.ts
|
|
132
|
+
/**
|
|
133
|
+
* On-device Whisper provider (Transformers.js in a dedicated worker).
|
|
134
|
+
* Reliability over flash: capability-gated hard (WebGPU + enough memory),
|
|
135
|
+
* chunked with per-window progress, VAD + repetition guards in the worker.
|
|
136
|
+
* On-device is OFFERED, never forced — keep a server provider as the
|
|
137
|
+
* default and let users opt in (the model is a 40–150MB one-time download,
|
|
138
|
+
* cached by the browser after that).
|
|
139
|
+
*/
|
|
140
|
+
/** Built-in model choices (ONNX community builds of OpenAI Whisper). */
|
|
141
|
+
declare const WHISPER_MODELS: {
|
|
142
|
+
/** Multilingual, ~145MB at q8 — the WebGPU default. */readonly base: "onnx-community/whisper-base"; /** English-only, ~40MB — the low-memory default. */
|
|
143
|
+
readonly 'tiny.en': "onnx-community/whisper-tiny.en";
|
|
144
|
+
};
|
|
145
|
+
/**
|
|
146
|
+
* Hard capability gate: WebGPU plus ≥4GB device memory. Browsers that don't
|
|
147
|
+
* report `deviceMemory` (Safari/Firefox) pass on WebGPU alone — the spec
|
|
148
|
+
* caps reported values at 8 anyway.
|
|
149
|
+
*/
|
|
150
|
+
declare function isLocalTranscriptionSupported(): boolean;
|
|
151
|
+
/** whisper-base on roomy machines, whisper-tiny.en when memory is tight. */
|
|
152
|
+
declare function pickDefaultModel(): string;
|
|
153
|
+
interface LocalWhisperProgress {
|
|
154
|
+
/** 'model' while downloading/loading weights, then 'transcribe'. */
|
|
155
|
+
phase: 'model' | 'transcribe';
|
|
156
|
+
/** 0–1 within the phase. */
|
|
157
|
+
progress: number;
|
|
158
|
+
}
|
|
159
|
+
interface CreateLocalWhisperProviderOptions {
|
|
160
|
+
/** A {@link WHISPER_MODELS} key or any HF ASR model id. Default {@link pickDefaultModel}. */
|
|
161
|
+
model?: keyof typeof WHISPER_MODELS | (string & {});
|
|
162
|
+
/** Inference device. Default 'webgpu'. */
|
|
163
|
+
device?: 'webgpu' | 'wasm';
|
|
164
|
+
/** Quantization. Default 'q8'. */
|
|
165
|
+
dtype?: WhisperDtype;
|
|
166
|
+
/** Model download + transcription progress. */
|
|
167
|
+
onProgress?: (progress: LocalWhisperProgress) => void;
|
|
168
|
+
/** Override worker creation (custom bundling setups). */
|
|
169
|
+
createWorker?: () => Worker;
|
|
170
|
+
id?: string;
|
|
171
|
+
}
|
|
172
|
+
declare function createLocalWhisperProvider(options?: CreateLocalWhisperProviderOptions): TranscriptionProvider;
|
|
173
|
+
//#endregion
|
|
174
|
+
export { type AudioChunk, CHUNK_OVERLAP_S, CHUNK_WINDOW_S, type ChunkResult, type ChunkSegmentResult, CreateLocalWhisperProviderOptions, type DecodedAudio, LocalWhisperProgress, type RepetitionOptions, type SpeechActivity, WHISPER_MODELS, WHISPER_SAMPLE_RATE, type WhisperDtype, type WhisperWorkerConfig, type WhisperWorkerRequest, type WhisperWorkerResponse, createLocalWhisperProvider, hasRepetitionLoop, hasSpeech, isLocalTranscriptionSupported, measureActivity, mergeChunkSegments, mergeChunkWords, parseWav, pickDefaultModel, planChunks, resampleTo, textHasRepetitionLoop };
|