react-native-wakeword 1.0.59 → 1.0.62

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.
@@ -34,7 +34,7 @@ repositories {
34
34
 
35
35
  dependencies {
36
36
  implementation "com.facebook.react:react-native:+"
37
- implementation 'com.microsoft.onnxruntime:onnxruntime-android:1.20.0'
37
+ // implementation 'com.microsoft.onnxruntime:onnxruntime-android:1.20.0'
38
38
  implementation 'ai.picovoice:android-voice-processor:1.0.2'
39
39
  implementation 'com.davoice:keyworddetection:1.0.0'
40
40
  // implementation(name: 'MyLibrary-release', ext: 'aar') // Add this line
@@ -72,7 +72,7 @@ public class KeyWordRNBridge extends ReactContextBaseJavaModule {
72
72
  }
73
73
  try {
74
74
  recordingWav = instance.getRecordingWav();
75
- promise.resolve("Instance ID: " + instanceId + " change model " + modelName);
75
+ promise.resolve("Instance ID: " + instanceId + " getting getRecordingWav");
76
76
  } catch (Exception e) {
77
77
  promise.reject("CreateError", "Failed to create instance: " + e.getMessage());
78
78
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-wakeword",
3
- "version": "1.0.59",
3
+ "version": "1.0.62",
4
4
  "description": "Voice/Wake-word detection library for React Native",
5
5
  "main": "wakewords/index.js",
6
6
  "types": "wakewords/index.d.ts",
@@ -11,7 +11,7 @@ export class KeyWordRNBridgeInstance {
11
11
  startKeywordDetection(threshold: any): Promise<any>;
12
12
  stopKeywordDetection(): Promise<any>;
13
13
  destroyInstance(): Promise<any>;
14
- onKeywordDetectionEvent(callback: any): any;
14
+ onKeywordDetectionEvent(callback: any): import("react-native").EmitterSubscription;
15
15
  removeListeners(): void;
16
16
  }
17
17
  export function removeAllRNBridgeListeners(): Promise<void>;
@@ -1,6 +1,6 @@
1
1
  export default useModel;
2
- import { removeAllRNBridgeListeners } from './KeyWordRNBridge';
3
- import { createKeyWordRNBridgeInstance } from './KeyWordRNBridge';
4
- import { KeyWordRNBridgeInstance } from './KeyWordRNBridge';
5
- import useModel from './useModel';
2
+ import { removeAllRNBridgeListeners } from "./KeyWordRNBridge";
3
+ import { createKeyWordRNBridgeInstance } from "./KeyWordRNBridge";
4
+ import { KeyWordRNBridgeInstance } from "./KeyWordRNBridge";
5
+ import useModel from "./useModel";
6
6
  export { removeAllRNBridgeListeners, createKeyWordRNBridgeInstance, KeyWordRNBridgeInstance, useModel };
@@ -1,12 +1,19 @@
1
+ interface instanceConfig {
2
+ id: string;
3
+ modelName: string;
4
+ threshold: number;
5
+ bufferCnt: number;
6
+ sticky: boolean;
7
+ }
1
8
  /**
2
9
  * Custom hook for handling keyword detection using KeyWordRNBridge
3
10
  * @returns An object with functions and state for keyword detection
4
11
  */
5
12
  export declare const useModel: () => {
6
- isListening: any;
7
- startListening: any;
8
- loadModel: any;
9
- setKeywordDetectionLicense: any;
10
- stopListening: any;
13
+ isListening: boolean;
14
+ startListening: () => Promise<void>;
15
+ loadModel: (useConfigs: instanceConfig[], callback: (phrase: string) => void) => Promise<void>;
16
+ setKeywordDetectionLicense: (licenseKey: string) => Promise<void>;
17
+ stopListening: () => Promise<void>;
11
18
  };
12
19
  export default useModel;