react-native-davoice 1.0.12 → 1.0.13
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/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 +35 -12
- package/ios/SpeechBridge/SpeechBridge.m +134 -1
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64/DavoiceTTS.framework/DavoiceTTS +0 -0
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios.abi.json +7527 -7457
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios.private.swiftinterface +55 -55
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios.swiftinterface +55 -55
- 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/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.abi.json +8794 -8724
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +56 -56
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.swiftinterface +56 -56
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.abi.json +8794 -8724
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +56 -56
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +56 -56
- 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 +24 -24
- package/package.json +1 -1
- package/speech/index.ts +119 -2
|
@@ -15,6 +15,62 @@ import _StringProcessing
|
|
|
15
15
|
import _SwiftConcurrencyShims
|
|
16
16
|
import onnxruntime_objc
|
|
17
17
|
import phonemes
|
|
18
|
+
public typealias EngineSchedule = (_ url: Foundation.URL, _ onDone: @escaping () -> Swift.Void) -> Swift.Bool
|
|
19
|
+
public typealias IsEngineReady = () -> Swift.Bool
|
|
20
|
+
public typealias useOnlyEnginePlayback = () -> Swift.Bool
|
|
21
|
+
public typealias StopEnginePlayback = () -> Swift.Void
|
|
22
|
+
public typealias CurrentEngineProvider = () -> AVFAudio.AVAudioEngine?
|
|
23
|
+
public enum AudioPlaybackHook {
|
|
24
|
+
public static var engineScheduleFile: DavoiceTTS.EngineSchedule?
|
|
25
|
+
public static var isEngineReady: DavoiceTTS.IsEngineReady?
|
|
26
|
+
public static var useOnlyEnginePlayback: DavoiceTTS.useOnlyEnginePlayback?
|
|
27
|
+
public static var stopEnginePlayback: DavoiceTTS.StopEnginePlayback?
|
|
28
|
+
public static var currentEngine: DavoiceTTS.CurrentEngineProvider?
|
|
29
|
+
}
|
|
30
|
+
@objc public protocol STTDelegate {
|
|
31
|
+
@objc func stt(_ stt: DavoiceTTS.STT, didEmitEvent name: Swift.String, body: [Swift.String : Any]?)
|
|
32
|
+
}
|
|
33
|
+
@objc @_inheritsConvenienceInitializers @objcMembers final public class STT : ObjectiveC.NSObject, Speech.SFSpeechRecognizerDelegate {
|
|
34
|
+
@objc weak final public var delegate: (any DavoiceTTS.STTDelegate)?
|
|
35
|
+
@objc final public var continuous: Swift.Bool
|
|
36
|
+
@objc final public var aecEnabled: Swift.Bool
|
|
37
|
+
@objc final public var force16kMicSampleRate: Swift.Bool
|
|
38
|
+
@objc final public var useLegacySpeakerGateBehavior: Swift.Bool
|
|
39
|
+
@objc final public var useSpeakerGateHangover: Swift.Bool
|
|
40
|
+
@objc final public var speakerGateHangoverSeconds: Swift.Double
|
|
41
|
+
@objc final public var useShortSpeakerVerificationTailWindow: Swift.Bool
|
|
42
|
+
@objc final public var shortSpeakerVerificationTailSeconds: Swift.Float
|
|
43
|
+
@objc final public var speakerPreRollFlushMaxSeconds: Swift.Double
|
|
44
|
+
@objc public static let supportedEvents: [Swift.String]
|
|
45
|
+
@objc final public func setLicense(licenseKey: Swift.String) -> Swift.Bool
|
|
46
|
+
@objc final public func pauseSpeechRecognitionLite()
|
|
47
|
+
@objc final public func pauseSpeechRecognitionLiteAndWait(_ timeoutMs: Foundation.NSNumber, completion: @escaping (Swift.Bool, Swift.String?) -> Swift.Void)
|
|
48
|
+
@objc final public func unPauseSpeechRecognitionLite(_ times: Foundation.NSNumber)
|
|
49
|
+
@objc(unPauseSpeechRecognitionLite:preFetch:) final public func unPauseSpeechRecognitionLite(_ times: Foundation.NSNumber, preFetch: Foundation.NSNumber)
|
|
50
|
+
@objc final public func unPauseSpeechRecognitionLiteAndWait(_ times: Foundation.NSNumber, preFetch: Foundation.NSNumber, timeoutMs: Foundation.NSNumber, completion: @escaping (Swift.Bool, Swift.String?) -> Swift.Void)
|
|
51
|
+
@objc final public func pauseMicrophoneAndWait(_ timeoutMs: Foundation.NSNumber, completion: @escaping (Swift.Bool, Swift.String?) -> Swift.Void)
|
|
52
|
+
@objc final public func unPauseMicrophoneAndWait(_ timeoutMs: Foundation.NSNumber, completion: @escaping (Swift.Bool, Swift.String?) -> Swift.Void)
|
|
53
|
+
@objc final public func pauseMicrophone()
|
|
54
|
+
@objc final public func unPauseMicrophone()
|
|
55
|
+
@objc final public func setAECEnabled(_ enabled: Swift.Bool)
|
|
56
|
+
@objc final public func isAECEnabled() -> Swift.Bool
|
|
57
|
+
@objc final public func isSpeechAvailable(_ completion: @escaping (Swift.Bool) -> Swift.Void)
|
|
58
|
+
@objc final public func isRecognizing() -> Swift.Bool
|
|
59
|
+
@objc final public func startSpeech(localeStr: Swift.String?)
|
|
60
|
+
@objc final public func startSpeech(localeStr: Swift.String?, onboardingJsonPath: Swift.String)
|
|
61
|
+
@objc final public func stopSpeech(_ completion: ((Swift.Bool) -> Swift.Void)? = nil)
|
|
62
|
+
@objc final public func cancelSpeech(_ completion: ((Swift.Bool) -> Swift.Void)? = nil)
|
|
63
|
+
@objc final public func destroySpeech(_ completion: ((Swift.Bool) -> Swift.Void)? = nil)
|
|
64
|
+
@objc final public func teardown()
|
|
65
|
+
@objc final public func speechRecognizer(_ speechRecognizer: Speech.SFSpeechRecognizer, availabilityDidChange available: Swift.Bool)
|
|
66
|
+
@objc override dynamic public init()
|
|
67
|
+
@objc deinit
|
|
68
|
+
}
|
|
69
|
+
@_inheritsConvenienceInitializers @objc final public class LicenseManager : ObjectiveC.NSObject {
|
|
70
|
+
@objc public static func isLicenseValid(licenseKey: Swift.String) -> Swift.Bool
|
|
71
|
+
@objc override dynamic public init()
|
|
72
|
+
@objc deinit
|
|
73
|
+
}
|
|
18
74
|
@objc @_inheritsConvenienceInitializers @_hasMissingDesignatedInitializers final public class SwiftSoundQueue : ObjectiveC.NSObject, AVFAudio.AVAudioPlayerDelegate {
|
|
19
75
|
@objc deinit
|
|
20
76
|
public static let shared: DavoiceTTS.SwiftSoundQueue
|
|
@@ -53,23 +109,6 @@ import phonemes
|
|
|
53
109
|
@objc final public func playWav(_ url: Foundation.URL, markAsLastUtterance: Swift.Bool = true)
|
|
54
110
|
@objc final public func playBuffer(_ buffer: AVFAudio.AVAudioPCMBuffer, markAsLastUtterance: Swift.Bool = true)
|
|
55
111
|
}
|
|
56
|
-
@_inheritsConvenienceInitializers @objc final public class LicenseManager : ObjectiveC.NSObject {
|
|
57
|
-
@objc public static func isLicenseValid(licenseKey: Swift.String) -> Swift.Bool
|
|
58
|
-
@objc override dynamic public init()
|
|
59
|
-
@objc deinit
|
|
60
|
-
}
|
|
61
|
-
public typealias EngineSchedule = (_ url: Foundation.URL, _ onDone: @escaping () -> Swift.Void) -> Swift.Bool
|
|
62
|
-
public typealias IsEngineReady = () -> Swift.Bool
|
|
63
|
-
public typealias useOnlyEnginePlayback = () -> Swift.Bool
|
|
64
|
-
public typealias StopEnginePlayback = () -> Swift.Void
|
|
65
|
-
public typealias CurrentEngineProvider = () -> AVFAudio.AVAudioEngine?
|
|
66
|
-
public enum AudioPlaybackHook {
|
|
67
|
-
public static var engineScheduleFile: DavoiceTTS.EngineSchedule?
|
|
68
|
-
public static var isEngineReady: DavoiceTTS.IsEngineReady?
|
|
69
|
-
public static var useOnlyEnginePlayback: DavoiceTTS.useOnlyEnginePlayback?
|
|
70
|
-
public static var stopEnginePlayback: DavoiceTTS.StopEnginePlayback?
|
|
71
|
-
public static var currentEngine: DavoiceTTS.CurrentEngineProvider?
|
|
72
|
-
}
|
|
73
112
|
public enum SVLogLevel : Swift.Int, Swift.Codable {
|
|
74
113
|
case off, error, warn, info, debug, trace
|
|
75
114
|
public init?(rawValue: Swift.Int)
|
|
@@ -172,45 +211,6 @@ public enum SpeakerVerificationError : Swift.Error, Swift.CustomStringConvertibl
|
|
|
172
211
|
@objc override dynamic public init()
|
|
173
212
|
@objc deinit
|
|
174
213
|
}
|
|
175
|
-
@objc public protocol STTDelegate {
|
|
176
|
-
@objc func stt(_ stt: DavoiceTTS.STT, didEmitEvent name: Swift.String, body: [Swift.String : Any]?)
|
|
177
|
-
}
|
|
178
|
-
@objc @_inheritsConvenienceInitializers @objcMembers final public class STT : ObjectiveC.NSObject, Speech.SFSpeechRecognizerDelegate {
|
|
179
|
-
@objc weak final public var delegate: (any DavoiceTTS.STTDelegate)?
|
|
180
|
-
@objc final public var continuous: Swift.Bool
|
|
181
|
-
@objc final public var aecEnabled: Swift.Bool
|
|
182
|
-
@objc final public var force16kMicSampleRate: Swift.Bool
|
|
183
|
-
@objc final public var useLegacySpeakerGateBehavior: Swift.Bool
|
|
184
|
-
@objc final public var useSpeakerGateHangover: Swift.Bool
|
|
185
|
-
@objc final public var speakerGateHangoverSeconds: Swift.Double
|
|
186
|
-
@objc final public var useShortSpeakerVerificationTailWindow: Swift.Bool
|
|
187
|
-
@objc final public var shortSpeakerVerificationTailSeconds: Swift.Float
|
|
188
|
-
@objc final public var speakerPreRollFlushMaxSeconds: Swift.Double
|
|
189
|
-
@objc public static let supportedEvents: [Swift.String]
|
|
190
|
-
@objc final public func setLicense(licenseKey: Swift.String) -> Swift.Bool
|
|
191
|
-
@objc final public func pauseSpeechRecognitionLite()
|
|
192
|
-
@objc final public func pauseSpeechRecognitionLiteAndWait(_ timeoutMs: Foundation.NSNumber, completion: @escaping (Swift.Bool, Swift.String?) -> Swift.Void)
|
|
193
|
-
@objc final public func unPauseSpeechRecognitionLite(_ times: Foundation.NSNumber)
|
|
194
|
-
@objc(unPauseSpeechRecognitionLite:preFetch:) final public func unPauseSpeechRecognitionLite(_ times: Foundation.NSNumber, preFetch: Foundation.NSNumber)
|
|
195
|
-
@objc final public func unPauseSpeechRecognitionLiteAndWait(_ times: Foundation.NSNumber, preFetch: Foundation.NSNumber, timeoutMs: Foundation.NSNumber, completion: @escaping (Swift.Bool, Swift.String?) -> Swift.Void)
|
|
196
|
-
@objc final public func pauseMicrophoneAndWait(_ timeoutMs: Foundation.NSNumber, completion: @escaping (Swift.Bool, Swift.String?) -> Swift.Void)
|
|
197
|
-
@objc final public func unPauseMicrophoneAndWait(_ timeoutMs: Foundation.NSNumber, completion: @escaping (Swift.Bool, Swift.String?) -> Swift.Void)
|
|
198
|
-
@objc final public func pauseMicrophone()
|
|
199
|
-
@objc final public func unPauseMicrophone()
|
|
200
|
-
@objc final public func setAECEnabled(_ enabled: Swift.Bool)
|
|
201
|
-
@objc final public func isAECEnabled() -> Swift.Bool
|
|
202
|
-
@objc final public func isSpeechAvailable(_ completion: @escaping (Swift.Bool) -> Swift.Void)
|
|
203
|
-
@objc final public func isRecognizing() -> Swift.Bool
|
|
204
|
-
@objc final public func startSpeech(localeStr: Swift.String?)
|
|
205
|
-
@objc final public func startSpeech(localeStr: Swift.String?, onboardingJsonPath: Swift.String)
|
|
206
|
-
@objc final public func stopSpeech(_ completion: ((Swift.Bool) -> Swift.Void)? = nil)
|
|
207
|
-
@objc final public func cancelSpeech(_ completion: ((Swift.Bool) -> Swift.Void)? = nil)
|
|
208
|
-
@objc final public func destroySpeech(_ completion: ((Swift.Bool) -> Swift.Void)? = nil)
|
|
209
|
-
@objc final public func teardown()
|
|
210
|
-
@objc final public func speechRecognizer(_ speechRecognizer: Speech.SFSpeechRecognizer, availabilityDidChange available: Swift.Bool)
|
|
211
|
-
@objc override dynamic public init()
|
|
212
|
-
@objc deinit
|
|
213
|
-
}
|
|
214
214
|
extension DavoiceTTS.SVLogLevel : Swift.Equatable {}
|
|
215
215
|
extension DavoiceTTS.SVLogLevel : Swift.Hashable {}
|
|
216
216
|
extension DavoiceTTS.SVLogLevel : Swift.RawRepresentable {}
|
|
@@ -15,6 +15,62 @@ import _StringProcessing
|
|
|
15
15
|
import _SwiftConcurrencyShims
|
|
16
16
|
import onnxruntime_objc
|
|
17
17
|
import phonemes
|
|
18
|
+
public typealias EngineSchedule = (_ url: Foundation.URL, _ onDone: @escaping () -> Swift.Void) -> Swift.Bool
|
|
19
|
+
public typealias IsEngineReady = () -> Swift.Bool
|
|
20
|
+
public typealias useOnlyEnginePlayback = () -> Swift.Bool
|
|
21
|
+
public typealias StopEnginePlayback = () -> Swift.Void
|
|
22
|
+
public typealias CurrentEngineProvider = () -> AVFAudio.AVAudioEngine?
|
|
23
|
+
public enum AudioPlaybackHook {
|
|
24
|
+
public static var engineScheduleFile: DavoiceTTS.EngineSchedule?
|
|
25
|
+
public static var isEngineReady: DavoiceTTS.IsEngineReady?
|
|
26
|
+
public static var useOnlyEnginePlayback: DavoiceTTS.useOnlyEnginePlayback?
|
|
27
|
+
public static var stopEnginePlayback: DavoiceTTS.StopEnginePlayback?
|
|
28
|
+
public static var currentEngine: DavoiceTTS.CurrentEngineProvider?
|
|
29
|
+
}
|
|
30
|
+
@objc public protocol STTDelegate {
|
|
31
|
+
@objc func stt(_ stt: DavoiceTTS.STT, didEmitEvent name: Swift.String, body: [Swift.String : Any]?)
|
|
32
|
+
}
|
|
33
|
+
@objc @_inheritsConvenienceInitializers @objcMembers final public class STT : ObjectiveC.NSObject, Speech.SFSpeechRecognizerDelegate {
|
|
34
|
+
@objc weak final public var delegate: (any DavoiceTTS.STTDelegate)?
|
|
35
|
+
@objc final public var continuous: Swift.Bool
|
|
36
|
+
@objc final public var aecEnabled: Swift.Bool
|
|
37
|
+
@objc final public var force16kMicSampleRate: Swift.Bool
|
|
38
|
+
@objc final public var useLegacySpeakerGateBehavior: Swift.Bool
|
|
39
|
+
@objc final public var useSpeakerGateHangover: Swift.Bool
|
|
40
|
+
@objc final public var speakerGateHangoverSeconds: Swift.Double
|
|
41
|
+
@objc final public var useShortSpeakerVerificationTailWindow: Swift.Bool
|
|
42
|
+
@objc final public var shortSpeakerVerificationTailSeconds: Swift.Float
|
|
43
|
+
@objc final public var speakerPreRollFlushMaxSeconds: Swift.Double
|
|
44
|
+
@objc public static let supportedEvents: [Swift.String]
|
|
45
|
+
@objc final public func setLicense(licenseKey: Swift.String) -> Swift.Bool
|
|
46
|
+
@objc final public func pauseSpeechRecognitionLite()
|
|
47
|
+
@objc final public func pauseSpeechRecognitionLiteAndWait(_ timeoutMs: Foundation.NSNumber, completion: @escaping (Swift.Bool, Swift.String?) -> Swift.Void)
|
|
48
|
+
@objc final public func unPauseSpeechRecognitionLite(_ times: Foundation.NSNumber)
|
|
49
|
+
@objc(unPauseSpeechRecognitionLite:preFetch:) final public func unPauseSpeechRecognitionLite(_ times: Foundation.NSNumber, preFetch: Foundation.NSNumber)
|
|
50
|
+
@objc final public func unPauseSpeechRecognitionLiteAndWait(_ times: Foundation.NSNumber, preFetch: Foundation.NSNumber, timeoutMs: Foundation.NSNumber, completion: @escaping (Swift.Bool, Swift.String?) -> Swift.Void)
|
|
51
|
+
@objc final public func pauseMicrophoneAndWait(_ timeoutMs: Foundation.NSNumber, completion: @escaping (Swift.Bool, Swift.String?) -> Swift.Void)
|
|
52
|
+
@objc final public func unPauseMicrophoneAndWait(_ timeoutMs: Foundation.NSNumber, completion: @escaping (Swift.Bool, Swift.String?) -> Swift.Void)
|
|
53
|
+
@objc final public func pauseMicrophone()
|
|
54
|
+
@objc final public func unPauseMicrophone()
|
|
55
|
+
@objc final public func setAECEnabled(_ enabled: Swift.Bool)
|
|
56
|
+
@objc final public func isAECEnabled() -> Swift.Bool
|
|
57
|
+
@objc final public func isSpeechAvailable(_ completion: @escaping (Swift.Bool) -> Swift.Void)
|
|
58
|
+
@objc final public func isRecognizing() -> Swift.Bool
|
|
59
|
+
@objc final public func startSpeech(localeStr: Swift.String?)
|
|
60
|
+
@objc final public func startSpeech(localeStr: Swift.String?, onboardingJsonPath: Swift.String)
|
|
61
|
+
@objc final public func stopSpeech(_ completion: ((Swift.Bool) -> Swift.Void)? = nil)
|
|
62
|
+
@objc final public func cancelSpeech(_ completion: ((Swift.Bool) -> Swift.Void)? = nil)
|
|
63
|
+
@objc final public func destroySpeech(_ completion: ((Swift.Bool) -> Swift.Void)? = nil)
|
|
64
|
+
@objc final public func teardown()
|
|
65
|
+
@objc final public func speechRecognizer(_ speechRecognizer: Speech.SFSpeechRecognizer, availabilityDidChange available: Swift.Bool)
|
|
66
|
+
@objc override dynamic public init()
|
|
67
|
+
@objc deinit
|
|
68
|
+
}
|
|
69
|
+
@_inheritsConvenienceInitializers @objc final public class LicenseManager : ObjectiveC.NSObject {
|
|
70
|
+
@objc public static func isLicenseValid(licenseKey: Swift.String) -> Swift.Bool
|
|
71
|
+
@objc override dynamic public init()
|
|
72
|
+
@objc deinit
|
|
73
|
+
}
|
|
18
74
|
@objc @_inheritsConvenienceInitializers @_hasMissingDesignatedInitializers final public class SwiftSoundQueue : ObjectiveC.NSObject, AVFAudio.AVAudioPlayerDelegate {
|
|
19
75
|
@objc deinit
|
|
20
76
|
public static let shared: DavoiceTTS.SwiftSoundQueue
|
|
@@ -53,23 +109,6 @@ import phonemes
|
|
|
53
109
|
@objc final public func playWav(_ url: Foundation.URL, markAsLastUtterance: Swift.Bool = true)
|
|
54
110
|
@objc final public func playBuffer(_ buffer: AVFAudio.AVAudioPCMBuffer, markAsLastUtterance: Swift.Bool = true)
|
|
55
111
|
}
|
|
56
|
-
@_inheritsConvenienceInitializers @objc final public class LicenseManager : ObjectiveC.NSObject {
|
|
57
|
-
@objc public static func isLicenseValid(licenseKey: Swift.String) -> Swift.Bool
|
|
58
|
-
@objc override dynamic public init()
|
|
59
|
-
@objc deinit
|
|
60
|
-
}
|
|
61
|
-
public typealias EngineSchedule = (_ url: Foundation.URL, _ onDone: @escaping () -> Swift.Void) -> Swift.Bool
|
|
62
|
-
public typealias IsEngineReady = () -> Swift.Bool
|
|
63
|
-
public typealias useOnlyEnginePlayback = () -> Swift.Bool
|
|
64
|
-
public typealias StopEnginePlayback = () -> Swift.Void
|
|
65
|
-
public typealias CurrentEngineProvider = () -> AVFAudio.AVAudioEngine?
|
|
66
|
-
public enum AudioPlaybackHook {
|
|
67
|
-
public static var engineScheduleFile: DavoiceTTS.EngineSchedule?
|
|
68
|
-
public static var isEngineReady: DavoiceTTS.IsEngineReady?
|
|
69
|
-
public static var useOnlyEnginePlayback: DavoiceTTS.useOnlyEnginePlayback?
|
|
70
|
-
public static var stopEnginePlayback: DavoiceTTS.StopEnginePlayback?
|
|
71
|
-
public static var currentEngine: DavoiceTTS.CurrentEngineProvider?
|
|
72
|
-
}
|
|
73
112
|
public enum SVLogLevel : Swift.Int, Swift.Codable {
|
|
74
113
|
case off, error, warn, info, debug, trace
|
|
75
114
|
public init?(rawValue: Swift.Int)
|
|
@@ -172,45 +211,6 @@ public enum SpeakerVerificationError : Swift.Error, Swift.CustomStringConvertibl
|
|
|
172
211
|
@objc override dynamic public init()
|
|
173
212
|
@objc deinit
|
|
174
213
|
}
|
|
175
|
-
@objc public protocol STTDelegate {
|
|
176
|
-
@objc func stt(_ stt: DavoiceTTS.STT, didEmitEvent name: Swift.String, body: [Swift.String : Any]?)
|
|
177
|
-
}
|
|
178
|
-
@objc @_inheritsConvenienceInitializers @objcMembers final public class STT : ObjectiveC.NSObject, Speech.SFSpeechRecognizerDelegate {
|
|
179
|
-
@objc weak final public var delegate: (any DavoiceTTS.STTDelegate)?
|
|
180
|
-
@objc final public var continuous: Swift.Bool
|
|
181
|
-
@objc final public var aecEnabled: Swift.Bool
|
|
182
|
-
@objc final public var force16kMicSampleRate: Swift.Bool
|
|
183
|
-
@objc final public var useLegacySpeakerGateBehavior: Swift.Bool
|
|
184
|
-
@objc final public var useSpeakerGateHangover: Swift.Bool
|
|
185
|
-
@objc final public var speakerGateHangoverSeconds: Swift.Double
|
|
186
|
-
@objc final public var useShortSpeakerVerificationTailWindow: Swift.Bool
|
|
187
|
-
@objc final public var shortSpeakerVerificationTailSeconds: Swift.Float
|
|
188
|
-
@objc final public var speakerPreRollFlushMaxSeconds: Swift.Double
|
|
189
|
-
@objc public static let supportedEvents: [Swift.String]
|
|
190
|
-
@objc final public func setLicense(licenseKey: Swift.String) -> Swift.Bool
|
|
191
|
-
@objc final public func pauseSpeechRecognitionLite()
|
|
192
|
-
@objc final public func pauseSpeechRecognitionLiteAndWait(_ timeoutMs: Foundation.NSNumber, completion: @escaping (Swift.Bool, Swift.String?) -> Swift.Void)
|
|
193
|
-
@objc final public func unPauseSpeechRecognitionLite(_ times: Foundation.NSNumber)
|
|
194
|
-
@objc(unPauseSpeechRecognitionLite:preFetch:) final public func unPauseSpeechRecognitionLite(_ times: Foundation.NSNumber, preFetch: Foundation.NSNumber)
|
|
195
|
-
@objc final public func unPauseSpeechRecognitionLiteAndWait(_ times: Foundation.NSNumber, preFetch: Foundation.NSNumber, timeoutMs: Foundation.NSNumber, completion: @escaping (Swift.Bool, Swift.String?) -> Swift.Void)
|
|
196
|
-
@objc final public func pauseMicrophoneAndWait(_ timeoutMs: Foundation.NSNumber, completion: @escaping (Swift.Bool, Swift.String?) -> Swift.Void)
|
|
197
|
-
@objc final public func unPauseMicrophoneAndWait(_ timeoutMs: Foundation.NSNumber, completion: @escaping (Swift.Bool, Swift.String?) -> Swift.Void)
|
|
198
|
-
@objc final public func pauseMicrophone()
|
|
199
|
-
@objc final public func unPauseMicrophone()
|
|
200
|
-
@objc final public func setAECEnabled(_ enabled: Swift.Bool)
|
|
201
|
-
@objc final public func isAECEnabled() -> Swift.Bool
|
|
202
|
-
@objc final public func isSpeechAvailable(_ completion: @escaping (Swift.Bool) -> Swift.Void)
|
|
203
|
-
@objc final public func isRecognizing() -> Swift.Bool
|
|
204
|
-
@objc final public func startSpeech(localeStr: Swift.String?)
|
|
205
|
-
@objc final public func startSpeech(localeStr: Swift.String?, onboardingJsonPath: Swift.String)
|
|
206
|
-
@objc final public func stopSpeech(_ completion: ((Swift.Bool) -> Swift.Void)? = nil)
|
|
207
|
-
@objc final public func cancelSpeech(_ completion: ((Swift.Bool) -> Swift.Void)? = nil)
|
|
208
|
-
@objc final public func destroySpeech(_ completion: ((Swift.Bool) -> Swift.Void)? = nil)
|
|
209
|
-
@objc final public func teardown()
|
|
210
|
-
@objc final public func speechRecognizer(_ speechRecognizer: Speech.SFSpeechRecognizer, availabilityDidChange available: Swift.Bool)
|
|
211
|
-
@objc override dynamic public init()
|
|
212
|
-
@objc deinit
|
|
213
|
-
}
|
|
214
214
|
extension DavoiceTTS.SVLogLevel : Swift.Equatable {}
|
|
215
215
|
extension DavoiceTTS.SVLogLevel : Swift.Hashable {}
|
|
216
216
|
extension DavoiceTTS.SVLogLevel : Swift.RawRepresentable {}
|
|
Binary file
|
|
Binary file
|
|
@@ -14,11 +14,11 @@
|
|
|
14
14
|
</data>
|
|
15
15
|
<key>Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.abi.json</key>
|
|
16
16
|
<data>
|
|
17
|
-
|
|
17
|
+
Pwc9ISZGow0PIzg7cw2W4lRxJBY=
|
|
18
18
|
</data>
|
|
19
19
|
<key>Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface</key>
|
|
20
20
|
<data>
|
|
21
|
-
|
|
21
|
+
ehtqIHdpe5jGFBpmT/cvwuDKVmg=
|
|
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
|
-
|
|
29
|
+
ehtqIHdpe5jGFBpmT/cvwuDKVmg=
|
|
30
30
|
</data>
|
|
31
31
|
<key>Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.swiftmodule</key>
|
|
32
32
|
<data>
|
|
33
|
-
|
|
33
|
+
pu2k+C0sB8ka86MUTILzteuajXA=
|
|
34
34
|
</data>
|
|
35
35
|
<key>Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.abi.json</key>
|
|
36
36
|
<data>
|
|
37
|
-
|
|
37
|
+
Pwc9ISZGow0PIzg7cw2W4lRxJBY=
|
|
38
38
|
</data>
|
|
39
39
|
<key>Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface</key>
|
|
40
40
|
<data>
|
|
41
|
-
|
|
41
|
+
pXXRpoTXJbwVHysRqr5iKV347ko=
|
|
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
|
-
|
|
49
|
+
pXXRpoTXJbwVHysRqr5iKV347ko=
|
|
50
50
|
</data>
|
|
51
51
|
<key>Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.swiftmodule</key>
|
|
52
52
|
<data>
|
|
53
|
-
|
|
53
|
+
j4p5A4Vk76jGUCyjblB8IfbwzFk=
|
|
54
54
|
</data>
|
|
55
55
|
<key>Modules/module.modulemap</key>
|
|
56
56
|
<data>
|
|
@@ -74,22 +74,22 @@
|
|
|
74
74
|
<dict>
|
|
75
75
|
<key>hash</key>
|
|
76
76
|
<data>
|
|
77
|
-
|
|
77
|
+
Pwc9ISZGow0PIzg7cw2W4lRxJBY=
|
|
78
78
|
</data>
|
|
79
79
|
<key>hash2</key>
|
|
80
80
|
<data>
|
|
81
|
-
|
|
81
|
+
S0CxvoaOrcEQfZzO1XXorhGIOr2etFrwTuCFHJVTzeI=
|
|
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
|
+
ehtqIHdpe5jGFBpmT/cvwuDKVmg=
|
|
89
89
|
</data>
|
|
90
90
|
<key>hash2</key>
|
|
91
91
|
<data>
|
|
92
|
-
|
|
92
|
+
6X3uNODXQdQVQWOLVG9pCIT2xoTS/V+r8bzFVTxtUTE=
|
|
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
|
-
|
|
110
|
+
ehtqIHdpe5jGFBpmT/cvwuDKVmg=
|
|
111
111
|
</data>
|
|
112
112
|
<key>hash2</key>
|
|
113
113
|
<data>
|
|
114
|
-
|
|
114
|
+
6X3uNODXQdQVQWOLVG9pCIT2xoTS/V+r8bzFVTxtUTE=
|
|
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
|
+
pu2k+C0sB8ka86MUTILzteuajXA=
|
|
122
122
|
</data>
|
|
123
123
|
<key>hash2</key>
|
|
124
124
|
<data>
|
|
125
|
-
|
|
125
|
+
I+fAjW2RqGgQ9DBQr8rim6XjBVWKTDCyrWbuSkDbuok=
|
|
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
|
+
Pwc9ISZGow0PIzg7cw2W4lRxJBY=
|
|
133
133
|
</data>
|
|
134
134
|
<key>hash2</key>
|
|
135
135
|
<data>
|
|
136
|
-
|
|
136
|
+
S0CxvoaOrcEQfZzO1XXorhGIOr2etFrwTuCFHJVTzeI=
|
|
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
|
+
pXXRpoTXJbwVHysRqr5iKV347ko=
|
|
144
144
|
</data>
|
|
145
145
|
<key>hash2</key>
|
|
146
146
|
<data>
|
|
147
|
-
|
|
147
|
+
F+0XwvBz4tGBXSz6aNq3yQ+RLiFl7WLcq3J+1PAHLnA=
|
|
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
|
-
|
|
165
|
+
pXXRpoTXJbwVHysRqr5iKV347ko=
|
|
166
166
|
</data>
|
|
167
167
|
<key>hash2</key>
|
|
168
168
|
<data>
|
|
169
|
-
|
|
169
|
+
F+0XwvBz4tGBXSz6aNq3yQ+RLiFl7WLcq3J+1PAHLnA=
|
|
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
|
+
j4p5A4Vk76jGUCyjblB8IfbwzFk=
|
|
177
177
|
</data>
|
|
178
178
|
<key>hash2</key>
|
|
179
179
|
<data>
|
|
180
|
-
|
|
180
|
+
BgKz+0laWlUIQzqTP8YFtCy1y4xprlV0Ws44YGVSLrA=
|
|
181
181
|
</data>
|
|
182
182
|
</dict>
|
|
183
183
|
<key>Modules/module.modulemap</key>
|
package/package.json
CHANGED
package/speech/index.ts
CHANGED
|
@@ -34,6 +34,12 @@ function sleep(ms: number) {
|
|
|
34
34
|
return new Promise<void>((r) => setTimeout(r, ms));
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
+
let speechOpSeq = 0;
|
|
38
|
+
function nextSpeechOpId(prefix: string) {
|
|
39
|
+
speechOpSeq += 1;
|
|
40
|
+
return `${prefix}-${speechOpSeq}-${Date.now()}`;
|
|
41
|
+
}
|
|
42
|
+
|
|
37
43
|
// If you use typed-array -> base64, Buffer is convenient (works in RN)
|
|
38
44
|
let toBase64: (u8: Uint8Array) => string;
|
|
39
45
|
try {
|
|
@@ -184,6 +190,8 @@ class Speech {
|
|
|
184
190
|
// top of file (new state)
|
|
185
191
|
private lastLocale: string | null = null;
|
|
186
192
|
private lastModel: string | null = null;
|
|
193
|
+
private lastOnboardingJsonPath: string | null = null;
|
|
194
|
+
private hasCompletedFullInit = false;
|
|
187
195
|
private iosTtsOnly = false; // when true, use NativeTTS directly on iOS
|
|
188
196
|
|
|
189
197
|
|
|
@@ -386,11 +394,13 @@ class Speech {
|
|
|
386
394
|
|
|
387
395
|
this.lastLocale = opts.locale;
|
|
388
396
|
this.lastModel = modelPath;
|
|
397
|
+
this.lastOnboardingJsonPath = opts.onboardingJsonPath ?? null;
|
|
389
398
|
|
|
390
399
|
if (Platform.OS === 'ios' && NativeSpeech?.initAll) {
|
|
391
400
|
this.iosTtsOnly = false; // full unified mode
|
|
392
401
|
this.teardownListeners(); // re-wire listeners for unified
|
|
393
402
|
const r = await NativeSpeech.initAll({ ...opts, model: modelPath });
|
|
403
|
+
this.hasCompletedFullInit = true;
|
|
394
404
|
this.ensureListeners();
|
|
395
405
|
return r;
|
|
396
406
|
}
|
|
@@ -440,6 +450,7 @@ class Speech {
|
|
|
440
450
|
const modelExt = this.resolveModelExt(opts.model);
|
|
441
451
|
console.log('[MODELDBG] initAll.modelExt (resolved)=', modelExt);
|
|
442
452
|
await NativeTTS.initTTS({ model: modelPath, modelExt });
|
|
453
|
+
this.hasCompletedFullInit = true;
|
|
443
454
|
}
|
|
444
455
|
|
|
445
456
|
async destroyAll() {
|
|
@@ -450,6 +461,7 @@ class Speech {
|
|
|
450
461
|
// iOS unified
|
|
451
462
|
if (Platform.OS === 'ios' && NativeSpeech?.destroyAll) {
|
|
452
463
|
const r = await NativeSpeech.destroyAll();
|
|
464
|
+
this.hasCompletedFullInit = false;
|
|
453
465
|
this.iosTtsOnly = false;
|
|
454
466
|
this.lastLocale = this.lastLocale ?? null;
|
|
455
467
|
this.teardownListeners();
|
|
@@ -463,10 +475,97 @@ class Speech {
|
|
|
463
475
|
NativeSTT.destroySpeech(() => res());
|
|
464
476
|
});
|
|
465
477
|
} catch {}
|
|
478
|
+
this.hasCompletedFullInit = false;
|
|
466
479
|
this.teardownListeners();
|
|
467
480
|
return 'Destroyed';
|
|
468
481
|
}
|
|
469
482
|
|
|
483
|
+
async initWithoutModel() {
|
|
484
|
+
if (!this.hasCompletedFullInit || !this.lastLocale) {
|
|
485
|
+
throw new Error('initWithoutModel() requires a successful initAll() first.');
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
if (Platform.OS === 'ios' && NativeSpeech?.initWithoutModel) {
|
|
489
|
+
this.iosTtsOnly = false;
|
|
490
|
+
this.teardownListeners();
|
|
491
|
+
const r = await NativeSpeech.initWithoutModel({
|
|
492
|
+
locale: this.lastLocale,
|
|
493
|
+
onboardingJsonPath: this.lastOnboardingJsonPath,
|
|
494
|
+
});
|
|
495
|
+
this.ensureListeners();
|
|
496
|
+
return r;
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
if (!NativeSTT) {
|
|
500
|
+
throw new Error('Missing native STT bridge.');
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
this.ensureListeners();
|
|
504
|
+
return new Promise<void>((resolve, reject) => {
|
|
505
|
+
try {
|
|
506
|
+
if (typeof NativeSTT.initWithoutModel === 'function') {
|
|
507
|
+
NativeSTT.initWithoutModel(
|
|
508
|
+
this.lastLocale,
|
|
509
|
+
{ onboardingJsonPath: this.lastOnboardingJsonPath ?? null },
|
|
510
|
+
(err: string) => (err ? reject(new Error(err)) : resolve()),
|
|
511
|
+
);
|
|
512
|
+
return;
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
if (Platform.OS === 'android') {
|
|
516
|
+
NativeSTT.startSpeech(
|
|
517
|
+
this.lastLocale,
|
|
518
|
+
{
|
|
519
|
+
EXTRA_LANGUAGE_MODEL: 'LANGUAGE_MODEL_FREE_FORM',
|
|
520
|
+
EXTRA_MAX_RESULTS: 5,
|
|
521
|
+
EXTRA_PARTIAL_RESULTS: true,
|
|
522
|
+
REQUEST_PERMISSIONS_AUTO: true,
|
|
523
|
+
onboardingJsonPath: this.lastOnboardingJsonPath ?? null,
|
|
524
|
+
},
|
|
525
|
+
(err: string) => (err ? reject(new Error(err)) : resolve()),
|
|
526
|
+
);
|
|
527
|
+
return;
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
NativeSTT.startSpeech(this.lastLocale, (err: string) =>
|
|
531
|
+
err ? reject(new Error(err)) : resolve(),
|
|
532
|
+
);
|
|
533
|
+
} catch (e) {
|
|
534
|
+
reject(e as any);
|
|
535
|
+
}
|
|
536
|
+
});
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
async destroyWihtouModel() {
|
|
540
|
+
if (!this.hasCompletedFullInit) {
|
|
541
|
+
throw new Error('destroyWihtouModel() requires a successful initAll() first.');
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
if (Platform.OS === 'ios' && NativeSpeech?.destroyWihtouModel) {
|
|
545
|
+
return NativeSpeech.destroyWihtouModel();
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
return new Promise<void>((resolve) => {
|
|
549
|
+
try {
|
|
550
|
+
if (typeof NativeSTT?.destroyWihtouModel === 'function') {
|
|
551
|
+
NativeSTT.destroyWihtouModel(() => resolve());
|
|
552
|
+
return;
|
|
553
|
+
}
|
|
554
|
+
if (!NativeSTT?.destroySpeech) {
|
|
555
|
+
resolve();
|
|
556
|
+
return;
|
|
557
|
+
}
|
|
558
|
+
NativeSTT.destroySpeech(() => resolve());
|
|
559
|
+
} catch {
|
|
560
|
+
resolve();
|
|
561
|
+
}
|
|
562
|
+
});
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
async destroyWithoutModel() {
|
|
566
|
+
return this.destroyWihtouModel();
|
|
567
|
+
}
|
|
568
|
+
|
|
470
569
|
// ---------- STT ----------
|
|
471
570
|
async start(locale: string, options: Record<string, any> = {}) {
|
|
472
571
|
this.ensureListeners();
|
|
@@ -527,6 +626,8 @@ class Speech {
|
|
|
527
626
|
// TODO: CHECK THE NATIVE SIDE DOES NOT REALLY AWAITS
|
|
528
627
|
async pauseSpeechRecognition(): Promise<void> {
|
|
529
628
|
this.logCall('pauseSpeechRecognitionLite');
|
|
629
|
+
const opId = nextSpeechOpId('pause-stt');
|
|
630
|
+
const startedAt = Date.now();
|
|
530
631
|
|
|
531
632
|
const mod: any = Platform.OS === 'ios' ? NativeSpeech : NativeSTT;
|
|
532
633
|
const fn = mod?.pauseSpeechRecognitionLite;
|
|
@@ -537,7 +638,9 @@ class Speech {
|
|
|
537
638
|
}
|
|
538
639
|
|
|
539
640
|
if (Platform.OS === 'ios' && typeof mod?.pauseSpeechRecognitionLiteAsync === 'function') {
|
|
641
|
+
dbg('[pauseSpeechRecognitionLiteAsync] begin', { opId, timeoutMs: 1500 });
|
|
540
642
|
const result = await mod.pauseSpeechRecognitionLiteAsync(1500);
|
|
643
|
+
dbg('[pauseSpeechRecognitionLiteAsync] resolved', { opId, elapsedMs: Date.now() - startedAt, result });
|
|
541
644
|
if (result?.ok === false) dbgErr('pauseSpeechRecognitionLiteAsync failed', result?.reason);
|
|
542
645
|
return;
|
|
543
646
|
}
|
|
@@ -569,8 +672,14 @@ class Speech {
|
|
|
569
672
|
});
|
|
570
673
|
}
|
|
571
674
|
|
|
572
|
-
async unPauseSpeechRecognition(
|
|
675
|
+
async unPauseSpeechRecognition(
|
|
676
|
+
times: number,
|
|
677
|
+
preFetchMs: number = 0,
|
|
678
|
+
timeoutMs: number = 2500,
|
|
679
|
+
): Promise<void> {
|
|
573
680
|
this.logCall('unPauseSpeechRecognitionLite', { times, preFetchMs });
|
|
681
|
+
const opId = nextSpeechOpId('unpause-stt');
|
|
682
|
+
const startedAt = Date.now();
|
|
574
683
|
|
|
575
684
|
const mod: any = Platform.OS === 'ios' ? NativeSpeech : NativeSTT;
|
|
576
685
|
const fn = mod?.unPauseSpeechRecognitionLite;
|
|
@@ -581,7 +690,15 @@ class Speech {
|
|
|
581
690
|
}
|
|
582
691
|
|
|
583
692
|
if (Platform.OS === 'ios' && typeof mod?.unPauseSpeechRecognitionLiteAsync === 'function') {
|
|
584
|
-
|
|
693
|
+
dbg('[unPauseSpeechRecognitionLiteAsync] begin', { opId, times, preFetchMs, timeoutMs });
|
|
694
|
+
const result = await mod.unPauseSpeechRecognitionLiteAsync(times, preFetchMs, timeoutMs);
|
|
695
|
+
dbg('[unPauseSpeechRecognitionLiteAsync] resolved', {
|
|
696
|
+
opId,
|
|
697
|
+
times,
|
|
698
|
+
preFetchMs,
|
|
699
|
+
elapsedMs: Date.now() - startedAt,
|
|
700
|
+
result,
|
|
701
|
+
});
|
|
585
702
|
if (result?.ok === false) dbgErr('unPauseSpeechRecognitionLiteAsync failed', result?.reason);
|
|
586
703
|
return;
|
|
587
704
|
}
|