react-native-davoice-tts 1.0.424 → 1.0.425

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 (27) 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/android/src/main/java/com/davoice/stt/rn/STTModule.kt +19 -0
  6. package/ios/STTRNBridge/STTBridge.m +7 -0
  7. package/ios/SpeechBridge/SpeechBridge.m +7 -0
  8. package/ios/TTSRNBridge/DavoiceTTS.xcframework/Info.plist +5 -5
  9. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64/DavoiceTTS.framework/DavoiceTTS +0 -0
  10. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64/DavoiceTTS.framework/Headers/DavoiceTTS-Swift.h +1 -0
  11. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios.abi.json +135 -76
  12. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios.private.swiftinterface +1 -0
  13. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios.swiftinterface +1 -0
  14. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/DavoiceTTS +0 -0
  15. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Headers/DavoiceTTS-Swift.h +2 -0
  16. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.abi.json +135 -76
  17. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +1 -0
  18. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.swiftinterface +1 -0
  19. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.abi.json +135 -76
  20. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +1 -0
  21. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +1 -0
  22. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/_CodeSignature/CodeDirectory +0 -0
  23. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/_CodeSignature/CodeRequirements-1 +0 -0
  24. package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/_CodeSignature/CodeResources +27 -27
  25. package/package.json +1 -1
  26. package/speech/index.d.ts +21 -0
  27. package/speech/index.ts +28 -0
