react-native-davoice-tts 1.0.404 → 1.0.406
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/TTSRNBridge.podspec +1 -1
- package/android/.gradle/8.9/checksums/checksums.lock +0 -0
- package/android/.gradle/8.9/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/9.7.1/checksums/checksums.lock +0 -0
- package/android/.gradle/9.7.1/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +1 -1
- package/android/build/reports/problems/problems-report.html +9 -2
- package/android/libs/com/davoice/tts/1.0.0/tts-1.0.0.aar +0 -0
- package/android/libs/com/davoice/tts/1.0.0/tts-1.0.0.aar.md5 +1 -1
- package/android/libs/com/davoice/tts/1.0.0/tts-1.0.0.aar.sha1 +1 -1
- package/android/src/main/java/com/davoice/stt/rn/STTModule.kt +90 -22
- package/ios/SpeechBridge/SpeechBridge.m +102 -12
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/Info.plist +5 -5
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64/DavoiceTTS.framework/DavoiceTTS +0 -0
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64/DavoiceTTS.framework/Headers/DavoiceTTS-Swift.h +20 -0
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios.abi.json +1246 -181
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios.private.swiftinterface +34 -0
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios.swiftinterface +34 -0
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/DavoiceTTS +0 -0
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Headers/DavoiceTTS-Swift.h +40 -0
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.abi.json +1246 -181
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +34 -0
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.swiftinterface +34 -0
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.abi.json +1246 -181
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +34 -0
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +34 -0
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/_CodeSignature/CodeDirectory +0 -0
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/_CodeSignature/CodeRequirements-1 +0 -0
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/_CodeSignature/CodeResources +33 -33
- package/package.json +1 -1
- package/speech/index.d.ts +37 -1
- package/speech/index.ts +99 -4
- package/android/.gradle/9.2.0/checksums/checksums.lock +0 -0
- package/android/.gradle/9.2.0/fileHashes/fileHashes.bin +0 -0
- package/android/.gradle/9.2.0/fileHashes/fileHashes.lock +0 -0
- /package/android/.gradle/{9.2.0 → 9.7.1}/fileChanges/last-build.bin +0 -0
- /package/android/.gradle/{9.2.0 → 9.7.1}/gc.properties +0 -0
|
@@ -96,6 +96,17 @@ public enum AudioPlaybackHook {
|
|
|
96
96
|
@objc final public func startSpeech(localeStr: Swift.String?, onboardingJsonPath: Swift.String)
|
|
97
97
|
#endif
|
|
98
98
|
#if compiler(>=5.3) && $NonescapableTypes
|
|
99
|
+
@objc final public func startSpeech(localeStr: Swift.String?, onboardingJsonPath: Swift.String, speakerId: Swift.String)
|
|
100
|
+
#endif
|
|
101
|
+
#if compiler(>=5.3) && $NonescapableTypes
|
|
102
|
+
@objc final public func startSpeech(localeStr: Swift.String?, speakers: [[Swift.String : Swift.String]])
|
|
103
|
+
#endif
|
|
104
|
+
@objc final public func addSpeaker(id: Swift.String, jsonOrPath: Swift.String) throws
|
|
105
|
+
@objc final public func setSpeakers(_ speakers: [[Swift.String : Swift.String]]) throws
|
|
106
|
+
@objc @discardableResult
|
|
107
|
+
final public func removeSpeaker(id: Swift.String) -> Swift.Bool
|
|
108
|
+
@objc final public func getSpeakerIds() -> [Swift.String]
|
|
109
|
+
#if compiler(>=5.3) && $NonescapableTypes
|
|
99
110
|
@objc final public func stopSpeech(_ completion: ((Swift.Bool) -> Swift.Void)? = nil)
|
|
100
111
|
#endif
|
|
101
112
|
#if compiler(>=5.3) && $NonescapableTypes
|
|
@@ -243,6 +254,25 @@ public struct SpeakerEnrollment : Swift.Codable {
|
|
|
243
254
|
public static func deserialize(_ data: Foundation.Data) throws -> DavoiceTTS.SpeakerEnrollment
|
|
244
255
|
public func encode(to encoder: any Swift.Encoder) throws
|
|
245
256
|
}
|
|
257
|
+
public struct SVSpeaker {
|
|
258
|
+
public let id: Swift.String
|
|
259
|
+
public let enrollment: DavoiceTTS.SpeakerEnrollment
|
|
260
|
+
public let threshold: Swift.Float
|
|
261
|
+
public let contentKey: Swift.String
|
|
262
|
+
#if compiler(>=5.3) && $NonescapableTypes
|
|
263
|
+
public init(id: Swift.String, enrollment: DavoiceTTS.SpeakerEnrollment, threshold: Swift.Float? = nil)
|
|
264
|
+
#endif
|
|
265
|
+
public static func contentKey(of e: DavoiceTTS.SpeakerEnrollment) -> Swift.String
|
|
266
|
+
}
|
|
267
|
+
public enum SVSpeakerSet {
|
|
268
|
+
public static let defaultSpeakerId: Swift.String
|
|
269
|
+
public static func loadEnrollment(jsonOrPath: Swift.String) throws -> DavoiceTTS.SpeakerEnrollment
|
|
270
|
+
#if compiler(>=5.3) && $NonescapableTypes
|
|
271
|
+
public static func incompatibility(_ e: DavoiceTTS.SpeakerEnrollment, base: DavoiceTTS.SpeakerVerificationConfig, baseDim: Swift.Int) -> Swift.String?
|
|
272
|
+
#endif
|
|
273
|
+
public static func upsert(_ list: [DavoiceTTS.SVSpeaker], _ s: DavoiceTTS.SVSpeaker) -> (list: [DavoiceTTS.SVSpeaker], removed: [Swift.String])
|
|
274
|
+
public static func build(_ items: [DavoiceTTS.SVSpeaker]) -> (list: [DavoiceTTS.SVSpeaker], removed: [Swift.String])
|
|
275
|
+
}
|
|
246
276
|
public struct SVPendingInfo {
|
|
247
277
|
public let bufferedSamples: Swift.Int
|
|
248
278
|
public let bufferedSeconds: Swift.Float
|
|
@@ -257,6 +287,8 @@ public struct SpeakerVerificationResult {
|
|
|
257
287
|
public let bestKind: Swift.String
|
|
258
288
|
public let bestId: Swift.String
|
|
259
289
|
public let isMatch: Swift.Bool
|
|
290
|
+
public let speakerId: Swift.String?
|
|
291
|
+
public let speakerScores: [Swift.String : Swift.Float]
|
|
260
292
|
public let embeddingDim: Swift.Int
|
|
261
293
|
public let usedSeconds: Swift.Float
|
|
262
294
|
public let ortRunMs: Swift.Double
|
|
@@ -286,6 +318,8 @@ public enum SpeakerVerificationError : Swift.Error, Swift.CustomStringConvertibl
|
|
|
286
318
|
#if compiler(>=5.3) && $NonescapableTypes
|
|
287
319
|
final public func setEnrollment(_ enrollment: DavoiceTTS.SpeakerEnrollment?)
|
|
288
320
|
#endif
|
|
321
|
+
final public func setSpeakers(_ list: [DavoiceTTS.SVSpeaker])
|
|
322
|
+
final public func currentSpeakers() -> [DavoiceTTS.SVSpeaker]
|
|
289
323
|
@objc final public func resetStreamingState()
|
|
290
324
|
final public func processFrame(frame: [Swift.Float]) throws -> DavoiceTTS.SpeakerVerificationOutput
|
|
291
325
|
final public func verifyWavFileStreaming(path: Swift.String, resetState: Swift.Bool = true) throws -> DavoiceTTS.SpeakerVerificationResult
|
|
Binary file
|
|
@@ -96,6 +96,17 @@ public enum AudioPlaybackHook {
|
|
|
96
96
|
@objc final public func startSpeech(localeStr: Swift.String?, onboardingJsonPath: Swift.String)
|
|
97
97
|
#endif
|
|
98
98
|
#if compiler(>=5.3) && $NonescapableTypes
|
|
99
|
+
@objc final public func startSpeech(localeStr: Swift.String?, onboardingJsonPath: Swift.String, speakerId: Swift.String)
|
|
100
|
+
#endif
|
|
101
|
+
#if compiler(>=5.3) && $NonescapableTypes
|
|
102
|
+
@objc final public func startSpeech(localeStr: Swift.String?, speakers: [[Swift.String : Swift.String]])
|
|
103
|
+
#endif
|
|
104
|
+
@objc final public func addSpeaker(id: Swift.String, jsonOrPath: Swift.String) throws
|
|
105
|
+
@objc final public func setSpeakers(_ speakers: [[Swift.String : Swift.String]]) throws
|
|
106
|
+
@objc @discardableResult
|
|
107
|
+
final public func removeSpeaker(id: Swift.String) -> Swift.Bool
|
|
108
|
+
@objc final public func getSpeakerIds() -> [Swift.String]
|
|
109
|
+
#if compiler(>=5.3) && $NonescapableTypes
|
|
99
110
|
@objc final public func stopSpeech(_ completion: ((Swift.Bool) -> Swift.Void)? = nil)
|
|
100
111
|
#endif
|
|
101
112
|
#if compiler(>=5.3) && $NonescapableTypes
|
|
@@ -243,6 +254,25 @@ public struct SpeakerEnrollment : Swift.Codable {
|
|
|
243
254
|
public static func deserialize(_ data: Foundation.Data) throws -> DavoiceTTS.SpeakerEnrollment
|
|
244
255
|
public func encode(to encoder: any Swift.Encoder) throws
|
|
245
256
|
}
|
|
257
|
+
public struct SVSpeaker {
|
|
258
|
+
public let id: Swift.String
|
|
259
|
+
public let enrollment: DavoiceTTS.SpeakerEnrollment
|
|
260
|
+
public let threshold: Swift.Float
|
|
261
|
+
public let contentKey: Swift.String
|
|
262
|
+
#if compiler(>=5.3) && $NonescapableTypes
|
|
263
|
+
public init(id: Swift.String, enrollment: DavoiceTTS.SpeakerEnrollment, threshold: Swift.Float? = nil)
|
|
264
|
+
#endif
|
|
265
|
+
public static func contentKey(of e: DavoiceTTS.SpeakerEnrollment) -> Swift.String
|
|
266
|
+
}
|
|
267
|
+
public enum SVSpeakerSet {
|
|
268
|
+
public static let defaultSpeakerId: Swift.String
|
|
269
|
+
public static func loadEnrollment(jsonOrPath: Swift.String) throws -> DavoiceTTS.SpeakerEnrollment
|
|
270
|
+
#if compiler(>=5.3) && $NonescapableTypes
|
|
271
|
+
public static func incompatibility(_ e: DavoiceTTS.SpeakerEnrollment, base: DavoiceTTS.SpeakerVerificationConfig, baseDim: Swift.Int) -> Swift.String?
|
|
272
|
+
#endif
|
|
273
|
+
public static func upsert(_ list: [DavoiceTTS.SVSpeaker], _ s: DavoiceTTS.SVSpeaker) -> (list: [DavoiceTTS.SVSpeaker], removed: [Swift.String])
|
|
274
|
+
public static func build(_ items: [DavoiceTTS.SVSpeaker]) -> (list: [DavoiceTTS.SVSpeaker], removed: [Swift.String])
|
|
275
|
+
}
|
|
246
276
|
public struct SVPendingInfo {
|
|
247
277
|
public let bufferedSamples: Swift.Int
|
|
248
278
|
public let bufferedSeconds: Swift.Float
|
|
@@ -257,6 +287,8 @@ public struct SpeakerVerificationResult {
|
|
|
257
287
|
public let bestKind: Swift.String
|
|
258
288
|
public let bestId: Swift.String
|
|
259
289
|
public let isMatch: Swift.Bool
|
|
290
|
+
public let speakerId: Swift.String?
|
|
291
|
+
public let speakerScores: [Swift.String : Swift.Float]
|
|
260
292
|
public let embeddingDim: Swift.Int
|
|
261
293
|
public let usedSeconds: Swift.Float
|
|
262
294
|
public let ortRunMs: Swift.Double
|
|
@@ -286,6 +318,8 @@ public enum SpeakerVerificationError : Swift.Error, Swift.CustomStringConvertibl
|
|
|
286
318
|
#if compiler(>=5.3) && $NonescapableTypes
|
|
287
319
|
final public func setEnrollment(_ enrollment: DavoiceTTS.SpeakerEnrollment?)
|
|
288
320
|
#endif
|
|
321
|
+
final public func setSpeakers(_ list: [DavoiceTTS.SVSpeaker])
|
|
322
|
+
final public func currentSpeakers() -> [DavoiceTTS.SVSpeaker]
|
|
289
323
|
@objc final public func resetStreamingState()
|
|
290
324
|
final public func processFrame(frame: [Swift.Float]) throws -> DavoiceTTS.SpeakerVerificationOutput
|
|
291
325
|
final public func verifyWavFileStreaming(path: Swift.String, resetState: Swift.Bool = true) throws -> DavoiceTTS.SpeakerVerificationResult
|
|
Binary file
|
|
Binary file
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<dict>
|
|
7
7
|
<key>Headers/DavoiceTTS-Swift.h</key>
|
|
8
8
|
<data>
|
|
9
|
-
|
|
9
|
+
KtAkEI+NVrtzft8qn9TnxgfTQRA=
|
|
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
|
-
|
|
17
|
+
Xzy7eKo34sosBEF7kcuHvAHmt/8=
|
|
18
18
|
</data>
|
|
19
19
|
<key>Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface</key>
|
|
20
20
|
<data>
|
|
21
|
-
|
|
21
|
+
rhdvjODkHPKs4qBNmwdKunXLlKM=
|
|
22
22
|
</data>
|
|
23
23
|
<key>Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.swiftdoc</key>
|
|
24
24
|
<data>
|
|
25
|
-
|
|
25
|
+
DBj8v8SVvtDvIt9W4hhjgMPAVQw=
|
|
26
26
|
</data>
|
|
27
27
|
<key>Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.swiftinterface</key>
|
|
28
28
|
<data>
|
|
29
|
-
|
|
29
|
+
rhdvjODkHPKs4qBNmwdKunXLlKM=
|
|
30
30
|
</data>
|
|
31
31
|
<key>Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.swiftmodule</key>
|
|
32
32
|
<data>
|
|
33
|
-
|
|
33
|
+
25XQpJEAqd5BRNadXFRS36754pg=
|
|
34
34
|
</data>
|
|
35
35
|
<key>Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.abi.json</key>
|
|
36
36
|
<data>
|
|
37
|
-
|
|
37
|
+
Xzy7eKo34sosBEF7kcuHvAHmt/8=
|
|
38
38
|
</data>
|
|
39
39
|
<key>Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface</key>
|
|
40
40
|
<data>
|
|
41
|
-
|
|
41
|
+
N3eTfbTFnI9nK89g8gRAXBosf2o=
|
|
42
42
|
</data>
|
|
43
43
|
<key>Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.swiftdoc</key>
|
|
44
44
|
<data>
|
|
45
|
-
|
|
45
|
+
5XHpcH95URmbuwTVn8VcuVNM4fs=
|
|
46
46
|
</data>
|
|
47
47
|
<key>Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.swiftinterface</key>
|
|
48
48
|
<data>
|
|
49
|
-
|
|
49
|
+
N3eTfbTFnI9nK89g8gRAXBosf2o=
|
|
50
50
|
</data>
|
|
51
51
|
<key>Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.swiftmodule</key>
|
|
52
52
|
<data>
|
|
53
|
-
|
|
53
|
+
Ek2TMSufusWF0sDAeFvqMC/1ceA=
|
|
54
54
|
</data>
|
|
55
55
|
<key>Modules/module.modulemap</key>
|
|
56
56
|
<data>
|
|
@@ -63,121 +63,121 @@
|
|
|
63
63
|
<dict>
|
|
64
64
|
<key>hash</key>
|
|
65
65
|
<data>
|
|
66
|
-
|
|
66
|
+
KtAkEI+NVrtzft8qn9TnxgfTQRA=
|
|
67
67
|
</data>
|
|
68
68
|
<key>hash2</key>
|
|
69
69
|
<data>
|
|
70
|
-
|
|
70
|
+
GXKGTYlWJ7Mcd0l0sVrD66c3EyuR4OIzXHjBXqqO5HE=
|
|
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
|
-
|
|
77
|
+
Xzy7eKo34sosBEF7kcuHvAHmt/8=
|
|
78
78
|
</data>
|
|
79
79
|
<key>hash2</key>
|
|
80
80
|
<data>
|
|
81
|
-
|
|
81
|
+
+7ZP3yTOwJdpSLtEZwjBBuQgvRNcsJwiL5lmm0OwzOM=
|
|
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
|
-
|
|
88
|
+
rhdvjODkHPKs4qBNmwdKunXLlKM=
|
|
89
89
|
</data>
|
|
90
90
|
<key>hash2</key>
|
|
91
91
|
<data>
|
|
92
|
-
|
|
92
|
+
/eqCU3zFpX/9me4tk8NeSdv4cvYJ7zSqWgULp8R9Qmk=
|
|
93
93
|
</data>
|
|
94
94
|
</dict>
|
|
95
95
|
<key>Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.swiftdoc</key>
|
|
96
96
|
<dict>
|
|
97
97
|
<key>hash</key>
|
|
98
98
|
<data>
|
|
99
|
-
|
|
99
|
+
DBj8v8SVvtDvIt9W4hhjgMPAVQw=
|
|
100
100
|
</data>
|
|
101
101
|
<key>hash2</key>
|
|
102
102
|
<data>
|
|
103
|
-
|
|
103
|
+
veKMdlvfd/VYX0revZmyq6baH112aa4mSq6pNIUmsA0=
|
|
104
104
|
</data>
|
|
105
105
|
</dict>
|
|
106
106
|
<key>Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.swiftinterface</key>
|
|
107
107
|
<dict>
|
|
108
108
|
<key>hash</key>
|
|
109
109
|
<data>
|
|
110
|
-
|
|
110
|
+
rhdvjODkHPKs4qBNmwdKunXLlKM=
|
|
111
111
|
</data>
|
|
112
112
|
<key>hash2</key>
|
|
113
113
|
<data>
|
|
114
|
-
|
|
114
|
+
/eqCU3zFpX/9me4tk8NeSdv4cvYJ7zSqWgULp8R9Qmk=
|
|
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
|
-
|
|
121
|
+
25XQpJEAqd5BRNadXFRS36754pg=
|
|
122
122
|
</data>
|
|
123
123
|
<key>hash2</key>
|
|
124
124
|
<data>
|
|
125
|
-
|
|
125
|
+
i4gK9Y0Ha2LKtaVHegrXKQJqQOz0p2IINx2v4EgU1JI=
|
|
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
|
-
|
|
132
|
+
Xzy7eKo34sosBEF7kcuHvAHmt/8=
|
|
133
133
|
</data>
|
|
134
134
|
<key>hash2</key>
|
|
135
135
|
<data>
|
|
136
|
-
|
|
136
|
+
+7ZP3yTOwJdpSLtEZwjBBuQgvRNcsJwiL5lmm0OwzOM=
|
|
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
|
-
|
|
143
|
+
N3eTfbTFnI9nK89g8gRAXBosf2o=
|
|
144
144
|
</data>
|
|
145
145
|
<key>hash2</key>
|
|
146
146
|
<data>
|
|
147
|
-
|
|
147
|
+
jInopSRrkW2B5Fem4dQ/xYVsiXgCvydfxwTQg1OUZ5E=
|
|
148
148
|
</data>
|
|
149
149
|
</dict>
|
|
150
150
|
<key>Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.swiftdoc</key>
|
|
151
151
|
<dict>
|
|
152
152
|
<key>hash</key>
|
|
153
153
|
<data>
|
|
154
|
-
|
|
154
|
+
5XHpcH95URmbuwTVn8VcuVNM4fs=
|
|
155
155
|
</data>
|
|
156
156
|
<key>hash2</key>
|
|
157
157
|
<data>
|
|
158
|
-
|
|
158
|
+
LrQYu+GkuDpfR42C670pTtzvkcTj85bk6ipA1J+YL80=
|
|
159
159
|
</data>
|
|
160
160
|
</dict>
|
|
161
161
|
<key>Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.swiftinterface</key>
|
|
162
162
|
<dict>
|
|
163
163
|
<key>hash</key>
|
|
164
164
|
<data>
|
|
165
|
-
|
|
165
|
+
N3eTfbTFnI9nK89g8gRAXBosf2o=
|
|
166
166
|
</data>
|
|
167
167
|
<key>hash2</key>
|
|
168
168
|
<data>
|
|
169
|
-
|
|
169
|
+
jInopSRrkW2B5Fem4dQ/xYVsiXgCvydfxwTQg1OUZ5E=
|
|
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
|
-
|
|
176
|
+
Ek2TMSufusWF0sDAeFvqMC/1ceA=
|
|
177
177
|
</data>
|
|
178
178
|
<key>hash2</key>
|
|
179
179
|
<data>
|
|
180
|
-
/
|
|
180
|
+
GAt3e/0hQ7B1XJxybWKE5TsgG7EsJbfkOTTc9EvIZa0=
|
|
181
181
|
</data>
|
|
182
182
|
</dict>
|
|
183
183
|
<key>Modules/module.modulemap</key>
|
package/package.json
CHANGED
package/speech/index.d.ts
CHANGED
|
@@ -14,8 +14,20 @@ export type SpeechErrorEvent = {
|
|
|
14
14
|
message?: string;
|
|
15
15
|
};
|
|
16
16
|
};
|
|
17
|
+
/**
|
|
18
|
+
* `speakerIds`/`speakerId` are present only when speaker verification is on:
|
|
19
|
+
* every verified speaker heard in the current sentence (first-appearance order)
|
|
20
|
+
* and the latest one. Reset after each final result.
|
|
21
|
+
*/
|
|
17
22
|
export type SpeechResultsEvent = {
|
|
18
23
|
value: string[];
|
|
24
|
+
speakerIds?: string[];
|
|
25
|
+
speakerId?: string;
|
|
26
|
+
};
|
|
27
|
+
/** One enrolled speaker: `json` is the enrollment JSON itself or a path to it. */
|
|
28
|
+
export type SpeakerItem = {
|
|
29
|
+
id: string;
|
|
30
|
+
json: string;
|
|
19
31
|
};
|
|
20
32
|
export type SpeechVolumeChangeEvent = {
|
|
21
33
|
value: number;
|
|
@@ -145,6 +157,8 @@ declare class Speech {
|
|
|
145
157
|
private lastLocale;
|
|
146
158
|
private lastModel;
|
|
147
159
|
private lastOnboardingJsonPath;
|
|
160
|
+
private lastSpeakerId;
|
|
161
|
+
private lastSpeakers;
|
|
148
162
|
private hasCompletedFullInit;
|
|
149
163
|
private hasCompletedTtsInit;
|
|
150
164
|
private iosTtsOnly;
|
|
@@ -182,18 +196,40 @@ declare class Speech {
|
|
|
182
196
|
* iOS: initialize STT then TTS via native SpeechBridge if available.
|
|
183
197
|
* Android: no special init needed; optionally preload TTS (if you want).
|
|
184
198
|
*/
|
|
199
|
+
/**
|
|
200
|
+
* `onboardingJsonPath` (JSON or path) adds one speaker under `speakerId`
|
|
201
|
+
* (default "default"); `speakers` instead replaces the whole speaker set.
|
|
202
|
+
*/
|
|
185
203
|
initAll(opts: {
|
|
186
204
|
locale: string;
|
|
187
205
|
model: ModelRef;
|
|
188
206
|
timeoutMs?: number;
|
|
189
207
|
onboardingJsonPath?: string;
|
|
208
|
+
speakerId?: string;
|
|
209
|
+
speakers?: SpeakerItem[];
|
|
190
210
|
}): Promise<any>;
|
|
191
211
|
destroyAll(): Promise<any>;
|
|
192
212
|
initWithoutModel(): Promise<any>;
|
|
193
213
|
destroyWihtouModel(): Promise<any>;
|
|
194
214
|
destroyWithoutModel(): Promise<any>;
|
|
195
215
|
start(locale: string, options?: Record<string, any>): Promise<void>;
|
|
196
|
-
|
|
216
|
+
/**
|
|
217
|
+
* Starts STT with one speaker. `onboardingJsonPath` may be the JSON itself or a
|
|
218
|
+
* path. The speaker is added to the current set under `speakerId` (default
|
|
219
|
+
* "default"); same id or same voiceprint replaces the older entry.
|
|
220
|
+
*/
|
|
221
|
+
startWithSVOnboardingJson(locale: string, onboardingJsonPath: string, speakerId?: string): Promise<void>;
|
|
222
|
+
private svModule;
|
|
223
|
+
/** Starts STT with an array of speakers, replacing the current set. */
|
|
224
|
+
startWithSVSpeakers(locale: string, speakers: SpeakerItem[]): Promise<void>;
|
|
225
|
+
/** Adds (or replaces) one speaker. `jsonOrPath`: the enrollment JSON or a path. Resolves to the enrolled ids. */
|
|
226
|
+
addSpeaker(speakerId: string, jsonOrPath: string): Promise<string[]>;
|
|
227
|
+
/** Replaces the whole speaker set; an empty array turns speaker verification off. */
|
|
228
|
+
setSpeakers(speakers: SpeakerItem[]): Promise<string[]>;
|
|
229
|
+
/** Removes a speaker; removing the last one turns the gate off. Resolves false if unknown. */
|
|
230
|
+
removeSpeaker(speakerId: string): Promise<boolean>;
|
|
231
|
+
/** Enrolled speaker ids, in insertion order. */
|
|
232
|
+
getSpeakerIds(): Promise<string[]>;
|
|
197
233
|
pauseSpeechRecognition(timeoutMs?: number): Promise<void>;
|
|
198
234
|
unPauseSpeechRecognition(times: number, preFetchMs?: number, timeoutMs?: number): Promise<SpeechTransitionResult>;
|
|
199
235
|
/** Pause mic/STT (Android native; iOS unified if present) */
|
package/speech/index.ts
CHANGED
|
@@ -122,7 +122,14 @@ export type SpeechStartEvent = {};
|
|
|
122
122
|
export type SpeechEndEvent = {};
|
|
123
123
|
export type SpeechRecognizedEvent = { isFinal: boolean };
|
|
124
124
|
export type SpeechErrorEvent = { error: { code?: string; message?: string } };
|
|
125
|
-
|
|
125
|
+
/**
|
|
126
|
+
* `speakerIds`/`speakerId` are present only when speaker verification is on:
|
|
127
|
+
* every verified speaker heard in the current sentence (first-appearance order)
|
|
128
|
+
* and the latest one. Reset after each final result.
|
|
129
|
+
*/
|
|
130
|
+
export type SpeechResultsEvent = { value: string[]; speakerIds?: string[]; speakerId?: string };
|
|
131
|
+
/** One enrolled speaker: `json` is the enrollment JSON itself or a path to it. */
|
|
132
|
+
export type SpeakerItem = { id: string; json: string };
|
|
126
133
|
export type SpeechVolumeChangeEvent = { value: number };
|
|
127
134
|
export type NewSpeechWAVEvent = { path: string };
|
|
128
135
|
|
|
@@ -375,6 +382,8 @@ class Speech {
|
|
|
375
382
|
private lastLocale: string | null = null;
|
|
376
383
|
private lastModel: string | null = null;
|
|
377
384
|
private lastOnboardingJsonPath: string | null = null;
|
|
385
|
+
private lastSpeakerId: string | null = null;
|
|
386
|
+
private lastSpeakers: SpeakerItem[] | null = null;
|
|
378
387
|
private hasCompletedFullInit = false;
|
|
379
388
|
private hasCompletedTtsInit = false;
|
|
380
389
|
private iosTtsOnly = false; // when true, use NativeTTS directly on iOS
|
|
@@ -594,7 +603,18 @@ class Speech {
|
|
|
594
603
|
* iOS: initialize STT then TTS via native SpeechBridge if available.
|
|
595
604
|
* Android: no special init needed; optionally preload TTS (if you want).
|
|
596
605
|
*/
|
|
597
|
-
|
|
606
|
+
/**
|
|
607
|
+
* `onboardingJsonPath` (JSON or path) adds one speaker under `speakerId`
|
|
608
|
+
* (default "default"); `speakers` instead replaces the whole speaker set.
|
|
609
|
+
*/
|
|
610
|
+
async initAll(opts: {
|
|
611
|
+
locale: string;
|
|
612
|
+
model: ModelRef;
|
|
613
|
+
timeoutMs?: number;
|
|
614
|
+
onboardingJsonPath?: string;
|
|
615
|
+
speakerId?: string;
|
|
616
|
+
speakers?: SpeakerItem[];
|
|
617
|
+
}) {
|
|
598
618
|
this.dbgModel('initAll.opts.model (raw)', opts.model);
|
|
599
619
|
this.dbgAsset('initAll.model', opts.model);
|
|
600
620
|
this._cancelTtsWait('initAll');
|
|
@@ -607,6 +627,8 @@ class Speech {
|
|
|
607
627
|
this.lastLocale = opts.locale;
|
|
608
628
|
this.lastModel = modelPath;
|
|
609
629
|
this.lastOnboardingJsonPath = opts.onboardingJsonPath ?? null;
|
|
630
|
+
this.lastSpeakerId = opts.speakerId ?? null;
|
|
631
|
+
this.lastSpeakers = opts.speakers ?? null;
|
|
610
632
|
|
|
611
633
|
if (Platform.OS === 'ios' && NativeSpeech?.initAll) {
|
|
612
634
|
if (this.iosTtsOnly) {
|
|
@@ -652,6 +674,8 @@ class Speech {
|
|
|
652
674
|
EXTRA_PARTIAL_RESULTS: true,
|
|
653
675
|
REQUEST_PERMISSIONS_AUTO: true,
|
|
654
676
|
onboardingJsonPath: opts.onboardingJsonPath ?? null,
|
|
677
|
+
speakerId: opts.speakerId ?? null,
|
|
678
|
+
speakers: opts.speakers ?? null,
|
|
655
679
|
},
|
|
656
680
|
(err: string) => (err ? reject(new Error(err)) : resolve())
|
|
657
681
|
);
|
|
@@ -729,6 +753,8 @@ class Speech {
|
|
|
729
753
|
const r = await NativeSpeech.initWithoutModel({
|
|
730
754
|
locale: this.lastLocale,
|
|
731
755
|
onboardingJsonPath: this.lastOnboardingJsonPath,
|
|
756
|
+
speakerId: this.lastSpeakerId,
|
|
757
|
+
speakers: this.lastSpeakers,
|
|
732
758
|
});
|
|
733
759
|
this.ensureListeners();
|
|
734
760
|
return r;
|
|
@@ -744,7 +770,11 @@ class Speech {
|
|
|
744
770
|
if (typeof NativeSTT.initWithoutModel === 'function') {
|
|
745
771
|
NativeSTT.initWithoutModel(
|
|
746
772
|
this.lastLocale,
|
|
747
|
-
{
|
|
773
|
+
{
|
|
774
|
+
onboardingJsonPath: this.lastOnboardingJsonPath ?? null,
|
|
775
|
+
speakerId: this.lastSpeakerId ?? null,
|
|
776
|
+
speakers: this.lastSpeakers ?? null,
|
|
777
|
+
},
|
|
748
778
|
(err: string) => (err ? reject(new Error(err)) : resolve()),
|
|
749
779
|
);
|
|
750
780
|
return;
|
|
@@ -759,6 +789,8 @@ class Speech {
|
|
|
759
789
|
EXTRA_PARTIAL_RESULTS: true,
|
|
760
790
|
REQUEST_PERMISSIONS_AUTO: true,
|
|
761
791
|
onboardingJsonPath: this.lastOnboardingJsonPath ?? null,
|
|
792
|
+
speakerId: this.lastSpeakerId ?? null,
|
|
793
|
+
speakers: this.lastSpeakers ?? null,
|
|
762
794
|
},
|
|
763
795
|
(err: string) => (err ? reject(new Error(err)) : resolve()),
|
|
764
796
|
);
|
|
@@ -847,8 +879,20 @@ class Speech {
|
|
|
847
879
|
});
|
|
848
880
|
}
|
|
849
881
|
|
|
850
|
-
|
|
882
|
+
/**
|
|
883
|
+
* Starts STT with one speaker. `onboardingJsonPath` may be the JSON itself or a
|
|
884
|
+
* path. The speaker is added to the current set under `speakerId` (default
|
|
885
|
+
* "default"); same id or same voiceprint replaces the older entry.
|
|
886
|
+
*/
|
|
887
|
+
async startWithSVOnboardingJson(locale: string, onboardingJsonPath: string, speakerId?: string): Promise<void> {
|
|
851
888
|
this.ensureListeners();
|
|
889
|
+
if (Platform.OS === 'android') {
|
|
890
|
+
return this.start(locale, { onboardingJsonPath, speakerId: speakerId ?? null });
|
|
891
|
+
}
|
|
892
|
+
if (speakerId && (NativeSpeech as any)?.addSpeaker) {
|
|
893
|
+
await this.addSpeaker(speakerId, onboardingJsonPath);
|
|
894
|
+
return this.start(locale);
|
|
895
|
+
}
|
|
852
896
|
if (Platform.OS === 'ios' && (NativeSpeech as any)?.startSpeechWithSVOnboardingJsonAsync) {
|
|
853
897
|
await (NativeSpeech as any).startSpeechWithSVOnboardingJsonAsync(locale, onboardingJsonPath, 2500);
|
|
854
898
|
return;
|
|
@@ -861,6 +905,57 @@ class Speech {
|
|
|
861
905
|
return this.start(locale);
|
|
862
906
|
}
|
|
863
907
|
|
|
908
|
+
// ---------- Speaker verification (live multi-speaker) ----------
|
|
909
|
+
// All of these work before start (applied at the next start) or while STT is
|
|
910
|
+
// running (applied immediately, no restart). Duplicates (same id or same JSON)
|
|
911
|
+
// are replaced by the newest entry. Speakers persist until destroyAll().
|
|
912
|
+
|
|
913
|
+
private svModule(): any {
|
|
914
|
+
return Platform.OS === 'ios' ? NativeSpeech : NativeSTT;
|
|
915
|
+
}
|
|
916
|
+
|
|
917
|
+
/** Starts STT with an array of speakers, replacing the current set. */
|
|
918
|
+
async startWithSVSpeakers(locale: string, speakers: SpeakerItem[]): Promise<void> {
|
|
919
|
+
this.ensureListeners();
|
|
920
|
+
if (Platform.OS === 'ios') {
|
|
921
|
+
if (!(NativeSpeech as any)?.startSpeechWithSVSpeakers) throw new Error('startSpeechWithSVSpeakers not available');
|
|
922
|
+
await (NativeSpeech as any).startSpeechWithSVSpeakers(locale, speakers, 2500);
|
|
923
|
+
return;
|
|
924
|
+
}
|
|
925
|
+
if (!(NativeSTT as any)?.startSpeechWithSVSpeakers) throw new Error('startSpeechWithSVSpeakers not available');
|
|
926
|
+
return new Promise<void>((resolve) =>
|
|
927
|
+
(NativeSTT as any).startSpeechWithSVSpeakers(locale, speakers, () => resolve()),
|
|
928
|
+
);
|
|
929
|
+
}
|
|
930
|
+
|
|
931
|
+
/** Adds (or replaces) one speaker. `jsonOrPath`: the enrollment JSON or a path. Resolves to the enrolled ids. */
|
|
932
|
+
async addSpeaker(speakerId: string, jsonOrPath: string): Promise<string[]> {
|
|
933
|
+
const mod = this.svModule();
|
|
934
|
+
if (!mod?.addSpeaker) throw new Error('addSpeaker not available');
|
|
935
|
+
return mod.addSpeaker(speakerId, jsonOrPath);
|
|
936
|
+
}
|
|
937
|
+
|
|
938
|
+
/** Replaces the whole speaker set; an empty array turns speaker verification off. */
|
|
939
|
+
async setSpeakers(speakers: SpeakerItem[]): Promise<string[]> {
|
|
940
|
+
const mod = this.svModule();
|
|
941
|
+
if (!mod?.setSpeakers) throw new Error('setSpeakers not available');
|
|
942
|
+
return mod.setSpeakers(speakers);
|
|
943
|
+
}
|
|
944
|
+
|
|
945
|
+
/** Removes a speaker; removing the last one turns the gate off. Resolves false if unknown. */
|
|
946
|
+
async removeSpeaker(speakerId: string): Promise<boolean> {
|
|
947
|
+
const mod = this.svModule();
|
|
948
|
+
if (!mod?.removeSpeaker) throw new Error('removeSpeaker not available');
|
|
949
|
+
return mod.removeSpeaker(speakerId);
|
|
950
|
+
}
|
|
951
|
+
|
|
952
|
+
/** Enrolled speaker ids, in insertion order. */
|
|
953
|
+
async getSpeakerIds(): Promise<string[]> {
|
|
954
|
+
const mod = this.svModule();
|
|
955
|
+
if (!mod?.getSpeakerIds) return [];
|
|
956
|
+
return mod.getSpeakerIds();
|
|
957
|
+
}
|
|
958
|
+
|
|
864
959
|
// Android: native pauseSpeechRecognitionLite is now bounded internally (~500ms, see
|
|
865
960
|
// STT.kt runPauseResumeSerializedOnMain), so this timeout is a backstop, not the
|
|
866
961
|
// primary fix - it guarantees this promise settles even if the bridge itself stalls.
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
File without changes
|