@whisper-cpp-node/core 0.1.0 → 0.1.2
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/README.md +130 -18
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +84 -14
- package/dist/types.d.ts.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -28,6 +28,8 @@ The platform-specific binary (`@whisper-cpp-node/darwin-arm64`) is automatically
|
|
|
28
28
|
|
|
29
29
|
## Quick Start
|
|
30
30
|
|
|
31
|
+
### File-based transcription
|
|
32
|
+
|
|
31
33
|
```typescript
|
|
32
34
|
import {
|
|
33
35
|
createWhisperContext,
|
|
@@ -40,18 +42,48 @@ const ctx = createWhisperContext({
|
|
|
40
42
|
use_gpu: true,
|
|
41
43
|
});
|
|
42
44
|
|
|
43
|
-
// Transcribe audio
|
|
45
|
+
// Transcribe audio file
|
|
44
46
|
const result = await transcribeAsync(ctx, {
|
|
45
47
|
fname_inp: "./audio.wav",
|
|
46
48
|
language: "en",
|
|
47
49
|
});
|
|
48
50
|
|
|
49
|
-
|
|
51
|
+
// Result: { segments: [["00:00:00,000", "00:00:02,500", " Hello world"], ...] }
|
|
52
|
+
for (const [start, end, text] of result.segments) {
|
|
53
|
+
console.log(`[${start} --> ${end}]${text}`);
|
|
54
|
+
}
|
|
50
55
|
|
|
51
56
|
// Clean up
|
|
52
57
|
ctx.free();
|
|
53
58
|
```
|
|
54
59
|
|
|
60
|
+
### Buffer-based transcription
|
|
61
|
+
|
|
62
|
+
```typescript
|
|
63
|
+
import {
|
|
64
|
+
createWhisperContext,
|
|
65
|
+
transcribeAsync,
|
|
66
|
+
} from "@whisper-cpp-node/core";
|
|
67
|
+
|
|
68
|
+
const ctx = createWhisperContext({
|
|
69
|
+
model: "./models/ggml-base.en.bin",
|
|
70
|
+
use_gpu: true,
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
// Pass raw PCM audio (16kHz, mono, float32)
|
|
74
|
+
const pcmData = new Float32Array(/* your audio samples */);
|
|
75
|
+
const result = await transcribeAsync(ctx, {
|
|
76
|
+
pcmf32: pcmData,
|
|
77
|
+
language: "en",
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
for (const [start, end, text] of result.segments) {
|
|
81
|
+
console.log(`[${start} --> ${end}]${text}`);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
ctx.free();
|
|
85
|
+
```
|
|
86
|
+
|
|
55
87
|
## API
|
|
56
88
|
|
|
57
89
|
### `createWhisperContext(options)`
|
|
@@ -72,30 +104,82 @@ interface WhisperContextOptions {
|
|
|
72
104
|
|
|
73
105
|
### `transcribeAsync(context, options)`
|
|
74
106
|
|
|
75
|
-
Transcribe audio
|
|
107
|
+
Transcribe audio (Promise-based). Accepts either a file path or PCM buffer.
|
|
76
108
|
|
|
77
109
|
```typescript
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
110
|
+
// File input
|
|
111
|
+
interface TranscribeOptionsFile {
|
|
112
|
+
fname_inp: string; // Path to audio file
|
|
113
|
+
// ... common options
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// Buffer input
|
|
117
|
+
interface TranscribeOptionsBuffer {
|
|
118
|
+
pcmf32: Float32Array; // Raw PCM (16kHz, mono, float32, -1.0 to 1.0)
|
|
119
|
+
// ... common options
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// Common options (partial list - see types.ts for full options)
|
|
123
|
+
interface TranscribeOptionsBase {
|
|
124
|
+
// Language
|
|
125
|
+
language?: string; // Language code ('en', 'zh', 'auto')
|
|
81
126
|
translate?: boolean; // Translate to English
|
|
82
|
-
|
|
127
|
+
detect_language?: boolean; // Auto-detect language
|
|
128
|
+
|
|
129
|
+
// Threading
|
|
130
|
+
n_threads?: number; // CPU threads (default: 4)
|
|
131
|
+
n_processors?: number; // Parallel processors
|
|
132
|
+
|
|
133
|
+
// Audio processing
|
|
134
|
+
offset_ms?: number; // Start offset in ms
|
|
135
|
+
duration_ms?: number; // Duration to process (0 = all)
|
|
136
|
+
|
|
137
|
+
// Output control
|
|
83
138
|
no_timestamps?: boolean; // Disable timestamps
|
|
84
|
-
//
|
|
139
|
+
max_len?: number; // Max segment length (chars)
|
|
140
|
+
max_tokens?: number; // Max tokens per segment
|
|
141
|
+
split_on_word?: boolean; // Split on word boundaries
|
|
142
|
+
token_timestamps?: boolean; // Include token-level timestamps
|
|
143
|
+
|
|
144
|
+
// Sampling
|
|
145
|
+
temperature?: number; // Sampling temperature (0.0 = greedy)
|
|
146
|
+
beam_size?: number; // Beam search size (-1 = greedy)
|
|
147
|
+
best_of?: number; // Best-of-N sampling
|
|
148
|
+
|
|
149
|
+
// Thresholds
|
|
150
|
+
entropy_thold?: number; // Entropy threshold
|
|
151
|
+
logprob_thold?: number; // Log probability threshold
|
|
152
|
+
no_speech_thold?: number; // No-speech probability threshold
|
|
153
|
+
|
|
154
|
+
// Context
|
|
155
|
+
prompt?: string; // Initial prompt text
|
|
156
|
+
no_context?: boolean; // Don't use previous context
|
|
157
|
+
|
|
158
|
+
// VAD preprocessing
|
|
159
|
+
vad?: boolean; // Enable VAD preprocessing
|
|
160
|
+
vad_model?: string; // Path to VAD model
|
|
161
|
+
vad_threshold?: number; // VAD threshold (0.0-1.0)
|
|
162
|
+
vad_min_speech_duration_ms?: number;
|
|
163
|
+
vad_min_silence_duration_ms?: number;
|
|
164
|
+
vad_speech_pad_ms?: number;
|
|
165
|
+
|
|
166
|
+
// Callbacks
|
|
167
|
+
progress_callback?: (progress: number) => void;
|
|
85
168
|
}
|
|
86
169
|
|
|
170
|
+
// Result
|
|
87
171
|
interface TranscribeResult {
|
|
88
|
-
segments:
|
|
89
|
-
start: string; // "HH:MM:SS,mmm"
|
|
90
|
-
end: string;
|
|
91
|
-
text: string;
|
|
92
|
-
}>;
|
|
172
|
+
segments: TranscriptSegment[];
|
|
93
173
|
}
|
|
174
|
+
|
|
175
|
+
// Segment is a tuple: [start, end, text]
|
|
176
|
+
type TranscriptSegment = [string, string, string];
|
|
177
|
+
// Example: ["00:00:00,000", "00:00:02,500", " Hello world"]
|
|
94
178
|
```
|
|
95
179
|
|
|
96
180
|
### `createVadContext(options)`
|
|
97
181
|
|
|
98
|
-
Create a voice activity detection context.
|
|
182
|
+
Create a voice activity detection context for streaming audio.
|
|
99
183
|
|
|
100
184
|
```typescript
|
|
101
185
|
interface VadContextOptions {
|
|
@@ -105,15 +189,39 @@ interface VadContextOptions {
|
|
|
105
189
|
no_prints?: boolean; // Suppress log output
|
|
106
190
|
}
|
|
107
191
|
|
|
108
|
-
|
|
192
|
+
interface VadContext {
|
|
193
|
+
getWindowSamples(): number; // Returns 512 (32ms at 16kHz)
|
|
194
|
+
getSampleRate(): number; // Returns 16000
|
|
195
|
+
process(samples: Float32Array): number; // Returns probability 0.0-1.0
|
|
196
|
+
reset(): void; // Reset LSTM state
|
|
197
|
+
free(): void; // Release resources
|
|
198
|
+
}
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
#### VAD Example
|
|
202
|
+
|
|
203
|
+
```typescript
|
|
204
|
+
import { createVadContext } from "@whisper-cpp-node/core";
|
|
205
|
+
|
|
109
206
|
const vad = createVadContext({
|
|
110
207
|
model: "./models/ggml-silero-v6.2.0.bin",
|
|
208
|
+
threshold: 0.5,
|
|
111
209
|
});
|
|
112
210
|
|
|
113
|
-
const
|
|
114
|
-
|
|
115
|
-
|
|
211
|
+
const windowSize = vad.getWindowSamples(); // 512 samples
|
|
212
|
+
|
|
213
|
+
// Process audio in 32ms chunks
|
|
214
|
+
function processAudioChunk(samples: Float32Array) {
|
|
215
|
+
const probability = vad.process(samples);
|
|
216
|
+
if (probability >= 0.5) {
|
|
217
|
+
console.log("Speech detected!", probability);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
116
220
|
|
|
221
|
+
// Reset when starting new audio stream
|
|
222
|
+
vad.reset();
|
|
223
|
+
|
|
224
|
+
// Clean up when done
|
|
117
225
|
vad.free();
|
|
118
226
|
```
|
|
119
227
|
|
|
@@ -153,6 +261,10 @@ curl -L -o models/ggml-base.en.bin \
|
|
|
153
261
|
# Large v3 Turbo quantized (~500MB)
|
|
154
262
|
curl -L -o models/ggml-large-v3-turbo-q4_0.bin \
|
|
155
263
|
https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-large-v3-turbo-q4_0.bin
|
|
264
|
+
|
|
265
|
+
# Silero VAD model (for streaming VAD)
|
|
266
|
+
curl -L -o models/ggml-silero-v6.2.0.bin \
|
|
267
|
+
https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-silero-v6.2.0.bin
|
|
156
268
|
```
|
|
157
269
|
|
|
158
270
|
## License
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { WhisperContext, WhisperContextOptions, VadContext, VadContextOptions, TranscribeOptions, TranscribeResult } from "./types";
|
|
2
|
-
export type { WhisperContextOptions, VadContextOptions, TranscribeOptions, TranscribeResult, TranscriptSegment, WhisperContext, VadContext, WhisperContextConstructor, VadContextConstructor, } from "./types";
|
|
2
|
+
export type { WhisperContextOptions, VadContextOptions, TranscribeOptions, TranscribeOptionsBase, TranscribeOptionsFile, TranscribeOptionsBuffer, TranscribeResult, TranscriptSegment, WhisperContext, VadContext, WhisperContextConstructor, VadContextConstructor, } from "./types";
|
|
3
3
|
export declare const WhisperContextClass: import("./types").WhisperContextConstructor;
|
|
4
4
|
export declare const VadContextClass: import("./types").VadContextConstructor;
|
|
5
5
|
export declare const transcribe: (context: WhisperContext, options: TranscribeOptions, callback: import("./types").TranscribeCallback) => void;
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAEV,cAAc,EACd,qBAAqB,EACrB,UAAU,EACV,iBAAiB,EACjB,iBAAiB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AAmB,CAAC;AAG3C,eAAO,MAAM,eAAe,EAAkC,CAC5D,OAAO,EAAE,cAAc,EACvB,OAAO,EAAE,iBAAiB,KACvB,OAAO,CAAC,gBAAgB,CAAC,CAAC;AAE/B;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,qBAAqB,GAC7B,cAAc,CAEhB;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,iBAAiB,GAAG,UAAU,CAEvE;;;;;+BAhDU,cAAc,WACd,iBAAiB,KACvB,OAAO,CAAC,gBAAgB,CAAC;;;;AAiD9B,wBAOE"}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAgEA,oDAIC;AAkBD,4CAEC;AAxFD,+BAAiC;AACjC,qCAA2C;AA2B3C,oBAAoB;AACpB,MAAM,KAAK,GAAiB,IAAA,wBAAe,GAAE,CAAC;AAE9C,oEAAoE;AACvD,QAAA,mBAAmB,GAAG,KAAK,CAAC,cAAc,CAAC;AAC3C,QAAA,eAAe,GAAG,KAAK,CAAC,UAAU,CAAC;AAEhD,qCAAqC;AACxB,QAAA,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC;AAE3C,sCAAsC;AACzB,QAAA,eAAe,GAAG,IAAA,gBAAS,EAAC,KAAK,CAAC,UAAU,CAG3B,CAAC;AAE/B;;;;;;;;;;;;;;;;;;;GAmBG;AACH,SAAgB,oBAAoB,CAClC,OAA8B;IAE9B,OAAO,IAAI,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;AAC3C,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,SAAgB,gBAAgB,CAAC,OAA0B;IACzD,OAAO,IAAI,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;AACvC,CAAC;AAED,wCAAwC;AACxC,kBAAe;IACb,cAAc,EAAE,KAAK,CAAC,cAAc;IACpC,UAAU,EAAE,KAAK,CAAC,UAAU;IAC5B,UAAU,EAAE,KAAK,CAAC,UAAU;IAC5B,eAAe,EAAf,uBAAe;IACf,oBAAoB;IACpB,gBAAgB;CACjB,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -18,48 +18,118 @@ export interface WhisperContextOptions {
|
|
|
18
18
|
no_prints?: boolean;
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
21
|
-
*
|
|
21
|
+
* Base transcription options (shared between file and buffer input)
|
|
22
22
|
*/
|
|
23
|
-
export interface
|
|
24
|
-
/** Path to the audio file */
|
|
25
|
-
fname_inp: string;
|
|
23
|
+
export interface TranscribeOptionsBase {
|
|
26
24
|
/** Language code (e.g., 'en', 'zh', 'auto') */
|
|
27
25
|
language?: string;
|
|
28
26
|
/** Translate to English */
|
|
29
27
|
translate?: boolean;
|
|
28
|
+
/** Detect language automatically */
|
|
29
|
+
detect_language?: boolean;
|
|
30
30
|
/** Number of threads to use */
|
|
31
31
|
n_threads?: number;
|
|
32
|
-
/** Number of processors */
|
|
32
|
+
/** Number of processors for parallel processing */
|
|
33
33
|
n_processors?: number;
|
|
34
|
+
/** Start offset in milliseconds */
|
|
35
|
+
offset_ms?: number;
|
|
36
|
+
/** Duration to process in milliseconds (0 = all) */
|
|
37
|
+
duration_ms?: number;
|
|
38
|
+
/** Audio context size */
|
|
39
|
+
audio_ctx?: number;
|
|
34
40
|
/** Disable timestamps in output */
|
|
35
41
|
no_timestamps?: boolean;
|
|
36
|
-
/** Detect language automatically */
|
|
37
|
-
detect_language?: boolean;
|
|
38
42
|
/** Single segment mode */
|
|
39
43
|
single_segment?: boolean;
|
|
40
|
-
/** Maximum segment length (0 = no limit) */
|
|
44
|
+
/** Maximum segment length in characters (0 = no limit) */
|
|
41
45
|
max_len?: number;
|
|
42
46
|
/** Maximum tokens per segment (0 = no limit) */
|
|
43
47
|
max_tokens?: number;
|
|
44
48
|
/** Maximum context size (-1 = default) */
|
|
45
49
|
max_context?: number;
|
|
46
|
-
/**
|
|
50
|
+
/** Split segments on word boundaries */
|
|
51
|
+
split_on_word?: boolean;
|
|
52
|
+
/** Include token-level timestamps */
|
|
53
|
+
token_timestamps?: boolean;
|
|
54
|
+
/** Word timestamp threshold */
|
|
55
|
+
word_thold?: number;
|
|
56
|
+
/** Use comma in timestamp format (default: true) */
|
|
57
|
+
comma_in_time?: boolean;
|
|
58
|
+
/** Temperature for sampling (0.0 = greedy) */
|
|
47
59
|
temperature?: number;
|
|
48
60
|
/** Temperature increment for fallback */
|
|
49
61
|
temperature_inc?: number;
|
|
50
|
-
/** Best of N sampling */
|
|
62
|
+
/** Best of N sampling candidates */
|
|
51
63
|
best_of?: number;
|
|
52
|
-
/** Beam size (-1 = greedy) */
|
|
64
|
+
/** Beam size for beam search (-1 = greedy) */
|
|
53
65
|
beam_size?: number;
|
|
54
|
-
/**
|
|
66
|
+
/** Disable temperature fallback */
|
|
67
|
+
no_fallback?: boolean;
|
|
68
|
+
/** Entropy threshold for fallback */
|
|
55
69
|
entropy_thold?: number;
|
|
56
70
|
/** Log probability threshold */
|
|
57
71
|
logprob_thold?: number;
|
|
58
|
-
/** No speech threshold */
|
|
72
|
+
/** No speech probability threshold */
|
|
59
73
|
no_speech_thold?: number;
|
|
60
|
-
/** Initial prompt text */
|
|
74
|
+
/** Initial prompt text for context */
|
|
61
75
|
prompt?: string;
|
|
76
|
+
/** Don't use previous context */
|
|
77
|
+
no_context?: boolean;
|
|
78
|
+
/** Suppress blank outputs */
|
|
79
|
+
suppress_blank?: boolean;
|
|
80
|
+
/** Suppress non-speech tokens */
|
|
81
|
+
suppress_nst?: boolean;
|
|
82
|
+
/** Enable speaker diarization */
|
|
83
|
+
diarize?: boolean;
|
|
84
|
+
/** Enable tinydiarize for speaker turn detection */
|
|
85
|
+
tinydiarize?: boolean;
|
|
86
|
+
/** Print special tokens */
|
|
87
|
+
print_special?: boolean;
|
|
88
|
+
/** Print progress */
|
|
89
|
+
print_progress?: boolean;
|
|
90
|
+
/** Print realtime output */
|
|
91
|
+
print_realtime?: boolean;
|
|
92
|
+
/** Print timestamps */
|
|
93
|
+
print_timestamps?: boolean;
|
|
94
|
+
/** Enable VAD preprocessing */
|
|
95
|
+
vad?: boolean;
|
|
96
|
+
/** Path to VAD model */
|
|
97
|
+
vad_model?: string;
|
|
98
|
+
/** VAD speech detection threshold (0.0-1.0) */
|
|
99
|
+
vad_threshold?: number;
|
|
100
|
+
/** Minimum speech duration in milliseconds */
|
|
101
|
+
vad_min_speech_duration_ms?: number;
|
|
102
|
+
/** Minimum silence duration in milliseconds */
|
|
103
|
+
vad_min_silence_duration_ms?: number;
|
|
104
|
+
/** Maximum speech duration in seconds */
|
|
105
|
+
vad_max_speech_duration_s?: number;
|
|
106
|
+
/** Speech padding in milliseconds */
|
|
107
|
+
vad_speech_pad_ms?: number;
|
|
108
|
+
/** VAD samples overlap ratio */
|
|
109
|
+
vad_samples_overlap?: number;
|
|
110
|
+
/** Progress callback function (progress: 0-100) */
|
|
111
|
+
progress_callback?: (progress: number) => void;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Transcription options with file input
|
|
115
|
+
*/
|
|
116
|
+
export interface TranscribeOptionsFile extends TranscribeOptionsBase {
|
|
117
|
+
/** Path to the audio file */
|
|
118
|
+
fname_inp: string;
|
|
119
|
+
pcmf32?: never;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Transcription options with PCM buffer input
|
|
123
|
+
*/
|
|
124
|
+
export interface TranscribeOptionsBuffer extends TranscribeOptionsBase {
|
|
125
|
+
/** Raw PCM audio samples (16kHz, mono, float32, values -1.0 to 1.0) */
|
|
126
|
+
pcmf32: Float32Array;
|
|
127
|
+
fname_inp?: never;
|
|
62
128
|
}
|
|
129
|
+
/**
|
|
130
|
+
* Options for transcription - either file path or PCM buffer
|
|
131
|
+
*/
|
|
132
|
+
export type TranscribeOptions = TranscribeOptionsFile | TranscribeOptionsBuffer;
|
|
63
133
|
/**
|
|
64
134
|
* Transcription result segment (tuple format)
|
|
65
135
|
* [0]: Start time in format "HH:MM:SS,mmm"
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,kCAAkC;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,8CAA8C;IAC9C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,8CAA8C;IAC9C,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,oCAAoC;IACpC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,4DAA4D;IAC5D,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,4FAA4F;IAC5F,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,uDAAuD;IACvD,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,kCAAkC;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,8CAA8C;IAC9C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,8CAA8C;IAC9C,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,oCAAoC;IACpC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,4DAA4D;IAC5D,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,4FAA4F;IAC5F,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,uDAAuD;IACvD,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IAEpC,+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AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,KAAK,OAAO,EAAE,iBAAiB,GAAG,UAAU,CAAC;CAC9C;AAED;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,CAC/B,KAAK,EAAE,KAAK,GAAG,IAAI,EACnB,MAAM,CAAC,EAAE,gBAAgB,KACtB,IAAI,CAAC;AAEV;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,cAAc,EAAE,yBAAyB,CAAC;IAC1C,UAAU,EAAE,qBAAqB,CAAC;IAClC,UAAU,EAAE,CACV,OAAO,EAAE,cAAc,EACvB,OAAO,EAAE,iBAAiB,EAC1B,QAAQ,EAAE,kBAAkB,KACzB,IAAI,CAAC;IACV,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC"}
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@whisper-cpp-node/core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Node.js bindings for whisper.cpp - fast speech-to-text on Apple Silicon",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
|
-
"url": "https://github.com/
|
|
8
|
+
"url": "https://github.com/predict-woo/whisper.cpp",
|
|
9
9
|
"directory": "npm/packages/core"
|
|
10
10
|
},
|
|
11
11
|
"main": "dist/index.js",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"dist"
|
|
22
22
|
],
|
|
23
23
|
"optionalDependencies": {
|
|
24
|
-
"@whisper-cpp-node/darwin-arm64": "0.1.
|
|
24
|
+
"@whisper-cpp-node/darwin-arm64": "0.1.1"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@types/node": "^20.0.0",
|