whisper.rn 0.3.0-rc.2 → 0.3.0-rc.4
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 +1 -1
- package/android/src/main/java/com/rnwhisper/WhisperContext.java +14 -12
- package/cpp/ggml.c +399 -162
- package/cpp/ggml.h +13 -3
- package/cpp/whisper.cpp +15 -1
- package/cpp/whisper.h +3 -0
- package/ios/RNWhisperContext.mm +19 -20
- package/lib/commonjs/index.js +8 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/version.json +1 -0
- package/lib/module/index.js +5 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/version.json +1 -0
- package/lib/typescript/index.d.ts +4 -3
- package/lib/typescript/index.d.ts.map +1 -1
- package/package.json +5 -2
- package/src/index.ts +6 -2
- package/src/version.json +1 -0
package/README.md
CHANGED
|
@@ -79,7 +79,7 @@ subscribe(evt => {
|
|
|
79
79
|
|
|
80
80
|
In Android, you may need to request the microphone permission by [`PermissionAndroid`](https://reactnative.dev/docs/permissionsandroid).
|
|
81
81
|
|
|
82
|
-
|
|
82
|
+
Please visit the [Documentation](docs/) for more details.
|
|
83
83
|
|
|
84
84
|
## Core ML support
|
|
85
85
|
|
|
@@ -239,7 +239,19 @@ public class WhisperContext {
|
|
|
239
239
|
!isCapturing &&
|
|
240
240
|
nSamplesTranscribing == nSamplesOfIndex &&
|
|
241
241
|
sliceIndex == transcribeSliceIndex;
|
|
242
|
-
|
|
242
|
+
|
|
243
|
+
if (
|
|
244
|
+
// If no more samples on current slice, move to next slice
|
|
245
|
+
nSamplesTranscribing == sliceNSamples.get(transcribeSliceIndex) &&
|
|
246
|
+
transcribeSliceIndex != sliceIndex
|
|
247
|
+
) {
|
|
248
|
+
transcribeSliceIndex++;
|
|
249
|
+
nSamplesTranscribing = 0;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
boolean continueNeeded = !isCapturing && nSamplesTranscribing != nSamplesOfIndex;
|
|
253
|
+
|
|
254
|
+
if (isStopped && !continueNeeded) {
|
|
243
255
|
payload.putBoolean("isCapturing", false);
|
|
244
256
|
payload.putBoolean("isStoppedByAction", isStoppedByAction);
|
|
245
257
|
emitTranscribeEvent("@RNWhisper_onRealtimeTranscribeEnd", payload);
|
|
@@ -251,16 +263,7 @@ public class WhisperContext {
|
|
|
251
263
|
emitTranscribeEvent("@RNWhisper_onRealtimeTranscribe", payload);
|
|
252
264
|
}
|
|
253
265
|
|
|
254
|
-
if (
|
|
255
|
-
// If no more samples on current slice, move to next slice
|
|
256
|
-
nSamplesTranscribing == sliceNSamples.get(transcribeSliceIndex) &&
|
|
257
|
-
transcribeSliceIndex != sliceIndex
|
|
258
|
-
) {
|
|
259
|
-
transcribeSliceIndex++;
|
|
260
|
-
nSamplesTranscribing = 0;
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
if (!isCapturing && nSamplesTranscribing != nSamplesOfIndex) {
|
|
266
|
+
if (continueNeeded) {
|
|
264
267
|
// If no more capturing, continue transcribing until all slices are transcribed
|
|
265
268
|
fullTranscribeSamples(options, true);
|
|
266
269
|
} else if (isStopped) {
|
|
@@ -368,7 +371,6 @@ public class WhisperContext {
|
|
|
368
371
|
public void stopTranscribe(int jobId) {
|
|
369
372
|
abortTranscribe(jobId);
|
|
370
373
|
isCapturing = false;
|
|
371
|
-
isTranscribing = false;
|
|
372
374
|
isStoppedByAction = true;
|
|
373
375
|
}
|
|
374
376
|
|