whisper.rn 0.4.0-rc.6 → 0.4.0-rc.7

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.
@@ -115,7 +115,7 @@ public class RNWhisper implements LifecycleEventListener {
115
115
  promise.resolve(result);
116
116
  tasks.remove(this);
117
117
  }
118
- }.execute();
118
+ }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
119
119
  tasks.put(task, "initContext");
120
120
  }
121
121
 
@@ -174,7 +174,7 @@ public class RNWhisper implements LifecycleEventListener {
174
174
  promise.resolve(data);
175
175
  tasks.remove(this);
176
176
  }
177
- }.execute();
177
+ }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
178
178
  tasks.put(task, "transcribeFile-" + id);
179
179
  }
180
180
 
@@ -231,7 +231,7 @@ public class RNWhisper implements LifecycleEventListener {
231
231
  promise.resolve(null);
232
232
  tasks.remove(this);
233
233
  }
234
- }.execute();
234
+ }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
235
235
  tasks.put(task, "abortTranscribe-" + id);
236
236
  }
237
237
 
@@ -272,7 +272,7 @@ public class RNWhisper implements LifecycleEventListener {
272
272
  promise.resolve(null);
273
273
  tasks.remove(this);
274
274
  }
275
- }.execute();
275
+ }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
276
276
  tasks.put(task, "releaseContext-" + id);
277
277
  }
278
278
 
@@ -299,7 +299,7 @@ public class RNWhisper implements LifecycleEventListener {
299
299
  promise.resolve(null);
300
300
  tasks.remove(this);
301
301
  }
302
- }.execute();
302
+ }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
303
303
  tasks.put(task, "releaseAllContexts");
304
304
  }
305
305
 
@@ -75,6 +75,7 @@ void job::set_realtime_params(
75
75
  }
76
76
 
77
77
  bool job::vad_simple(int slice_index, int n_samples, int n) {
78
+ if (slice_index >= pcm_slices.size()) return !vad.use_vad;
78
79
  if (!vad.use_vad) return true;
79
80
 
80
81
  short* pcm = pcm_slices[slice_index];
@@ -413,7 +413,8 @@ struct rnwhisper_segments_callback_data {
413
413
  params.new_segment_callback_user_data = &user_data;
414
414
  }
415
415
 
416
- rnwhisper::job* job = rnwhisper::job_new(jobId, params);;
416
+ rnwhisper::job* job = rnwhisper::job_new(jobId, params);
417
+ self->recordState.job = job;
417
418
  int code = [self fullTranscribe:job audioData:audioData audioDataCount:audioDataCount];
418
419
  rnwhisper::job_remove(jobId);
419
420
  self->recordState.isTranscribing = false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "whisper.rn",
3
- "version": "0.4.0-rc.6",
3
+ "version": "0.4.0-rc.7",
4
4
  "description": "React Native binding of whisper.cpp",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",