@@ -88,6 +88,7 @@ public enum AudioPlaybackHook {
88
88
  @objc final public func setAECEnabled(_ enabled: Swift.Bool)
89
89
  @objc final public func isAECEnabled() -> Swift.Bool
90
90
  @objc final public func isSpeechAvailable(_ completion: @escaping (Swift.Bool) -> Swift.Void)
91
+ @objc public static func getOnDeviceLanguages() -> [Swift.String : Any]
91
92
  @objc final public func isRecognizing() -> Swift.Bool
92
93
  #if compiler(>=5.3) && $NonescapableTypes
93
94
  @objc final public func startSpeech(localeStr: Swift.String?)
@@ -88,6 +88,7 @@ public enum AudioPlaybackHook {
88
88
  @objc final public func setAECEnabled(_ enabled: Swift.Bool)
89
89
  @objc final public func isAECEnabled() -> Swift.Bool
90
90
  @objc final public func isSpeechAvailable(_ completion: @escaping (Swift.Bool) -> Swift.Void)
91
+ @objc public static func getOnDeviceLanguages() -> [Swift.String : Any]
91
92
  @objc final public func isRecognizing() -> Swift.Bool
92
93
  #if compiler(>=5.3) && $NonescapableTypes
93
94
  @objc final public func startSpeech(localeStr: Swift.String?)
@@ -6,7 +6,7 @@
6
6
  <dict>
7
7
  <key>Headers/DavoiceTTS-Swift.h</key>
8
8
  <data>
9
- Q2XyvfydwNU3JNGF6wk63Up6aKE=
9
+ bRCTPtir4oG+B9GbXWmcikZp/gY=
10
10
  </data>
11
11
  <key>Info.plist</key>
12
12
  <data>
@@ -14,11 +14,11 @@
14
14
  </data>
15
15
  <key>Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.abi.json</key>
16
16
  <data>
17
- O63HvKnrlAg1FO1UVI1kp6yoOCY=
17
+ q2W6agb/UWZVj/HMAJpfXkZVLo8=
18
18
  </data>
19
19
  <key>Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface</key>
20
20
  <data>
21
- /TvuZa+RBXG5WL0hQqAlmw0+KC0=
21
+ E08FPNrFZacJ7FIqiqKfEhUzoYc=
22
22
  </data>
23
23
  <key>Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.swiftdoc</key>
24
24
  <data>
@@ -26,19 +26,19 @@
26
26
  </data>
27
27
  <key>Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.swiftinterface</key>
28
28
  <data>
29
- /TvuZa+RBXG5WL0hQqAlmw0+KC0=
29
+ E08FPNrFZacJ7FIqiqKfEhUzoYc=
30
30
  </data>
31
31
  <key>Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.swiftmodule</key>
32
32
  <data>
33
- ZiRZnI6b3bL+zNLj0PiGR30n/EQ=
33
+ GIyx4kNDAxjzHwQf8fhKdZ8bvW8=
34
34
  </data>
35
35
  <key>Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.abi.json</key>
36
36
  <data>
37
- O63HvKnrlAg1FO1UVI1kp6yoOCY=
37
+ q2W6agb/UWZVj/HMAJpfXkZVLo8=
38
38
  </data>
39
39
  <key>Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface</key>
40
40
  <data>
41
- 95rPGfs8IOUE2QjIYtXUuegxLCk=
41
+ XR41BDe77z7DgZlJtJINhiz5MbU=
42
42
  </data>
43
43
  <key>Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.swiftdoc</key>
44
44
  <data>
@@ -46,11 +46,11 @@
46
46
  </data>
47
47
  <key>Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.swiftinterface</key>
48
48
  <data>
49
- 95rPGfs8IOUE2QjIYtXUuegxLCk=
49
+ XR41BDe77z7DgZlJtJINhiz5MbU=
50
50
  </data>
51
51
  <key>Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.swiftmodule</key>
52
52
  <data>
53
- MvSHa/s9VbkYR4bob7yYKLeeRk8=
53
+ E9+YBH0Bw4SBFCdMUKWihqQazdo=
54
54
  </data>
55
55
  <key>Modules/module.modulemap</key>
56
56
  <data>
@@ -63,33 +63,33 @@
63
63
  <dict>
64
64
  <key>hash</key>
65
65
  <data>
66
- Q2XyvfydwNU3JNGF6wk63Up6aKE=
66
+ bRCTPtir4oG+B9GbXWmcikZp/gY=
67
67
  </data>
68
68
  <key>hash2</key>
69
69
  <data>
70
- AthueO1O6cexeZK4ZfeVLmt/LqhO6D/Et8IsQ/xoflE=
70
+ F1pjxd5w46u9e4Wc4wjHd0iysHNvSx5fGrwSYgSzZrY=
71
71
  </data>
72
72
  </dict>
73
73
  <key>Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.abi.json</key>
74
74
  <dict>
75
75
  <key>hash</key>
76
76
  <data>
77
- O63HvKnrlAg1FO1UVI1kp6yoOCY=
77
+ q2W6agb/UWZVj/HMAJpfXkZVLo8=
78
78
  </data>
79
79
  <key>hash2</key>
80
80
  <data>
81
- zcbpuYRRmRG6cNAVG2A4fkJBBOd0dPH3u/1NMvkZqeM=
81
+ q4yTqxSMNbmZvUYlNCaGHVptr/SKPqlRljNbt8spabY=
82
82
  </data>
83
83
  </dict>
84
84
  <key>Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface</key>
85
85
  <dict>
86
86
  <key>hash</key>
87
87
  <data>
88
- /TvuZa+RBXG5WL0hQqAlmw0+KC0=
88
+ E08FPNrFZacJ7FIqiqKfEhUzoYc=
89
89
  </data>
90
90
  <key>hash2</key>
91
91
  <data>
92
- +AOQToN/YslpRKYeKnNLBbBzXgJExlcYdjgMzm/7SD4=
92
+ 1de5KVtvE/jBWK3oCL54sC3IlYt1YT1Co+PR8yDeW0s=
93
93
  </data>
94
94
  </dict>
95
95
  <key>Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.swiftdoc</key>
@@ -107,44 +107,44 @@
107
107
  <dict>
108
108
  <key>hash</key>
109
109
  <data>
110
- /TvuZa+RBXG5WL0hQqAlmw0+KC0=
110
+ E08FPNrFZacJ7FIqiqKfEhUzoYc=
111
111
  </data>
112
112
  <key>hash2</key>
113
113
  <data>
114
- +AOQToN/YslpRKYeKnNLBbBzXgJExlcYdjgMzm/7SD4=
114
+ 1de5KVtvE/jBWK3oCL54sC3IlYt1YT1Co+PR8yDeW0s=
115
115
  </data>
116
116
  </dict>
117
117
  <key>Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.swiftmodule</key>
118
118
  <dict>
119
119
  <key>hash</key>
120
120
  <data>
121
- ZiRZnI6b3bL+zNLj0PiGR30n/EQ=
121
+ GIyx4kNDAxjzHwQf8fhKdZ8bvW8=
122
122
  </data>
123
123
  <key>hash2</key>
124
124
  <data>
125
- RXBOOnz9opgZVJ3NE2Yu3ws5vuazQoDQ4CTJGCmLSCc=
125
+ fWJoU86O72yeubs4qc8P7VHdo7JTaP57zgOPeTecn14=
126
126
  </data>
127
127
  </dict>
128
128
  <key>Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.abi.json</key>
129
129
  <dict>
130
130
  <key>hash</key>
131
131
  <data>
132
- O63HvKnrlAg1FO1UVI1kp6yoOCY=
132
+ q2W6agb/UWZVj/HMAJpfXkZVLo8=
133
133
  </data>
134
134
  <key>hash2</key>
135
135
  <data>
136
- zcbpuYRRmRG6cNAVG2A4fkJBBOd0dPH3u/1NMvkZqeM=
136
+ q4yTqxSMNbmZvUYlNCaGHVptr/SKPqlRljNbt8spabY=
137
137
  </data>
138
138
  </dict>
139
139
  <key>Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface</key>
140
140
  <dict>
141
141
  <key>hash</key>
142
142
  <data>
143
- 95rPGfs8IOUE2QjIYtXUuegxLCk=
143
+ XR41BDe77z7DgZlJtJINhiz5MbU=
144
144
  </data>
145
145
  <key>hash2</key>
146
146
  <data>
147
- HEziYccowyCWT7NRpF6rhTsV388VUlQs3rcWBwC+30U=
147
+ wY9BXnH+dHFjBwRIpAxgF1vfgqKjT5N3h40h8N8bHRE=
148
148
  </data>
149
149
  </dict>
150
150
  <key>Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.swiftdoc</key>
@@ -162,22 +162,22 @@
162
162
  <dict>
163
163
  <key>hash</key>
164
164
  <data>
165
- 95rPGfs8IOUE2QjIYtXUuegxLCk=
165
+ XR41BDe77z7DgZlJtJINhiz5MbU=
166
166
  </data>
167
167
  <key>hash2</key>
168
168
  <data>
169
- HEziYccowyCWT7NRpF6rhTsV388VUlQs3rcWBwC+30U=
169
+ wY9BXnH+dHFjBwRIpAxgF1vfgqKjT5N3h40h8N8bHRE=
170
170
  </data>
171
171
  </dict>
172
172
  <key>Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.swiftmodule</key>
173
173
  <dict>
174
174
  <key>hash</key>
175
175
  <data>
176
- MvSHa/s9VbkYR4bob7yYKLeeRk8=
176
+ E9+YBH0Bw4SBFCdMUKWihqQazdo=
177
177
  </data>
178
178
  <key>hash2</key>
179
179
  <data>
180
- BdBj0bgfvnI5C6dyjfq9QA6ZGFkDwR2VFZqSruHNe5o=
180
+ Nz6xtN1HOf+XjxG+yRHWDSD3Qe5F7A+mzaHI4Cfkykg=
181
181
  </data>
182
182
  </dict>
183
183
  <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.424",
3
+ "version": "1.0.425",
4
4
  "description": "tts library for React Native",
5
5
  "main": "tts/index.js",
6
6
  "types": "tts/index.d.ts",
package/speech/index.d.ts CHANGED
@@ -32,6 +32,23 @@ export type SpeakerItem = {
32
32
  export type SpeechVolumeChangeEvent = {
33
33
  value: number;
34
34
  };
35
+ /** On-device speech-recognition languages (getOnDeviceLanguages()). Tags like "pt-BR". */
36
+ export type OnDeviceLanguages = {
37
+ /** False on Android below 13 (no way to ask); the lists are then empty. */
38
+ apiSupported: boolean;
39
+ /** On-device model present now: offline recognition works. */
40
+ installed: string[];
41
+ /** On-device model downloading (Android). */
42
+ pending: string[];
43
+ /** Can be downloaded for on-device use (Android); on iOS the same as installed. */
44
+ supportedOnDevice: string[];
45
+ /** Recognized in the cloud by the system recognizer. */
46
+ online: string[];
47
+ /** Languages this app switched to cloud recognition because their on-device model is missing (Android). */
48
+ cloudFallback: string[];
49
+ /** Set when the query failed or timed out (Android). */
50
+ error?: string | null;
51
+ };
35
52
  export type NewSpeechWAVEvent = {
36
53
  path: string;
37
54
  };
@@ -290,6 +307,10 @@ declare class Speech {
290
307
  stop(): Promise<void>;
291
308
  cancel(): Promise<void>;
292
309
  isAvailable(): Promise<0 | 1>;
310
+ /** Which speech-recognition languages work on-device on this phone. Android: when a
311
+ * language has no on-device model, recognition falls back to the cloud automatically
312
+ * (listed in cloudFallback). iOS falls back to Apple's servers by itself. */
313
+ getOnDeviceLanguages(): Promise<OnDeviceLanguages>;
293
314
  isRecognizing(): Promise<0 | 1>;
294
315
  /** Read-only diagnostics: iOS only, resolves null if unavailable. */
295
316
  sttHealthSnapshot(): Promise<Record<string, any> | null>;
package/speech/index.ts CHANGED
@@ -131,6 +131,23 @@ export type SpeechResultsEvent = { value: string[]; speakerIds?: string[]; speak
131
131
  /** One enrolled speaker: `json` is the enrollment JSON itself or a path to it. */
132
132
  export type SpeakerItem = { id: string; json: string };
133
133
  export type SpeechVolumeChangeEvent = { value: number };
134
+ /** On-device speech-recognition languages (getOnDeviceLanguages()). Tags like "pt-BR". */
135
+ export type OnDeviceLanguages = {
136
+ /** False on Android below 13 (no way to ask); the lists are then empty. */
137
+ apiSupported: boolean;
138
+ /** On-device model present now: offline recognition works. */
139
+ installed: string[];
140
+ /** On-device model downloading (Android). */
141
+ pending: string[];
142
+ /** Can be downloaded for on-device use (Android); on iOS the same as installed. */
143
+ supportedOnDevice: string[];
144
+ /** Recognized in the cloud by the system recognizer. */
145
+ online: string[];
146
+ /** Languages this app switched to cloud recognition because their on-device model is missing (Android). */
147
+ cloudFallback: string[];
148
+ /** Set when the query failed or timed out (Android). */
149
+ error?: string | null;
150
+ };
134
151
  export type NewSpeechWAVEvent = { path: string };
135
152
 
136
153
  // Allow passing require() asset, uri string, etc.
@@ -1317,6 +1334,17 @@ class Speech {
1317
1334
  return Promise.resolve(1);
1318
1335
  }
1319
1336
 
1337
+ /** Which speech-recognition languages work on-device on this phone. Android: when a
1338
+ * language has no on-device model, recognition falls back to the cloud automatically
1339
+ * (listed in cloudFallback). iOS falls back to Apple's servers by itself. */
1340
+ async getOnDeviceLanguages(): Promise<OnDeviceLanguages> {
1341
+ const mod = Platform.OS === 'ios' && NativeSpeech?.getOnDeviceLanguages ? NativeSpeech : NativeSTT;
1342
+ if (!mod?.getOnDeviceLanguages) {
1343
+ throw new Error('getOnDeviceLanguages() is not available in this native build');
1344
+ }
1345
+ return mod.getOnDeviceLanguages();
1346
+ }
1347
+
1320
1348
  isRecognizing(): Promise<0 | 1> {
1321
1349
  if (Platform.OS === 'ios' && NativeSpeech?.isRecognizing) {
1322
1350
  return new Promise((resolve) =>