react-native-davoice-tts 1.0.325 → 1.0.326
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/src/main/java/com/davoice/stt/rn/STTModule.kt +35 -12
- package/ios/SpeechBridge/SpeechBridge.m +87 -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 +8777 -8756
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios.private.swiftinterface +49 -49
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios.swiftinterface +49 -49
- 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 +8186 -8165
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +52 -52
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.swiftinterface +52 -52
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.abi.json +8186 -8165
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +52 -52
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +52 -52
- 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 +93 -0
|
@@ -15,23 +15,6 @@ 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
|
-
@_inheritsConvenienceInitializers @objc final public class LicenseManager : ObjectiveC.NSObject {
|
|
31
|
-
@objc public static func isLicenseValid(licenseKey: Swift.String) -> Swift.Bool
|
|
32
|
-
@objc override dynamic public init()
|
|
33
|
-
@objc deinit
|
|
34
|
-
}
|
|
35
18
|
public enum SVLogLevel : Swift.Int, Swift.Codable {
|
|
36
19
|
case off, error, warn, info, debug, trace
|
|
37
20
|
public init?(rawValue: Swift.Int)
|
|
@@ -134,6 +117,44 @@ public enum SpeakerVerificationError : Swift.Error, Swift.CustomStringConvertibl
|
|
|
134
117
|
@objc override dynamic public init()
|
|
135
118
|
@objc deinit
|
|
136
119
|
}
|
|
120
|
+
@objc @_inheritsConvenienceInitializers @_hasMissingDesignatedInitializers final public class SwiftSoundQueue : ObjectiveC.NSObject, AVFAudio.AVAudioPlayerDelegate {
|
|
121
|
+
@objc deinit
|
|
122
|
+
public static let shared: DavoiceTTS.SwiftSoundQueue
|
|
123
|
+
final public func notifyWhenURLFinishes(_ url: Foundation.URL, _ cb: @escaping () -> Swift.Void)
|
|
124
|
+
final public var onItemDone: ((Foundation.URL) -> Swift.Void)?
|
|
125
|
+
final public var onQueueEmpty: (() -> Swift.Void)?
|
|
126
|
+
final public func enqueue(_ source: DavoiceTTS.SwiftSoundQueue.Source)
|
|
127
|
+
final public func enqueueMany(_ sources: [DavoiceTTS.SwiftSoundQueue.Source])
|
|
128
|
+
final public func stop()
|
|
129
|
+
public enum Source {
|
|
130
|
+
case fileURL(Foundation.URL)
|
|
131
|
+
case named(Swift.String)
|
|
132
|
+
}
|
|
133
|
+
@objc final public func audioPlayerDidFinishPlaying(_ p: AVFAudio.AVAudioPlayer, successfully ok: Swift.Bool)
|
|
134
|
+
final public func activatePlaybackOnlySession()
|
|
135
|
+
final public func activateSpeaker()
|
|
136
|
+
}
|
|
137
|
+
@objc @objcMembers final public class DaVoiceTTS : ObjectiveC.NSObject {
|
|
138
|
+
public struct Config {
|
|
139
|
+
}
|
|
140
|
+
@objc final public var onLastUtteranceFinished: (() -> Swift.Void)?
|
|
141
|
+
@objc deinit
|
|
142
|
+
@objc public static func activateLicense(licenseKey: Swift.String) -> Swift.Bool
|
|
143
|
+
@objc final public func setLicense(licenseKey: Swift.String) -> Swift.Bool
|
|
144
|
+
public struct Biquad {
|
|
145
|
+
public var b0: Swift.Float, b1: Swift.Float, b2: Swift.Float, a1: Swift.Float, a2: Swift.Float
|
|
146
|
+
public init(b0: Swift.Float, b1: Swift.Float, b2: Swift.Float, a1: Swift.Float, a2: Swift.Float)
|
|
147
|
+
public mutating func process(_ x: Swift.UnsafeMutablePointer<Swift.Float>, _ n: Swift.Int)
|
|
148
|
+
}
|
|
149
|
+
@objc public init(model: Foundation.URL) throws
|
|
150
|
+
@objc final public func stopSpeaking()
|
|
151
|
+
@objc final public func destroy()
|
|
152
|
+
@objc(speak:sid:) final public func speak(_ txt: Swift.String, sid: Swift.Int32 = 0)
|
|
153
|
+
@objc(speak:sid:speed:) final public func speak(_ txt: Swift.String, sid: Swift.Int32 = 0, speed: Swift.Float)
|
|
154
|
+
@objc final public func synthesize_top(_ _text: Swift.String, speakerId: Swift.Int32 = 0, token: Foundation.UUID, speed_adjuster: Swift.Float) throws -> AVFAudio.AVAudioPCMBuffer
|
|
155
|
+
@objc final public func playWav(_ url: Foundation.URL, markAsLastUtterance: Swift.Bool = true)
|
|
156
|
+
@objc final public func playBuffer(_ buffer: AVFAudio.AVAudioPCMBuffer, markAsLastUtterance: Swift.Bool = true)
|
|
157
|
+
}
|
|
137
158
|
@objc public protocol STTDelegate {
|
|
138
159
|
@objc func stt(_ stt: DavoiceTTS.STT, didEmitEvent name: Swift.String, body: [Swift.String : Any]?)
|
|
139
160
|
}
|
|
@@ -173,43 +194,22 @@ public enum SpeakerVerificationError : Swift.Error, Swift.CustomStringConvertibl
|
|
|
173
194
|
@objc override dynamic public init()
|
|
174
195
|
@objc deinit
|
|
175
196
|
}
|
|
176
|
-
@
|
|
197
|
+
@_inheritsConvenienceInitializers @objc final public class LicenseManager : ObjectiveC.NSObject {
|
|
198
|
+
@objc public static func isLicenseValid(licenseKey: Swift.String) -> Swift.Bool
|
|
199
|
+
@objc override dynamic public init()
|
|
177
200
|
@objc deinit
|
|
178
|
-
public static let shared: DavoiceTTS.SwiftSoundQueue
|
|
179
|
-
final public func notifyWhenURLFinishes(_ url: Foundation.URL, _ cb: @escaping () -> Swift.Void)
|
|
180
|
-
final public var onItemDone: ((Foundation.URL) -> Swift.Void)?
|
|
181
|
-
final public var onQueueEmpty: (() -> Swift.Void)?
|
|
182
|
-
final public func enqueue(_ source: DavoiceTTS.SwiftSoundQueue.Source)
|
|
183
|
-
final public func enqueueMany(_ sources: [DavoiceTTS.SwiftSoundQueue.Source])
|
|
184
|
-
final public func stop()
|
|
185
|
-
public enum Source {
|
|
186
|
-
case fileURL(Foundation.URL)
|
|
187
|
-
case named(Swift.String)
|
|
188
|
-
}
|
|
189
|
-
@objc final public func audioPlayerDidFinishPlaying(_ p: AVFAudio.AVAudioPlayer, successfully ok: Swift.Bool)
|
|
190
|
-
final public func activatePlaybackOnlySession()
|
|
191
|
-
final public func activateSpeaker()
|
|
192
201
|
}
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
public
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
}
|
|
205
|
-
@objc public init(model: Foundation.URL) throws
|
|
206
|
-
@objc final public func stopSpeaking()
|
|
207
|
-
@objc final public func destroy()
|
|
208
|
-
@objc(speak:sid:) final public func speak(_ txt: Swift.String, sid: Swift.Int32 = 0)
|
|
209
|
-
@objc(speak:sid:speed:) final public func speak(_ txt: Swift.String, sid: Swift.Int32 = 0, speed: Swift.Float)
|
|
210
|
-
@objc final public func synthesize_top(_ _text: Swift.String, speakerId: Swift.Int32 = 0, token: Foundation.UUID, speed_adjuster: Swift.Float) throws -> AVFAudio.AVAudioPCMBuffer
|
|
211
|
-
@objc final public func playWav(_ url: Foundation.URL, markAsLastUtterance: Swift.Bool = true)
|
|
212
|
-
@objc final public func playBuffer(_ buffer: AVFAudio.AVAudioPCMBuffer, markAsLastUtterance: Swift.Bool = true)
|
|
202
|
+
public typealias EngineSchedule = (_ url: Foundation.URL, _ onDone: @escaping () -> Swift.Void) -> Swift.Bool
|
|
203
|
+
public typealias IsEngineReady = () -> Swift.Bool
|
|
204
|
+
public typealias useOnlyEnginePlayback = () -> Swift.Bool
|
|
205
|
+
public typealias StopEnginePlayback = () -> Swift.Void
|
|
206
|
+
public typealias CurrentEngineProvider = () -> AVFAudio.AVAudioEngine?
|
|
207
|
+
public enum AudioPlaybackHook {
|
|
208
|
+
public static var engineScheduleFile: DavoiceTTS.EngineSchedule?
|
|
209
|
+
public static var isEngineReady: DavoiceTTS.IsEngineReady?
|
|
210
|
+
public static var useOnlyEnginePlayback: DavoiceTTS.useOnlyEnginePlayback?
|
|
211
|
+
public static var stopEnginePlayback: DavoiceTTS.StopEnginePlayback?
|
|
212
|
+
public static var currentEngine: DavoiceTTS.CurrentEngineProvider?
|
|
213
213
|
}
|
|
214
214
|
extension DavoiceTTS.SVLogLevel : Swift.Equatable {}
|
|
215
215
|
extension DavoiceTTS.SVLogLevel : Swift.Hashable {}
|
|
@@ -15,23 +15,6 @@ 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
|
-
@_inheritsConvenienceInitializers @objc final public class LicenseManager : ObjectiveC.NSObject {
|
|
31
|
-
@objc public static func isLicenseValid(licenseKey: Swift.String) -> Swift.Bool
|
|
32
|
-
@objc override dynamic public init()
|
|
33
|
-
@objc deinit
|
|
34
|
-
}
|
|
35
18
|
public enum SVLogLevel : Swift.Int, Swift.Codable {
|
|
36
19
|
case off, error, warn, info, debug, trace
|
|
37
20
|
public init?(rawValue: Swift.Int)
|
|
@@ -134,6 +117,44 @@ public enum SpeakerVerificationError : Swift.Error, Swift.CustomStringConvertibl
|
|
|
134
117
|
@objc override dynamic public init()
|
|
135
118
|
@objc deinit
|
|
136
119
|
}
|
|
120
|
+
@objc @_inheritsConvenienceInitializers @_hasMissingDesignatedInitializers final public class SwiftSoundQueue : ObjectiveC.NSObject, AVFAudio.AVAudioPlayerDelegate {
|
|
121
|
+
@objc deinit
|
|
122
|
+
public static let shared: DavoiceTTS.SwiftSoundQueue
|
|
123
|
+
final public func notifyWhenURLFinishes(_ url: Foundation.URL, _ cb: @escaping () -> Swift.Void)
|
|
124
|
+
final public var onItemDone: ((Foundation.URL) -> Swift.Void)?
|
|
125
|
+
final public var onQueueEmpty: (() -> Swift.Void)?
|
|
126
|
+
final public func enqueue(_ source: DavoiceTTS.SwiftSoundQueue.Source)
|
|
127
|
+
final public func enqueueMany(_ sources: [DavoiceTTS.SwiftSoundQueue.Source])
|
|
128
|
+
final public func stop()
|
|
129
|
+
public enum Source {
|
|
130
|
+
case fileURL(Foundation.URL)
|
|
131
|
+
case named(Swift.String)
|
|
132
|
+
}
|
|
133
|
+
@objc final public func audioPlayerDidFinishPlaying(_ p: AVFAudio.AVAudioPlayer, successfully ok: Swift.Bool)
|
|
134
|
+
final public func activatePlaybackOnlySession()
|
|
135
|
+
final public func activateSpeaker()
|
|
136
|
+
}
|
|
137
|
+
@objc @objcMembers final public class DaVoiceTTS : ObjectiveC.NSObject {
|
|
138
|
+
public struct Config {
|
|
139
|
+
}
|
|
140
|
+
@objc final public var onLastUtteranceFinished: (() -> Swift.Void)?
|
|
141
|
+
@objc deinit
|
|
142
|
+
@objc public static func activateLicense(licenseKey: Swift.String) -> Swift.Bool
|
|
143
|
+
@objc final public func setLicense(licenseKey: Swift.String) -> Swift.Bool
|
|
144
|
+
public struct Biquad {
|
|
145
|
+
public var b0: Swift.Float, b1: Swift.Float, b2: Swift.Float, a1: Swift.Float, a2: Swift.Float
|
|
146
|
+
public init(b0: Swift.Float, b1: Swift.Float, b2: Swift.Float, a1: Swift.Float, a2: Swift.Float)
|
|
147
|
+
public mutating func process(_ x: Swift.UnsafeMutablePointer<Swift.Float>, _ n: Swift.Int)
|
|
148
|
+
}
|
|
149
|
+
@objc public init(model: Foundation.URL) throws
|
|
150
|
+
@objc final public func stopSpeaking()
|
|
151
|
+
@objc final public func destroy()
|
|
152
|
+
@objc(speak:sid:) final public func speak(_ txt: Swift.String, sid: Swift.Int32 = 0)
|
|
153
|
+
@objc(speak:sid:speed:) final public func speak(_ txt: Swift.String, sid: Swift.Int32 = 0, speed: Swift.Float)
|
|
154
|
+
@objc final public func synthesize_top(_ _text: Swift.String, speakerId: Swift.Int32 = 0, token: Foundation.UUID, speed_adjuster: Swift.Float) throws -> AVFAudio.AVAudioPCMBuffer
|
|
155
|
+
@objc final public func playWav(_ url: Foundation.URL, markAsLastUtterance: Swift.Bool = true)
|
|
156
|
+
@objc final public func playBuffer(_ buffer: AVFAudio.AVAudioPCMBuffer, markAsLastUtterance: Swift.Bool = true)
|
|
157
|
+
}
|
|
137
158
|
@objc public protocol STTDelegate {
|
|
138
159
|
@objc func stt(_ stt: DavoiceTTS.STT, didEmitEvent name: Swift.String, body: [Swift.String : Any]?)
|
|
139
160
|
}
|
|
@@ -173,43 +194,22 @@ public enum SpeakerVerificationError : Swift.Error, Swift.CustomStringConvertibl
|
|
|
173
194
|
@objc override dynamic public init()
|
|
174
195
|
@objc deinit
|
|
175
196
|
}
|
|
176
|
-
@
|
|
197
|
+
@_inheritsConvenienceInitializers @objc final public class LicenseManager : ObjectiveC.NSObject {
|
|
198
|
+
@objc public static func isLicenseValid(licenseKey: Swift.String) -> Swift.Bool
|
|
199
|
+
@objc override dynamic public init()
|
|
177
200
|
@objc deinit
|
|
178
|
-
public static let shared: DavoiceTTS.SwiftSoundQueue
|
|
179
|
-
final public func notifyWhenURLFinishes(_ url: Foundation.URL, _ cb: @escaping () -> Swift.Void)
|
|
180
|
-
final public var onItemDone: ((Foundation.URL) -> Swift.Void)?
|
|
181
|
-
final public var onQueueEmpty: (() -> Swift.Void)?
|
|
182
|
-
final public func enqueue(_ source: DavoiceTTS.SwiftSoundQueue.Source)
|
|
183
|
-
final public func enqueueMany(_ sources: [DavoiceTTS.SwiftSoundQueue.Source])
|
|
184
|
-
final public func stop()
|
|
185
|
-
public enum Source {
|
|
186
|
-
case fileURL(Foundation.URL)
|
|
187
|
-
case named(Swift.String)
|
|
188
|
-
}
|
|
189
|
-
@objc final public func audioPlayerDidFinishPlaying(_ p: AVFAudio.AVAudioPlayer, successfully ok: Swift.Bool)
|
|
190
|
-
final public func activatePlaybackOnlySession()
|
|
191
|
-
final public func activateSpeaker()
|
|
192
201
|
}
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
public
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
}
|
|
205
|
-
@objc public init(model: Foundation.URL) throws
|
|
206
|
-
@objc final public func stopSpeaking()
|
|
207
|
-
@objc final public func destroy()
|
|
208
|
-
@objc(speak:sid:) final public func speak(_ txt: Swift.String, sid: Swift.Int32 = 0)
|
|
209
|
-
@objc(speak:sid:speed:) final public func speak(_ txt: Swift.String, sid: Swift.Int32 = 0, speed: Swift.Float)
|
|
210
|
-
@objc final public func synthesize_top(_ _text: Swift.String, speakerId: Swift.Int32 = 0, token: Foundation.UUID, speed_adjuster: Swift.Float) throws -> AVFAudio.AVAudioPCMBuffer
|
|
211
|
-
@objc final public func playWav(_ url: Foundation.URL, markAsLastUtterance: Swift.Bool = true)
|
|
212
|
-
@objc final public func playBuffer(_ buffer: AVFAudio.AVAudioPCMBuffer, markAsLastUtterance: Swift.Bool = true)
|
|
202
|
+
public typealias EngineSchedule = (_ url: Foundation.URL, _ onDone: @escaping () -> Swift.Void) -> Swift.Bool
|
|
203
|
+
public typealias IsEngineReady = () -> Swift.Bool
|
|
204
|
+
public typealias useOnlyEnginePlayback = () -> Swift.Bool
|
|
205
|
+
public typealias StopEnginePlayback = () -> Swift.Void
|
|
206
|
+
public typealias CurrentEngineProvider = () -> AVFAudio.AVAudioEngine?
|
|
207
|
+
public enum AudioPlaybackHook {
|
|
208
|
+
public static var engineScheduleFile: DavoiceTTS.EngineSchedule?
|
|
209
|
+
public static var isEngineReady: DavoiceTTS.IsEngineReady?
|
|
210
|
+
public static var useOnlyEnginePlayback: DavoiceTTS.useOnlyEnginePlayback?
|
|
211
|
+
public static var stopEnginePlayback: DavoiceTTS.StopEnginePlayback?
|
|
212
|
+
public static var currentEngine: DavoiceTTS.CurrentEngineProvider?
|
|
213
213
|
}
|
|
214
214
|
extension DavoiceTTS.SVLogLevel : Swift.Equatable {}
|
|
215
215
|
extension DavoiceTTS.SVLogLevel : Swift.Hashable {}
|
|
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
|
+
XazQRW+sRlakOQm+ZkmgxCELI3A=
|
|
18
18
|
</data>
|
|
19
19
|
<key>Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface</key>
|
|
20
20
|
<data>
|
|
21
|
-
|
|
21
|
+
yuxQtvPVHlWEIZ4YBCuHNEji7G0=
|
|
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
|
+
yuxQtvPVHlWEIZ4YBCuHNEji7G0=
|
|
30
30
|
</data>
|
|
31
31
|
<key>Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.swiftmodule</key>
|
|
32
32
|
<data>
|
|
33
|
-
|
|
33
|
+
ZVHNSHjaKTRLmdl5hy6vMDqCFoE=
|
|
34
34
|
</data>
|
|
35
35
|
<key>Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.abi.json</key>
|
|
36
36
|
<data>
|
|
37
|
-
|
|
37
|
+
XazQRW+sRlakOQm+ZkmgxCELI3A=
|
|
38
38
|
</data>
|
|
39
39
|
<key>Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface</key>
|
|
40
40
|
<data>
|
|
41
|
-
|
|
41
|
+
ANI+8vNjeuF1duN64GMda3kBxiQ=
|
|
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
|
+
ANI+8vNjeuF1duN64GMda3kBxiQ=
|
|
50
50
|
</data>
|
|
51
51
|
<key>Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.swiftmodule</key>
|
|
52
52
|
<data>
|
|
53
|
-
|
|
53
|
+
xzJ9RDb5PQNBc3B6cG2mloKiyqI=
|
|
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
|
+
XazQRW+sRlakOQm+ZkmgxCELI3A=
|
|
78
78
|
</data>
|
|
79
79
|
<key>hash2</key>
|
|
80
80
|
<data>
|
|
81
|
-
|
|
81
|
+
5R8C/YiV6GCgwRclk21yJC698+/qQrjzAK4EtwCEqkI=
|
|
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
|
+
yuxQtvPVHlWEIZ4YBCuHNEji7G0=
|
|
89
89
|
</data>
|
|
90
90
|
<key>hash2</key>
|
|
91
91
|
<data>
|
|
92
|
-
|
|
92
|
+
mB/DirwzRQ1U/FVeCVITbYm/SZfmW076uH9A9Nm0iI0=
|
|
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
|
+
yuxQtvPVHlWEIZ4YBCuHNEji7G0=
|
|
111
111
|
</data>
|
|
112
112
|
<key>hash2</key>
|
|
113
113
|
<data>
|
|
114
|
-
|
|
114
|
+
mB/DirwzRQ1U/FVeCVITbYm/SZfmW076uH9A9Nm0iI0=
|
|
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
|
+
ZVHNSHjaKTRLmdl5hy6vMDqCFoE=
|
|
122
122
|
</data>
|
|
123
123
|
<key>hash2</key>
|
|
124
124
|
<data>
|
|
125
|
-
|
|
125
|
+
L2ENsbjrpVpjUfD10cmKITlEM1Sb3+VBZhEr6HDy2kM=
|
|
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
|
+
XazQRW+sRlakOQm+ZkmgxCELI3A=
|
|
133
133
|
</data>
|
|
134
134
|
<key>hash2</key>
|
|
135
135
|
<data>
|
|
136
|
-
|
|
136
|
+
5R8C/YiV6GCgwRclk21yJC698+/qQrjzAK4EtwCEqkI=
|
|
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
|
+
ANI+8vNjeuF1duN64GMda3kBxiQ=
|
|
144
144
|
</data>
|
|
145
145
|
<key>hash2</key>
|
|
146
146
|
<data>
|
|
147
|
-
|
|
147
|
+
nFWAKEe39Kye8DAcxIY6Fz1Gk7d/K40dNLOxY1M83IQ=
|
|
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
|
+
ANI+8vNjeuF1duN64GMda3kBxiQ=
|
|
166
166
|
</data>
|
|
167
167
|
<key>hash2</key>
|
|
168
168
|
<data>
|
|
169
|
-
|
|
169
|
+
nFWAKEe39Kye8DAcxIY6Fz1Gk7d/K40dNLOxY1M83IQ=
|
|
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
|
+
xzJ9RDb5PQNBc3B6cG2mloKiyqI=
|
|
177
177
|
</data>
|
|
178
178
|
<key>hash2</key>
|
|
179
179
|
<data>
|
|
180
|
-
|
|
180
|
+
MZmq3tYR6fQtt+6TgXgI1S3BThahGBR6QH0J/RnjS1Y=
|
|
181
181
|
</data>
|
|
182
182
|
</dict>
|
|
183
183
|
<key>Modules/module.modulemap</key>
|
package/package.json
CHANGED
package/speech/index.ts
CHANGED
|
@@ -190,6 +190,8 @@ class Speech {
|
|
|
190
190
|
// top of file (new state)
|
|
191
191
|
private lastLocale: string | null = null;
|
|
192
192
|
private lastModel: string | null = null;
|
|
193
|
+
private lastOnboardingJsonPath: string | null = null;
|
|
194
|
+
private hasCompletedFullInit = false;
|
|
193
195
|
private iosTtsOnly = false; // when true, use NativeTTS directly on iOS
|
|
194
196
|
|
|
195
197
|
|
|
@@ -392,11 +394,13 @@ class Speech {
|
|
|
392
394
|
|
|
393
395
|
this.lastLocale = opts.locale;
|
|
394
396
|
this.lastModel = modelPath;
|
|
397
|
+
this.lastOnboardingJsonPath = opts.onboardingJsonPath ?? null;
|
|
395
398
|
|
|
396
399
|
if (Platform.OS === 'ios' && NativeSpeech?.initAll) {
|
|
397
400
|
this.iosTtsOnly = false; // full unified mode
|
|
398
401
|
this.teardownListeners(); // re-wire listeners for unified
|
|
399
402
|
const r = await NativeSpeech.initAll({ ...opts, model: modelPath });
|
|
403
|
+
this.hasCompletedFullInit = true;
|
|
400
404
|
this.ensureListeners();
|
|
401
405
|
return r;
|
|
402
406
|
}
|
|
@@ -446,6 +450,7 @@ class Speech {
|
|
|
446
450
|
const modelExt = this.resolveModelExt(opts.model);
|
|
447
451
|
console.log('[MODELDBG] initAll.modelExt (resolved)=', modelExt);
|
|
448
452
|
await NativeTTS.initTTS({ model: modelPath, modelExt });
|
|
453
|
+
this.hasCompletedFullInit = true;
|
|
449
454
|
}
|
|
450
455
|
|
|
451
456
|
async destroyAll() {
|
|
@@ -456,6 +461,7 @@ class Speech {
|
|
|
456
461
|
// iOS unified
|
|
457
462
|
if (Platform.OS === 'ios' && NativeSpeech?.destroyAll) {
|
|
458
463
|
const r = await NativeSpeech.destroyAll();
|
|
464
|
+
this.hasCompletedFullInit = false;
|
|
459
465
|
this.iosTtsOnly = false;
|
|
460
466
|
this.lastLocale = this.lastLocale ?? null;
|
|
461
467
|
this.teardownListeners();
|
|
@@ -469,10 +475,97 @@ class Speech {
|
|
|
469
475
|
NativeSTT.destroySpeech(() => res());
|
|
470
476
|
});
|
|
471
477
|
} catch {}
|
|
478
|
+
this.hasCompletedFullInit = false;
|
|
472
479
|
this.teardownListeners();
|
|
473
480
|
return 'Destroyed';
|
|
474
481
|
}
|
|
475
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
|
+
|
|
476
569
|
// ---------- STT ----------
|
|
477
570
|
async start(locale: string, options: Record<string, any> = {}) {
|
|
478
571
|
this.ensureListeners();
|