react-native-davoice-tts 1.0.394 → 1.0.396

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.
Files changed (28) hide show
  1. package/TTSRNBridge.podspec +1 -1
  2. package/android/libs/com/davoice/tts/1.0.0/tts-1.0.0.aar +0 -0
  3. package/android/libs/com/davoice/tts/1.0.0/tts-1.0.0.aar.md5 +1 -1
  4. package/android/libs/com/davoice/tts/1.0.0/tts-1.0.0.aar.sha1 +1 -1
  5. package/ios/TTSRNBridge/DaVoiceTTSBridge.m +75 -24
  6. package/ios/TTSRNBridge/DavoiceTTS.xcframework/Info.plist +5 -5
  7. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64/DavoiceTTS.framework/DavoiceTTS +0 -0
  8. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64/DavoiceTTS.framework/Headers/DavoiceTTS-Swift.h +23 -0
  9. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios.abi.json +1068 -354
  10. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios.private.swiftinterface +15 -0
  11. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  12. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios.swiftinterface +15 -0
  13. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/DavoiceTTS +0 -0
  14. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Headers/DavoiceTTS-Swift.h +46 -0
  15. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.abi.json +1068 -354
  16. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +15 -0
  17. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  18. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.swiftinterface +15 -0
  19. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.abi.json +1068 -354
  20. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +15 -0
  21. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  22. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +15 -0
  23. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/_CodeSignature/CodeDirectory +0 -0
  24. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/_CodeSignature/CodeRequirements-1 +0 -0
  25. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/_CodeSignature/CodeResources +33 -33
  26. package/package.json +1 -1
  27. package/speech/index.d.ts +263 -0
  28. package/speech/index.ts +50 -29
@@ -159,6 +159,21 @@ public enum AudioPlaybackHook {
159
159
  @objc final public func playWav(_ url: Foundation.URL, markAsLastUtterance: Swift.Bool = true)
160
160
  @objc final public func playBuffer(_ buffer: AVFAudio.AVAudioPCMBuffer, markAsLastUtterance: Swift.Bool = true)
161
161
  }
162
+ @_inheritsConvenienceInitializers @objc final public class DaVoiceLegacyAEC : ObjectiveC.NSObject {
163
+ @objc public static var isEnabled: Swift.Bool {
164
+ @objc get
165
+ @objc set
166
+ }
167
+ #if compiler(>=5.3) && $NonescapableTypes
168
+ public static var externalListener: ((AVFAudio.AVAudioPCMBuffer) -> Swift.Void)? {
169
+ get
170
+ set
171
+ }
172
+ #endif
173
+ @objc public static func deviceHasSessionLevelAEC(_ session: AVFAudio.AVAudioSession = .sharedInstance()) -> Swift.Bool
174
+ @objc override dynamic public init()
175
+ @objc deinit
176
+ }
162
177
  @_inheritsConvenienceInitializers @objc final public class LicenseManager : ObjectiveC.NSObject {
163
178
  @objc public static func isLicenseValid(licenseKey: Swift.String) -> Swift.Bool
164
179
  @objc override dynamic public init()
@@ -159,6 +159,21 @@ public enum AudioPlaybackHook {
159
159
  @objc final public func playWav(_ url: Foundation.URL, markAsLastUtterance: Swift.Bool = true)
160
160
  @objc final public func playBuffer(_ buffer: AVFAudio.AVAudioPCMBuffer, markAsLastUtterance: Swift.Bool = true)
161
161
  }
162
+ @_inheritsConvenienceInitializers @objc final public class DaVoiceLegacyAEC : ObjectiveC.NSObject {
163
+ @objc public static var isEnabled: Swift.Bool {
164
+ @objc get
165
+ @objc set
166
+ }
167
+ #if compiler(>=5.3) && $NonescapableTypes
168
+ public static var externalListener: ((AVFAudio.AVAudioPCMBuffer) -> Swift.Void)? {
169
+ get
170
+ set
171
+ }
172
+ #endif
173
+ @objc public static func deviceHasSessionLevelAEC(_ session: AVFAudio.AVAudioSession = .sharedInstance()) -> Swift.Bool
174
+ @objc override dynamic public init()
175
+ @objc deinit
176
+ }
162
177
  @_inheritsConvenienceInitializers @objc final public class LicenseManager : ObjectiveC.NSObject {
163
178
  @objc public static func isLicenseValid(licenseKey: Swift.String) -> Swift.Bool
164
179
  @objc override dynamic public init()
@@ -6,7 +6,7 @@
6
6
  <dict>
7
7
  <key>Headers/DavoiceTTS-Swift.h</key>
8
8
  <data>
9
- W5dRYqN9m3HPDYF/Zvb4gM65JPA=
9
+ +egeRyVqHbmi2HWz78tOFrVALEo=
10
10
  </data>
11
11
  <key>Info.plist</key>
12
12
  <data>
@@ -14,43 +14,43 @@
14
14
  </data>
15
15
  <key>Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.abi.json</key>
16
16
  <data>
17
- xbPLQ182QaAnaWnR55srhzH1s/Y=
17
+ yhpALy44Hq6VJE07rXzcIl4L+Dc=
18
18
  </data>
19
19
  <key>Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface</key>
20
20
  <data>
21
- jYLHu0+RXnDkWiHC5/+2leipfts=
21
+ aE3O2BVcqXTj2neG6vxXrVlPPa0=
22
22
  </data>
23
23
  <key>Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.swiftdoc</key>
24
24
  <data>
25
- NnWiKcZTVqMMNfaMZA500n7ALOM=
25
+ wT9Itv1n5nl7gjmSHs6EESr2Yv8=
26
26
  </data>
27
27
  <key>Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.swiftinterface</key>
28
28
  <data>
29
- jYLHu0+RXnDkWiHC5/+2leipfts=
29
+ aE3O2BVcqXTj2neG6vxXrVlPPa0=
30
30
  </data>
31
31
  <key>Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.swiftmodule</key>
32
32
  <data>
33
- gbUwDmwrfGxypG2haw/w2CUnfms=
33
+ /VBjB3fqphDh2GgHQdGRRKP2Ayw=
34
34
  </data>
35
35
  <key>Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.abi.json</key>
36
36
  <data>
37
- xbPLQ182QaAnaWnR55srhzH1s/Y=
37
+ yhpALy44Hq6VJE07rXzcIl4L+Dc=
38
38
  </data>
39
39
  <key>Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface</key>
40
40
  <data>
41
- SPT7c0JOMwQUQO82Y3X9UlWMc/0=
41
+ Q4i7c3EXKBJaGD3RQYVqVTYbXUg=
42
42
  </data>
43
43
  <key>Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.swiftdoc</key>
44
44
  <data>
45
- U1wZAHRgleCc753FxtnxzIbD7HE=
45
+ 0HxHPjfyeI3mK568GwgkoTEFnu4=
46
46
  </data>
47
47
  <key>Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.swiftinterface</key>
48
48
  <data>
49
- SPT7c0JOMwQUQO82Y3X9UlWMc/0=
49
+ Q4i7c3EXKBJaGD3RQYVqVTYbXUg=
50
50
  </data>
51
51
  <key>Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.swiftmodule</key>
52
52
  <data>
53
- 8n13h1Ji3YFYivCnpuhjU3ajrp8=
53
+ l2NJDEGZ6gR+jmNoIwralzaeI5U=
54
54
  </data>
55
55
  <key>Modules/module.modulemap</key>
56
56
  <data>
@@ -67,121 +67,121 @@
67
67
  <dict>
68
68
  <key>hash</key>
69
69
  <data>
70
- W5dRYqN9m3HPDYF/Zvb4gM65JPA=
70
+ +egeRyVqHbmi2HWz78tOFrVALEo=
71
71
  </data>
72
72
  <key>hash2</key>
73
73
  <data>
74
- d5be1fTstGjls9SVx7Qx10cFEx9zkvFM1I1DiVOBunw=
74
+ oa3YuMfx8Oh5WwFmEcj8flDiGMGnKc9BhHcCWZK2LA4=
75
75
  </data>
76
76
  </dict>
77
77
  <key>Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.abi.json</key>
78
78
  <dict>
79
79
  <key>hash</key>
80
80
  <data>
81
- xbPLQ182QaAnaWnR55srhzH1s/Y=
81
+ yhpALy44Hq6VJE07rXzcIl4L+Dc=
82
82
  </data>
83
83
  <key>hash2</key>
84
84
  <data>
85
- 4mzKMCQn8z0EXgDmCzLdcOV4AD66ITzp+W+rTpEC7Q0=
85
+ t7CvZAWFmIyeqTXb9A6ocpYfTRWIp6Y1Cn++G80Qeew=
86
86
  </data>
87
87
  </dict>
88
88
  <key>Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface</key>
89
89
  <dict>
90
90
  <key>hash</key>
91
91
  <data>
92
- jYLHu0+RXnDkWiHC5/+2leipfts=
92
+ aE3O2BVcqXTj2neG6vxXrVlPPa0=
93
93
  </data>
94
94
  <key>hash2</key>
95
95
  <data>
96
- dczAz2o2m7zHlQ15IO74X1MBEiJSQ4L7NLQ0oPqEBaI=
96
+ cghmkTHZWXIt54ejZgmByRebIO+qB6a4TnbmWGcoQbU=
97
97
  </data>
98
98
  </dict>
99
99
  <key>Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.swiftdoc</key>
100
100
  <dict>
101
101
  <key>hash</key>
102
102
  <data>
103
- NnWiKcZTVqMMNfaMZA500n7ALOM=
103
+ wT9Itv1n5nl7gjmSHs6EESr2Yv8=
104
104
  </data>
105
105
  <key>hash2</key>
106
106
  <data>
107
- ntu1tShvqEORQx69S5CxWuoOmpNuV6XAvPWfgeaXF94=
107
+ clBsJ6dpucRECMabcH8wpZZCGVvM2k2gWz/1kszoeh4=
108
108
  </data>
109
109
  </dict>
110
110
  <key>Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.swiftinterface</key>
111
111
  <dict>
112
112
  <key>hash</key>
113
113
  <data>
114
- jYLHu0+RXnDkWiHC5/+2leipfts=
114
+ aE3O2BVcqXTj2neG6vxXrVlPPa0=
115
115
  </data>
116
116
  <key>hash2</key>
117
117
  <data>
118
- dczAz2o2m7zHlQ15IO74X1MBEiJSQ4L7NLQ0oPqEBaI=
118
+ cghmkTHZWXIt54ejZgmByRebIO+qB6a4TnbmWGcoQbU=
119
119
  </data>
120
120
  </dict>
121
121
  <key>Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.swiftmodule</key>
122
122
  <dict>
123
123
  <key>hash</key>
124
124
  <data>
125
- gbUwDmwrfGxypG2haw/w2CUnfms=
125
+ /VBjB3fqphDh2GgHQdGRRKP2Ayw=
126
126
  </data>
127
127
  <key>hash2</key>
128
128
  <data>
129
- C56vfsD2qJg3rb13cTZWQVBIAMCxqU5YXMasKwZAkIg=
129
+ emTKUEqrLNVxt2u/xYSaDMleBJTsah7ARWYbE2IzFYc=
130
130
  </data>
131
131
  </dict>
132
132
  <key>Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.abi.json</key>
133
133
  <dict>
134
134
  <key>hash</key>
135
135
  <data>
136
- xbPLQ182QaAnaWnR55srhzH1s/Y=
136
+ yhpALy44Hq6VJE07rXzcIl4L+Dc=
137
137
  </data>
138
138
  <key>hash2</key>
139
139
  <data>
140
- 4mzKMCQn8z0EXgDmCzLdcOV4AD66ITzp+W+rTpEC7Q0=
140
+ t7CvZAWFmIyeqTXb9A6ocpYfTRWIp6Y1Cn++G80Qeew=
141
141
  </data>
142
142
  </dict>
143
143
  <key>Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface</key>
144
144
  <dict>
145
145
  <key>hash</key>
146
146
  <data>
147
- SPT7c0JOMwQUQO82Y3X9UlWMc/0=
147
+ Q4i7c3EXKBJaGD3RQYVqVTYbXUg=
148
148
  </data>
149
149
  <key>hash2</key>
150
150
  <data>
151
- kJpr09s+vj+wmCP6sB3fElMY9heGkUuTgsAsBv46KOs=
151
+ Oft4H9M/TEfUVaY/Y14v4RSG8g+OZGLR9ZBpxe1xsjA=
152
152
  </data>
153
153
  </dict>
154
154
  <key>Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.swiftdoc</key>
155
155
  <dict>
156
156
  <key>hash</key>
157
157
  <data>
158
- U1wZAHRgleCc753FxtnxzIbD7HE=
158
+ 0HxHPjfyeI3mK568GwgkoTEFnu4=
159
159
  </data>
160
160
  <key>hash2</key>
161
161
  <data>
162
- s2sylFklyuQXLIUb/f37GR/EeNyoYs96lsAE5GtaGas=
162
+ addXJYyZ5bXVyvT/mU+A+ndXjmXP46DOFweKtAK98c8=
163
163
  </data>
164
164
  </dict>
165
165
  <key>Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.swiftinterface</key>
166
166
  <dict>
167
167
  <key>hash</key>
168
168
  <data>
169
- SPT7c0JOMwQUQO82Y3X9UlWMc/0=
169
+ Q4i7c3EXKBJaGD3RQYVqVTYbXUg=
170
170
  </data>
171
171
  <key>hash2</key>
172
172
  <data>
173
- kJpr09s+vj+wmCP6sB3fElMY9heGkUuTgsAsBv46KOs=
173
+ Oft4H9M/TEfUVaY/Y14v4RSG8g+OZGLR9ZBpxe1xsjA=
174
174
  </data>
175
175
  </dict>
176
176
  <key>Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.swiftmodule</key>
177
177
  <dict>
178
178
  <key>hash</key>
179
179
  <data>
180
- 8n13h1Ji3YFYivCnpuhjU3ajrp8=
180
+ l2NJDEGZ6gR+jmNoIwralzaeI5U=
181
181
  </data>
182
182
  <key>hash2</key>
183
183
  <data>
184
- xXYNOGzog3S8VRwEPMMijXnuVZTuw3GNfJIPec1wB+w=
184
+ RYSUyp7BsuiKGcdJjENOiE57g9b0hTeUNiW+L8reLzQ=
185
185
  </data>
186
186
  </dict>
187
187
  <key>Modules/module.modulemap</key>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-davoice-tts",
3
- "version": "1.0.394",
3
+ "version": "1.0.396",
4
4
  "description": "tts library for React Native",
5
5
  "main": "tts/index.js",
6
6
  "types": "tts/index.d.ts",
@@ -0,0 +1,263 @@
1
+ export type SpeechTransitionResult = {
2
+ ok: boolean;
3
+ reason: string;
4
+ elapsedMs: number;
5
+ };
6
+ export type SpeechStartEvent = {};
7
+ export type SpeechEndEvent = {};
8
+ export type SpeechRecognizedEvent = {
9
+ isFinal: boolean;
10
+ };
11
+ export type SpeechErrorEvent = {
12
+ error: {
13
+ code?: string;
14
+ message?: string;
15
+ };
16
+ };
17
+ export type SpeechResultsEvent = {
18
+ value: string[];
19
+ };
20
+ export type SpeechVolumeChangeEvent = {
21
+ value: number;
22
+ };
23
+ export type NewSpeechWAVEvent = {
24
+ path: string;
25
+ };
26
+ export type RNAssetLike = any;
27
+ export type ModelRef = string | RNAssetLike;
28
+ /** iOS AVAudioSession routing entry shared by STT and TTS. */
29
+ export type PreferredAudioInput = 'bluetoothHighQualityMic' | 'builtInMic' | 'none';
30
+ export type RouteConfigEntry = {
31
+ category: 'playAndRecord' | 'record' | 'soloAmbient' | 'ambient' | 'playback';
32
+ mode: 'default' | 'measurement' | 'voiceChat' | 'videoRecording' | 'gameChat';
33
+ options: ('mixWithOthers' | 'duckOthers' | 'allowBluetooth' | 'allowBluetoothHFP' | 'allowBluetoothA2DP' | 'bluetoothHighQualityRecording' | 'allowAirPlay' | 'defaultToSpeaker' | 'overrideMutedMicrophoneInterruption')[];
34
+ /** First input policy to try. HD Bluetooth requires iOS 26, mode=default, and bluetoothHighQualityRecording. */
35
+ preferredInput: PreferredAudioInput;
36
+ /**
37
+ * Forced fallback after an HD Bluetooth request fails. builtInMic switches
38
+ * to phone-mic + A2DP; none switches to ordinary headset HFP.
39
+ */
40
+ forceFallback?: PreferredAudioInput;
41
+ /** Lowercase JSON alias for forceFallback. Prefer forceFallback in TypeScript. */
42
+ forcefallback?: PreferredAudioInput;
43
+ /** Backward-compatible alias for forceFallback. */
44
+ preferredInputFallback?: PreferredAudioInput;
45
+ /** Additional forced fallback after forceFallback. */
46
+ forceFallback1?: PreferredAudioInput;
47
+ /** Lowercase JSON alias for forceFallback1. */
48
+ forcefallback1?: PreferredAudioInput;
49
+ /** Backward-compatible alias for forceFallback1. */
50
+ preferredInputFallback1?: PreferredAudioInput;
51
+ /** Final forced fallback. */
52
+ forceFallback2?: PreferredAudioInput;
53
+ /** Lowercase JSON alias for forceFallback2. */
54
+ forcefallback2?: PreferredAudioInput;
55
+ /** Backward-compatible alias for forceFallback2. */
56
+ preferredInputFallback2?: PreferredAudioInput;
57
+ /** On onFinishPlaying, deactivate with notifyOthersOnDeactivation before restoring regular routing. */
58
+ notifyOthers?: boolean;
59
+ };
60
+ /** Same JSON shape accepted by react-native-wakeword. */
61
+ export type AudioRoutingConfig = {
62
+ default: RouteConfigEntry;
63
+ byOutputPort?: {
64
+ carAudio?: RouteConfigEntry;
65
+ builtInReceiver?: RouteConfigEntry;
66
+ builtInSpeaker?: RouteConfigEntry;
67
+ bluetoothA2DP?: RouteConfigEntry;
68
+ bluetoothHFP?: RouteConfigEntry;
69
+ headphones?: RouteConfigEntry;
70
+ };
71
+ /** Optional temporary routing policy for speaker playback batches (speak/playWav/playBuffer). */
72
+ WhenPlayingAudio?: {
73
+ onPlay?: RouteConfigEntry;
74
+ onFinishPlaying?: RouteConfigEntry;
75
+ /**
76
+ * Quiet period after the playback queue drains before restoring regular
77
+ * routing and notifying other audio. New playback restarts the deadline.
78
+ * Defaults to 3000 ms. Use 0 for immediate restoration.
79
+ */
80
+ msBeforeUnduck?: number;
81
+ };
82
+ /** Optional temporary ducking policy while native STT is unpaused. */
83
+ STTDuckingConfig?: {
84
+ onUnpause?: RouteConfigEntry;
85
+ onPause?: RouteConfigEntry;
86
+ /**
87
+ * Quiet period after STT pauses before restoring regular routing and
88
+ * notifying other audio. Playback and STT share one native scheduler.
89
+ * Defaults to 3000 ms. Use 0 for immediate restoration.
90
+ */
91
+ msBeforeUnduck?: number;
92
+ };
93
+ /** Temporary wake-word sensitivity used only while physical TTS audio plays. */
94
+ wakeWordDuringTTS?: {
95
+ threshold: number;
96
+ buffer_cnt: number;
97
+ };
98
+ };
99
+ export type UnifiedEvents = {
100
+ onSpeechStart?: (e: SpeechStartEvent) => void;
101
+ onSpeechRecognized?: (e: SpeechRecognizedEvent) => void;
102
+ onSpeechEnd?: (e: SpeechEndEvent) => void;
103
+ onSpeechError?: (e: SpeechErrorEvent) => void;
104
+ onSpeechResults?: (e: SpeechResultsEvent) => void;
105
+ onSpeechPartialResults?: (e: SpeechResultsEvent) => void;
106
+ onSpeechVolumeChanged?: (e: SpeechVolumeChangeEvent) => void;
107
+ /** Android-only: emitted when native MIC+VAD saves a full utterance WAV */
108
+ onNewSpeechWAV?: (e: NewSpeechWAVEvent) => void;
109
+ onFinishedSpeaking?: () => void;
110
+ };
111
+ export type ExternalPCM = {
112
+ /** base64 of raw PCM payload */
113
+ base64: string;
114
+ /** sample rate of payload (e.g., 16000, 22050, 24000, 44100, 48000) */
115
+ sampleRate: number;
116
+ /** number of channels in payload (default 1) */
117
+ channels?: number;
118
+ /** whether payload is interleaved (default true) */
119
+ interleaved?: boolean;
120
+ /** 'i16' for 16-bit signed integer, 'f32' for 32-bit float */
121
+ format: 'i16' | 'f32';
122
+ /** whether this item should trigger onFinishedSpeaking when done (default true) */
123
+ markAsLast?: boolean;
124
+ };
125
+ declare class Speech {
126
+ private ttsChain;
127
+ private ttsPendingResolve;
128
+ private ttsPendingTimeout;
129
+ private sttTransitionChain;
130
+ private dbgAsset;
131
+ private _onNativeFinishedSpeaking;
132
+ /** Reference voice, matched case-insensitively without .wav.
133
+ * Returns 0 on match; -1 on fallback/unavailability. Missing names select the
134
+ * first WAV (alphabetical order). Already generated audio keeps its voice.
135
+ */
136
+ changeVoice(name: string): Promise<number>;
137
+ private _nativeSpeak;
138
+ private enqueueSttTransition;
139
+ private _speakAndWait;
140
+ private sttEmitter;
141
+ private ttsEmitter;
142
+ private unifiedEmitter;
143
+ private subs;
144
+ private handlers;
145
+ private lastLocale;
146
+ private lastModel;
147
+ private lastOnboardingJsonPath;
148
+ private hasCompletedFullInit;
149
+ private hasCompletedTtsInit;
150
+ private iosTtsOnly;
151
+ private logCall;
152
+ private resolveModelExt;
153
+ private resolveModelToPath;
154
+ constructor();
155
+ private rewireListenersForMode;
156
+ /**
157
+ * ANDROID ONLY: Initialize remote capture (MIC + VAD) that saves utterances to WAV
158
+ * and emits 'onNewSpeechWAV' with { path }. No-op on iOS (throws).
159
+ */
160
+ initAllRemoteSTT(modelOrOpts: ModelRef | {
161
+ model: ModelRef;
162
+ onboardingJsonPath?: string;
163
+ }): Promise<void>;
164
+ /**
165
+ * ANDROID ONLY: Start remote STT and initialize TTS in playback-only mode (no model/ONNX init).
166
+ * Accepts the same argument shape as initAllRemoteSTT() for API compatibility.
167
+ * model/onboardingJsonPath are intentionally ignored on Android for now.
168
+ */
169
+ initAllRemoteSTTAndTTS(_modelOrOpts?: ModelRef | {
170
+ model: ModelRef;
171
+ onboardingJsonPath?: string;
172
+ }): Promise<void>;
173
+ dbgModel(label: string, model: any): void;
174
+ /**
175
+ * iOS: set the routing JSON used by both STT and TTS before initialization.
176
+ * This direct value takes precedence over the wakeword library's config.
177
+ */
178
+ setAudioRoutingConfig(config: AudioRoutingConfig): Promise<any>;
179
+ /** Clears the direct speech config so STT/TTS fall back to wakeword routing JSON. */
180
+ clearAudioRoutingConfig(): Promise<any>;
181
+ /**
182
+ * iOS: initialize STT then TTS via native SpeechBridge if available.
183
+ * Android: no special init needed; optionally preload TTS (if you want).
184
+ */
185
+ initAll(opts: {
186
+ locale: string;
187
+ model: ModelRef;
188
+ timeoutMs?: number;
189
+ onboardingJsonPath?: string;
190
+ }): Promise<any>;
191
+ destroyAll(): Promise<any>;
192
+ initWithoutModel(): Promise<any>;
193
+ destroyWihtouModel(): Promise<any>;
194
+ destroyWithoutModel(): Promise<any>;
195
+ start(locale: string, options?: Record<string, any>): Promise<void>;
196
+ startWithSVOnboardingJson(locale: string, onboardingJsonPath: string): Promise<void>;
197
+ pauseSpeechRecognition(timeoutMs?: number): Promise<void>;
198
+ unPauseSpeechRecognition(times: number, preFetchMs?: number, timeoutMs?: number): Promise<SpeechTransitionResult>;
199
+ /** Pause mic/STT (Android native; iOS unified if present) */
200
+ pauseMicrophone(): Promise<void>;
201
+ /** Resume mic/STT (Android native; iOS unified if present) */
202
+ unPauseMicrophone(): Promise<void>;
203
+ stop(): Promise<void>;
204
+ cancel(): Promise<void>;
205
+ isAvailable(): Promise<0 | 1>;
206
+ isRecognizing(): Promise<0 | 1>;
207
+ /** Read-only diagnostics: iOS only, resolves null if unavailable. */
208
+ sttHealthSnapshot(): Promise<Record<string, any> | null>;
209
+ /**
210
+ * Read-only view of the JS half of the event-delivery path. Pairs with the native
211
+ * sttHealthSnapshot(): native reports whether it will emit (hasListeners), this reports
212
+ * whether we are subscribed and to which emitter. rewireListenersForMode() tears all
213
+ * subscriptions down and re-adds them, and ensureListeners() early-returns whenever
214
+ * subs is non-empty, so a subscription attached to the wrong emitter is permanent.
215
+ */
216
+ sttListenerDiag(): Record<string, any>;
217
+ hasIOSMicPermissions(): Promise<boolean>;
218
+ requestIOSMicPermissions(wait_timeout: number): Promise<boolean>;
219
+ hasIOSSpeechRecognitionPermissions(): Promise<boolean>;
220
+ requestIOSSpeechRecognitionPermissions(wait_timeout: number): Promise<boolean>;
221
+ setLicense(licenseKey: string): Promise<boolean>;
222
+ isLicenseValid(licenseKey: string): Promise<boolean>;
223
+ setAECEnabled(enabled: boolean): Promise<void>;
224
+ initTTS(modelOrConfig: ModelRef | {
225
+ model: ModelRef;
226
+ }): Promise<any>;
227
+ speak(text: string, speakerId?: number, speed?: number): Promise<void>;
228
+ private _cancelTtsWait;
229
+ stopSpeaking(): Promise<any>;
230
+ private wavChain;
231
+ private _playWavAndWait;
232
+ playWav(pathOrURL: any, markAsLast?: boolean): Promise<any>;
233
+ /**
234
+ * Convenience: queue a typed array (Int16Array | Float32Array | ArrayBuffer) as PCM.
235
+ * We’ll base64 it and pass through to native with the right metadata.
236
+ */
237
+ playPCM(data: ArrayBuffer | Int16Array | Float32Array, opts: {
238
+ sampleRate: number;
239
+ channels?: number;
240
+ interleaved?: boolean;
241
+ /** If data is Int16Array → 'i16' (default); if Float32Array → 'f32' (default) */
242
+ format?: 'i16' | 'f32';
243
+ markAsLast?: boolean;
244
+ }): Promise<any>;
245
+ /**
246
+ * Queue raw PCM buffer from other TTS providers (base64 payload).
247
+ * Use ExternalPCM for full control of metadata.
248
+ */
249
+ playBuffer(desc: ExternalPCM): Promise<any>;
250
+ private ensureListeners;
251
+ private teardownListeners;
252
+ set onSpeechStart(fn: (e: SpeechStartEvent) => void);
253
+ set onSpeechRecognized(fn: (e: SpeechRecognizedEvent) => void);
254
+ set onSpeechEnd(fn: (e: SpeechEndEvent) => void);
255
+ set onSpeechError(fn: (e: SpeechErrorEvent) => void);
256
+ set onSpeechResults(fn: (e: SpeechResultsEvent) => void);
257
+ set onSpeechPartialResults(fn: (e: SpeechResultsEvent) => void);
258
+ set onSpeechVolumeChanged(fn: (e: SpeechVolumeChangeEvent) => void);
259
+ set onNewSpeechWAV(fn: (e: NewSpeechWAVEvent) => void);
260
+ set onFinishedSpeaking(fn: () => void);
261
+ }
262
+ declare const SpeechInstance: Speech;
263
+ export default SpeechInstance;