react-native-davoice 1.0.4
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/README.md +319 -0
- package/TTSRNBridge.podspec +38 -0
- package/android/.gradle/8.9/checksums/checksums.lock +0 -0
- package/android/.gradle/8.9/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/8.9/fileChanges/last-build.bin +0 -0
- package/android/.gradle/8.9/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/8.9/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +2 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/build.gradle +47 -0
- 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 -0
- package/android/libs/com/davoice/tts/1.0.0/tts-1.0.0.aar.sha1 +1 -0
- package/android/libs/com/davoice/tts/1.0.0/tts-1.0.0.pom +38 -0
- package/android/libs/com/davoice/tts/1.0.0/tts-1.0.0.pom.md5 +1 -0
- package/android/libs/com/davoice/tts/1.0.0/tts-1.0.0.pom.sha1 +1 -0
- package/android/settings.gradle +2 -0
- package/android/src/main/AndroidManifest.xml +14 -0
- package/android/src/main/java/com/davoice/rn/DaVoicePackage.java +29 -0
- package/android/src/main/java/com/davoice/stt/rn/STTModule.kt +208 -0
- package/android/src/main/java/com/davoice/tts/rn/DaVoiceTTSBridge.java +733 -0
- package/android/src/main/libs/MyLibrary-release.aar +0 -0
- package/app.plugin.js +60 -0
- package/ios/STTRNBridge/STTBridge.h +7 -0
- package/ios/STTRNBridge/STTBridge.m +130 -0
- package/ios/SpeechBridge/SpeechBridge.h +7 -0
- package/ios/SpeechBridge/SpeechBridge.m +761 -0
- package/ios/TTSRNBridge/DaVoiceTTSBridge.h +7 -0
- package/ios/TTSRNBridge/DaVoiceTTSBridge.m +177 -0
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/Info.plist +44 -0
- 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 +424 -0
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64/DavoiceTTS.framework/Info.plist +0 -0
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios.abi.json +13253 -0
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios.private.swiftinterface +213 -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 +213 -0
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64/DavoiceTTS.framework/Modules/module.modulemap +4 -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 +844 -0
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Info.plist +0 -0
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.abi.json +13253 -0
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +213 -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 +213 -0
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.abi.json +13253 -0
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +213 -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 +213 -0
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/module.modulemap +4 -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 +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 +282 -0
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/_CodeSignature/CodeSignature +0 -0
- package/ios/TTSRNBridge/libphonemes.a +0 -0
- package/ios/TTSRNBridge/libucd.a +0 -0
- package/package.json +46 -0
- package/react-native.config.js +10 -0
- package/speech/index.ts +1055 -0
- package/stt/index.d.ts +54 -0
- package/stt/index.ts +222 -0
- package/tts/DaVoiceTTSBridge.d.ts +18 -0
- package/tts/DaVoiceTTSBridge.js +71 -0
- package/tts/index.d.ts +3 -0
- package/tts/index.js +4 -0
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
// swift-interface-format-version: 1.0
|
|
2
|
+
// swift-compiler-version: Apple Swift version 6.1.2 effective-5.10 (swiftlang-6.1.2.1.2 clang-1700.0.13.5)
|
|
3
|
+
// swift-module-flags: -target arm64-apple-ios13.5-simulator -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -enable-experimental-feature DebugDescriptionMacro -enable-bare-slash-regex -module-name DavoiceTTS
|
|
4
|
+
// swift-module-flags-ignorable: -no-verify-emitted-module-interface -interface-compiler-version 6.1.2
|
|
5
|
+
import AVFAudio
|
|
6
|
+
import AVFoundation
|
|
7
|
+
import Accelerate
|
|
8
|
+
import CommonCrypto
|
|
9
|
+
import Foundation
|
|
10
|
+
import Speech
|
|
11
|
+
import Swift
|
|
12
|
+
import UIKit
|
|
13
|
+
import _Concurrency
|
|
14
|
+
import _StringProcessing
|
|
15
|
+
import _SwiftConcurrencyShims
|
|
16
|
+
import onnxruntime_objc
|
|
17
|
+
import phonemes
|
|
18
|
+
@objc public protocol STTDelegate {
|
|
19
|
+
@objc func stt(_ stt: DavoiceTTS.STT, didEmitEvent name: Swift.String, body: [Swift.String : Any]?)
|
|
20
|
+
}
|
|
21
|
+
@objc @_inheritsConvenienceInitializers @objcMembers final public class STT : ObjectiveC.NSObject, Speech.SFSpeechRecognizerDelegate {
|
|
22
|
+
@objc weak final public var delegate: (any DavoiceTTS.STTDelegate)?
|
|
23
|
+
@objc final public var continuous: Swift.Bool
|
|
24
|
+
@objc final public var aecEnabled: Swift.Bool
|
|
25
|
+
@objc final public var force16kMicSampleRate: Swift.Bool
|
|
26
|
+
@objc final public var useLegacySpeakerGateBehavior: Swift.Bool
|
|
27
|
+
@objc final public var useSpeakerGateHangover: Swift.Bool
|
|
28
|
+
@objc final public var speakerGateHangoverSeconds: Swift.Double
|
|
29
|
+
@objc final public var useShortSpeakerVerificationTailWindow: Swift.Bool
|
|
30
|
+
@objc final public var shortSpeakerVerificationTailSeconds: Swift.Float
|
|
31
|
+
@objc final public var speakerPreRollFlushMaxSeconds: Swift.Double
|
|
32
|
+
@objc public static let supportedEvents: [Swift.String]
|
|
33
|
+
@objc final public func setLicense(licenseKey: Swift.String) -> Swift.Bool
|
|
34
|
+
@objc final public func pauseSpeechRecognitionLite()
|
|
35
|
+
@objc final public func unPauseSpeechRecognitionLite(_ times: Foundation.NSNumber)
|
|
36
|
+
@objc final public func pauseMicrophoneAndWait(_ timeoutMs: Foundation.NSNumber, completion: @escaping (Swift.Bool, Swift.String?) -> Swift.Void)
|
|
37
|
+
@objc final public func unPauseMicrophoneAndWait(_ timeoutMs: Foundation.NSNumber, completion: @escaping (Swift.Bool, Swift.String?) -> Swift.Void)
|
|
38
|
+
@objc final public func pauseMicrophone()
|
|
39
|
+
@objc final public func unPauseMicrophone()
|
|
40
|
+
@objc final public func setAECEnabled(_ enabled: Swift.Bool)
|
|
41
|
+
@objc final public func isAECEnabled() -> Swift.Bool
|
|
42
|
+
@objc final public func isSpeechAvailable(_ completion: @escaping (Swift.Bool) -> Swift.Void)
|
|
43
|
+
@objc final public func isRecognizing() -> Swift.Bool
|
|
44
|
+
@objc final public func startSpeech(localeStr: Swift.String?)
|
|
45
|
+
@objc final public func startSpeech(localeStr: Swift.String?, onboardingJsonPath: Swift.String)
|
|
46
|
+
@objc final public func stopSpeech(_ completion: ((Swift.Bool) -> Swift.Void)? = nil)
|
|
47
|
+
@objc final public func cancelSpeech(_ completion: ((Swift.Bool) -> Swift.Void)? = nil)
|
|
48
|
+
@objc final public func destroySpeech(_ completion: ((Swift.Bool) -> Swift.Void)? = nil)
|
|
49
|
+
@objc final public func teardown()
|
|
50
|
+
@objc final public func speechRecognizer(_ speechRecognizer: Speech.SFSpeechRecognizer, availabilityDidChange available: Swift.Bool)
|
|
51
|
+
@objc override dynamic public init()
|
|
52
|
+
@objc deinit
|
|
53
|
+
}
|
|
54
|
+
@objc @_inheritsConvenienceInitializers @_hasMissingDesignatedInitializers final public class SwiftSoundQueue : ObjectiveC.NSObject, AVFAudio.AVAudioPlayerDelegate {
|
|
55
|
+
@objc deinit
|
|
56
|
+
public static let shared: DavoiceTTS.SwiftSoundQueue
|
|
57
|
+
final public func notifyWhenURLFinishes(_ url: Foundation.URL, _ cb: @escaping () -> Swift.Void)
|
|
58
|
+
final public var onItemDone: ((Foundation.URL) -> Swift.Void)?
|
|
59
|
+
final public var onQueueEmpty: (() -> Swift.Void)?
|
|
60
|
+
final public func enqueue(_ source: DavoiceTTS.SwiftSoundQueue.Source)
|
|
61
|
+
final public func enqueueMany(_ sources: [DavoiceTTS.SwiftSoundQueue.Source])
|
|
62
|
+
final public func stop()
|
|
63
|
+
public enum Source {
|
|
64
|
+
case fileURL(Foundation.URL)
|
|
65
|
+
case named(Swift.String)
|
|
66
|
+
}
|
|
67
|
+
@objc final public func audioPlayerDidFinishPlaying(_ p: AVFAudio.AVAudioPlayer, successfully ok: Swift.Bool)
|
|
68
|
+
final public func activatePlaybackOnlySession()
|
|
69
|
+
final public func activateSpeaker()
|
|
70
|
+
}
|
|
71
|
+
@objc @objcMembers final public class DaVoiceTTS : ObjectiveC.NSObject {
|
|
72
|
+
public struct Config {
|
|
73
|
+
}
|
|
74
|
+
@objc final public var onLastUtteranceFinished: (() -> Swift.Void)?
|
|
75
|
+
@objc deinit
|
|
76
|
+
@objc public static func activateLicense(licenseKey: Swift.String) -> Swift.Bool
|
|
77
|
+
@objc final public func setLicense(licenseKey: Swift.String) -> Swift.Bool
|
|
78
|
+
public struct Biquad {
|
|
79
|
+
public var b0: Swift.Float, b1: Swift.Float, b2: Swift.Float, a1: Swift.Float, a2: Swift.Float
|
|
80
|
+
public init(b0: Swift.Float, b1: Swift.Float, b2: Swift.Float, a1: Swift.Float, a2: Swift.Float)
|
|
81
|
+
public mutating func process(_ x: Swift.UnsafeMutablePointer<Swift.Float>, _ n: Swift.Int)
|
|
82
|
+
}
|
|
83
|
+
@objc public init(model: Foundation.URL) throws
|
|
84
|
+
@objc final public func stopSpeaking()
|
|
85
|
+
@objc final public func destroy()
|
|
86
|
+
@objc(speak:sid:) final public func speak(_ txt: Swift.String, sid: Swift.Int32 = 0)
|
|
87
|
+
@objc(speak:sid:speed:) final public func speak(_ txt: Swift.String, sid: Swift.Int32 = 0, speed: Swift.Float)
|
|
88
|
+
@objc final public func synthesize_top(_ _text: Swift.String, speakerId: Swift.Int32 = 0, token: Foundation.UUID, speed_adjuster: Swift.Float) throws -> AVFAudio.AVAudioPCMBuffer
|
|
89
|
+
@objc final public func playWav(_ url: Foundation.URL, markAsLastUtterance: Swift.Bool = true)
|
|
90
|
+
@objc final public func playBuffer(_ buffer: AVFAudio.AVAudioPCMBuffer, markAsLastUtterance: Swift.Bool = true)
|
|
91
|
+
}
|
|
92
|
+
public typealias EngineSchedule = (_ url: Foundation.URL, _ onDone: @escaping () -> Swift.Void) -> Swift.Bool
|
|
93
|
+
public typealias IsEngineReady = () -> Swift.Bool
|
|
94
|
+
public typealias useOnlyEnginePlayback = () -> Swift.Bool
|
|
95
|
+
public typealias StopEnginePlayback = () -> Swift.Void
|
|
96
|
+
public typealias CurrentEngineProvider = () -> AVFAudio.AVAudioEngine?
|
|
97
|
+
public enum AudioPlaybackHook {
|
|
98
|
+
public static var engineScheduleFile: DavoiceTTS.EngineSchedule?
|
|
99
|
+
public static var isEngineReady: DavoiceTTS.IsEngineReady?
|
|
100
|
+
public static var useOnlyEnginePlayback: DavoiceTTS.useOnlyEnginePlayback?
|
|
101
|
+
public static var stopEnginePlayback: DavoiceTTS.StopEnginePlayback?
|
|
102
|
+
public static var currentEngine: DavoiceTTS.CurrentEngineProvider?
|
|
103
|
+
}
|
|
104
|
+
@_inheritsConvenienceInitializers @objc final public class LicenseManager : ObjectiveC.NSObject {
|
|
105
|
+
@objc public static func isLicenseValid(licenseKey: Swift.String) -> Swift.Bool
|
|
106
|
+
@objc override dynamic public init()
|
|
107
|
+
@objc deinit
|
|
108
|
+
}
|
|
109
|
+
public enum SVLogLevel : Swift.Int, Swift.Codable {
|
|
110
|
+
case off, error, warn, info, debug, trace
|
|
111
|
+
public init?(rawValue: Swift.Int)
|
|
112
|
+
public typealias RawValue = Swift.Int
|
|
113
|
+
public var rawValue: Swift.Int {
|
|
114
|
+
get
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
public protocol SVLogger {
|
|
118
|
+
func log(_ level: DavoiceTTS.SVLogLevel, _ tag: Swift.String, _ msg: Swift.String)
|
|
119
|
+
}
|
|
120
|
+
final public class SVDefaultLogger : DavoiceTTS.SVLogger {
|
|
121
|
+
final public var level: DavoiceTTS.SVLogLevel
|
|
122
|
+
public init(level: DavoiceTTS.SVLogLevel = .trace)
|
|
123
|
+
final public func log(_ level: DavoiceTTS.SVLogLevel, _ tag: Swift.String, _ msg: Swift.String)
|
|
124
|
+
@objc deinit
|
|
125
|
+
}
|
|
126
|
+
public struct SpeakerVerificationConfig : Swift.Codable {
|
|
127
|
+
public var modelPath: Swift.String
|
|
128
|
+
public var sampleRate: Swift.Int
|
|
129
|
+
public var numMelBins: Swift.Int
|
|
130
|
+
public var cmn: Swift.Bool
|
|
131
|
+
public var frameLengthMs: Swift.Float
|
|
132
|
+
public var frameShiftMs: Swift.Float
|
|
133
|
+
public var nFFT: Swift.Int
|
|
134
|
+
public var decisionThreshold: Swift.Float
|
|
135
|
+
public var expectedLayoutBDT: Swift.Bool
|
|
136
|
+
public var frameSize: Swift.Int
|
|
137
|
+
public var tailSeconds: Swift.Float
|
|
138
|
+
public var maxTailSeconds: Swift.Float
|
|
139
|
+
public var meanComboEnabled: Swift.Bool
|
|
140
|
+
public var meanComboMaxK: Swift.Int
|
|
141
|
+
public var meanComboMaxTotal: Swift.Int
|
|
142
|
+
public var logLevel: DavoiceTTS.SVLogLevel
|
|
143
|
+
public init(from decoder: any Swift.Decoder) throws
|
|
144
|
+
public func encode(to encoder: any Swift.Encoder) throws
|
|
145
|
+
public init(modelPath: Swift.String, sampleRate: Swift.Int = 16_000, numMelBins: Swift.Int = 80, cmn: Swift.Bool = true, frameLengthMs: Swift.Float = 25.0, frameShiftMs: Swift.Float = 10.0, nFFT: Swift.Int = 512, decisionThreshold: Swift.Float = 0.35, expectedLayoutBDT: Swift.Bool = false, frameSize: Swift.Int = 1280, tailSeconds: Swift.Float = 2.0, maxTailSeconds: Swift.Float = 3.0, meanComboEnabled: Swift.Bool = true, meanComboMaxK: Swift.Int = 3, meanComboMaxTotal: Swift.Int = 2000, logLevel: DavoiceTTS.SVLogLevel = .debug)
|
|
146
|
+
}
|
|
147
|
+
public struct SpeakerEnrollment : Swift.Codable {
|
|
148
|
+
public let enrollmentId: Swift.String
|
|
149
|
+
public let createdAtEpochMs: Swift.Int64
|
|
150
|
+
public let configSnapshot: DavoiceTTS.SpeakerVerificationConfig
|
|
151
|
+
public let enrolledEmbeddings: [[Swift.Float]]
|
|
152
|
+
public let meanEmbedding: [Swift.Float]
|
|
153
|
+
public let meanComboEmbeddings: [[Swift.Float]]
|
|
154
|
+
public let meanComboLabels: [Swift.String]
|
|
155
|
+
public init(enrollmentId: Swift.String, createdAtEpochMs: Swift.Int64, configSnapshot: DavoiceTTS.SpeakerVerificationConfig, enrolledEmbeddings: [[Swift.Float]], meanEmbedding: [Swift.Float], meanComboEmbeddings: [[Swift.Float]] = [], meanComboLabels: [Swift.String] = [])
|
|
156
|
+
public init(from decoder: any Swift.Decoder) throws
|
|
157
|
+
public func serialize() throws -> Foundation.Data
|
|
158
|
+
public static func deserialize(_ data: Foundation.Data) throws -> DavoiceTTS.SpeakerEnrollment
|
|
159
|
+
public func encode(to encoder: any Swift.Encoder) throws
|
|
160
|
+
}
|
|
161
|
+
public struct SVPendingInfo {
|
|
162
|
+
public let bufferedSamples: Swift.Int
|
|
163
|
+
public let bufferedSeconds: Swift.Float
|
|
164
|
+
public let neededSeconds: Swift.Float
|
|
165
|
+
}
|
|
166
|
+
public struct SpeakerVerificationResult {
|
|
167
|
+
public let scoreBest: Swift.Float
|
|
168
|
+
public let scoreMean: Swift.Float
|
|
169
|
+
public let scoreWorst: Swift.Float
|
|
170
|
+
public let scoreBestRaw: Swift.Float
|
|
171
|
+
public let scoreBestMeancombo: Swift.Float
|
|
172
|
+
public let bestKind: Swift.String
|
|
173
|
+
public let bestId: Swift.String
|
|
174
|
+
public let isMatch: Swift.Bool
|
|
175
|
+
public let embeddingDim: Swift.Int
|
|
176
|
+
public let usedSeconds: Swift.Float
|
|
177
|
+
public let ortRunMs: Swift.Double
|
|
178
|
+
public let featureMs: Swift.Double
|
|
179
|
+
public let totalMs: Swift.Double
|
|
180
|
+
}
|
|
181
|
+
public enum SpeakerVerificationOutput {
|
|
182
|
+
case pending(DavoiceTTS.SVPendingInfo)
|
|
183
|
+
case result(DavoiceTTS.SpeakerVerificationResult)
|
|
184
|
+
}
|
|
185
|
+
public enum SpeakerVerificationError : Swift.Error, Swift.CustomStringConvertible {
|
|
186
|
+
case invalidFrameSize(expected: Swift.Int, got: Swift.Int)
|
|
187
|
+
case enrollmentMissing
|
|
188
|
+
case emptyAudio
|
|
189
|
+
case onnx(Swift.String)
|
|
190
|
+
case feature(Swift.String)
|
|
191
|
+
public var description: Swift.String {
|
|
192
|
+
get
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
@objc @objcMembers final public class SpeakerVerificationEngine : ObjectiveC.NSObject {
|
|
196
|
+
final public let config: DavoiceTTS.SpeakerVerificationConfig
|
|
197
|
+
final public let logger: any DavoiceTTS.SVLogger
|
|
198
|
+
public init(config: DavoiceTTS.SpeakerVerificationConfig, logger: (any DavoiceTTS.SVLogger)? = nil) throws
|
|
199
|
+
final public func setEnrollment(_ enrollment: DavoiceTTS.SpeakerEnrollment?)
|
|
200
|
+
@objc final public func resetStreamingState()
|
|
201
|
+
final public func processFrame(frame: [Swift.Float]) throws -> DavoiceTTS.SpeakerVerificationOutput
|
|
202
|
+
final public func verifyWavFileStreaming(path: Swift.String, resetState: Swift.Bool = true) throws -> DavoiceTTS.SpeakerVerificationResult
|
|
203
|
+
@objc deinit
|
|
204
|
+
}
|
|
205
|
+
@_inheritsConvenienceInitializers @objc(DavoiceSpeakerVerificationRNFacade) final public class SpeakerVerificationRNFacade : ObjectiveC.NSObject {
|
|
206
|
+
@objc(createEngineWithModelPath:enrollmentJsonPath:options:error:) public static func createEngine(modelPath: Swift.String, enrollmentJsonPath: Swift.String, options: [Swift.String : Any], error outError: Foundation.NSErrorPointer) -> Any?
|
|
207
|
+
@objc(verifyWavWithEngine:wavPath:reset:error:) public static func verifyWav(engine: Any, wavPath: Swift.String, reset: Swift.Bool, error outError: Foundation.NSErrorPointer) -> [Swift.String : Any]?
|
|
208
|
+
@objc override dynamic public init()
|
|
209
|
+
@objc deinit
|
|
210
|
+
}
|
|
211
|
+
extension DavoiceTTS.SVLogLevel : Swift.Equatable {}
|
|
212
|
+
extension DavoiceTTS.SVLogLevel : Swift.Hashable {}
|
|
213
|
+
extension DavoiceTTS.SVLogLevel : Swift.RawRepresentable {}
|
|
Binary file
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
// swift-interface-format-version: 1.0
|
|
2
|
+
// swift-compiler-version: Apple Swift version 6.1.2 effective-5.10 (swiftlang-6.1.2.1.2 clang-1700.0.13.5)
|
|
3
|
+
// swift-module-flags: -target arm64-apple-ios13.5-simulator -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -enable-experimental-feature DebugDescriptionMacro -enable-bare-slash-regex -module-name DavoiceTTS
|
|
4
|
+
// swift-module-flags-ignorable: -no-verify-emitted-module-interface -interface-compiler-version 6.1.2
|
|
5
|
+
import AVFAudio
|
|
6
|
+
import AVFoundation
|
|
7
|
+
import Accelerate
|
|
8
|
+
import CommonCrypto
|
|
9
|
+
import Foundation
|
|
10
|
+
import Speech
|
|
11
|
+
import Swift
|
|
12
|
+
import UIKit
|
|
13
|
+
import _Concurrency
|
|
14
|
+
import _StringProcessing
|
|
15
|
+
import _SwiftConcurrencyShims
|
|
16
|
+
import onnxruntime_objc
|
|
17
|
+
import phonemes
|
|
18
|
+
@objc public protocol STTDelegate {
|
|
19
|
+
@objc func stt(_ stt: DavoiceTTS.STT, didEmitEvent name: Swift.String, body: [Swift.String : Any]?)
|
|
20
|
+
}
|
|
21
|
+
@objc @_inheritsConvenienceInitializers @objcMembers final public class STT : ObjectiveC.NSObject, Speech.SFSpeechRecognizerDelegate {
|
|
22
|
+
@objc weak final public var delegate: (any DavoiceTTS.STTDelegate)?
|
|
23
|
+
@objc final public var continuous: Swift.Bool
|
|
24
|
+
@objc final public var aecEnabled: Swift.Bool
|
|
25
|
+
@objc final public var force16kMicSampleRate: Swift.Bool
|
|
26
|
+
@objc final public var useLegacySpeakerGateBehavior: Swift.Bool
|
|
27
|
+
@objc final public var useSpeakerGateHangover: Swift.Bool
|
|
28
|
+
@objc final public var speakerGateHangoverSeconds: Swift.Double
|
|
29
|
+
@objc final public var useShortSpeakerVerificationTailWindow: Swift.Bool
|
|
30
|
+
@objc final public var shortSpeakerVerificationTailSeconds: Swift.Float
|
|
31
|
+
@objc final public var speakerPreRollFlushMaxSeconds: Swift.Double
|
|
32
|
+
@objc public static let supportedEvents: [Swift.String]
|
|
33
|
+
@objc final public func setLicense(licenseKey: Swift.String) -> Swift.Bool
|
|
34
|
+
@objc final public func pauseSpeechRecognitionLite()
|
|
35
|
+
@objc final public func unPauseSpeechRecognitionLite(_ times: Foundation.NSNumber)
|
|
36
|
+
@objc final public func pauseMicrophoneAndWait(_ timeoutMs: Foundation.NSNumber, completion: @escaping (Swift.Bool, Swift.String?) -> Swift.Void)
|
|
37
|
+
@objc final public func unPauseMicrophoneAndWait(_ timeoutMs: Foundation.NSNumber, completion: @escaping (Swift.Bool, Swift.String?) -> Swift.Void)
|
|
38
|
+
@objc final public func pauseMicrophone()
|
|
39
|
+
@objc final public func unPauseMicrophone()
|
|
40
|
+
@objc final public func setAECEnabled(_ enabled: Swift.Bool)
|
|
41
|
+
@objc final public func isAECEnabled() -> Swift.Bool
|
|
42
|
+
@objc final public func isSpeechAvailable(_ completion: @escaping (Swift.Bool) -> Swift.Void)
|
|
43
|
+
@objc final public func isRecognizing() -> Swift.Bool
|
|
44
|
+
@objc final public func startSpeech(localeStr: Swift.String?)
|
|
45
|
+
@objc final public func startSpeech(localeStr: Swift.String?, onboardingJsonPath: Swift.String)
|
|
46
|
+
@objc final public func stopSpeech(_ completion: ((Swift.Bool) -> Swift.Void)? = nil)
|
|
47
|
+
@objc final public func cancelSpeech(_ completion: ((Swift.Bool) -> Swift.Void)? = nil)
|
|
48
|
+
@objc final public func destroySpeech(_ completion: ((Swift.Bool) -> Swift.Void)? = nil)
|
|
49
|
+
@objc final public func teardown()
|
|
50
|
+
@objc final public func speechRecognizer(_ speechRecognizer: Speech.SFSpeechRecognizer, availabilityDidChange available: Swift.Bool)
|
|
51
|
+
@objc override dynamic public init()
|
|
52
|
+
@objc deinit
|
|
53
|
+
}
|
|
54
|
+
@objc @_inheritsConvenienceInitializers @_hasMissingDesignatedInitializers final public class SwiftSoundQueue : ObjectiveC.NSObject, AVFAudio.AVAudioPlayerDelegate {
|
|
55
|
+
@objc deinit
|
|
56
|
+
public static let shared: DavoiceTTS.SwiftSoundQueue
|
|
57
|
+
final public func notifyWhenURLFinishes(_ url: Foundation.URL, _ cb: @escaping () -> Swift.Void)
|
|
58
|
+
final public var onItemDone: ((Foundation.URL) -> Swift.Void)?
|
|
59
|
+
final public var onQueueEmpty: (() -> Swift.Void)?
|
|
60
|
+
final public func enqueue(_ source: DavoiceTTS.SwiftSoundQueue.Source)
|
|
61
|
+
final public func enqueueMany(_ sources: [DavoiceTTS.SwiftSoundQueue.Source])
|
|
62
|
+
final public func stop()
|
|
63
|
+
public enum Source {
|
|
64
|
+
case fileURL(Foundation.URL)
|
|
65
|
+
case named(Swift.String)
|
|
66
|
+
}
|
|
67
|
+
@objc final public func audioPlayerDidFinishPlaying(_ p: AVFAudio.AVAudioPlayer, successfully ok: Swift.Bool)
|
|
68
|
+
final public func activatePlaybackOnlySession()
|
|
69
|
+
final public func activateSpeaker()
|
|
70
|
+
}
|
|
71
|
+
@objc @objcMembers final public class DaVoiceTTS : ObjectiveC.NSObject {
|
|
72
|
+
public struct Config {
|
|
73
|
+
}
|
|
74
|
+
@objc final public var onLastUtteranceFinished: (() -> Swift.Void)?
|
|
75
|
+
@objc deinit
|
|
76
|
+
@objc public static func activateLicense(licenseKey: Swift.String) -> Swift.Bool
|
|
77
|
+
@objc final public func setLicense(licenseKey: Swift.String) -> Swift.Bool
|
|
78
|
+
public struct Biquad {
|
|
79
|
+
public var b0: Swift.Float, b1: Swift.Float, b2: Swift.Float, a1: Swift.Float, a2: Swift.Float
|
|
80
|
+
public init(b0: Swift.Float, b1: Swift.Float, b2: Swift.Float, a1: Swift.Float, a2: Swift.Float)
|
|
81
|
+
public mutating func process(_ x: Swift.UnsafeMutablePointer<Swift.Float>, _ n: Swift.Int)
|
|
82
|
+
}
|
|
83
|
+
@objc public init(model: Foundation.URL) throws
|
|
84
|
+
@objc final public func stopSpeaking()
|
|
85
|
+
@objc final public func destroy()
|
|
86
|
+
@objc(speak:sid:) final public func speak(_ txt: Swift.String, sid: Swift.Int32 = 0)
|
|
87
|
+
@objc(speak:sid:speed:) final public func speak(_ txt: Swift.String, sid: Swift.Int32 = 0, speed: Swift.Float)
|
|
88
|
+
@objc final public func synthesize_top(_ _text: Swift.String, speakerId: Swift.Int32 = 0, token: Foundation.UUID, speed_adjuster: Swift.Float) throws -> AVFAudio.AVAudioPCMBuffer
|
|
89
|
+
@objc final public func playWav(_ url: Foundation.URL, markAsLastUtterance: Swift.Bool = true)
|
|
90
|
+
@objc final public func playBuffer(_ buffer: AVFAudio.AVAudioPCMBuffer, markAsLastUtterance: Swift.Bool = true)
|
|
91
|
+
}
|
|
92
|
+
public typealias EngineSchedule = (_ url: Foundation.URL, _ onDone: @escaping () -> Swift.Void) -> Swift.Bool
|
|
93
|
+
public typealias IsEngineReady = () -> Swift.Bool
|
|
94
|
+
public typealias useOnlyEnginePlayback = () -> Swift.Bool
|
|
95
|
+
public typealias StopEnginePlayback = () -> Swift.Void
|
|
96
|
+
public typealias CurrentEngineProvider = () -> AVFAudio.AVAudioEngine?
|
|
97
|
+
public enum AudioPlaybackHook {
|
|
98
|
+
public static var engineScheduleFile: DavoiceTTS.EngineSchedule?
|
|
99
|
+
public static var isEngineReady: DavoiceTTS.IsEngineReady?
|
|
100
|
+
public static var useOnlyEnginePlayback: DavoiceTTS.useOnlyEnginePlayback?
|
|
101
|
+
public static var stopEnginePlayback: DavoiceTTS.StopEnginePlayback?
|
|
102
|
+
public static var currentEngine: DavoiceTTS.CurrentEngineProvider?
|
|
103
|
+
}
|
|
104
|
+
@_inheritsConvenienceInitializers @objc final public class LicenseManager : ObjectiveC.NSObject {
|
|
105
|
+
@objc public static func isLicenseValid(licenseKey: Swift.String) -> Swift.Bool
|
|
106
|
+
@objc override dynamic public init()
|
|
107
|
+
@objc deinit
|
|
108
|
+
}
|
|
109
|
+
public enum SVLogLevel : Swift.Int, Swift.Codable {
|
|
110
|
+
case off, error, warn, info, debug, trace
|
|
111
|
+
public init?(rawValue: Swift.Int)
|
|
112
|
+
public typealias RawValue = Swift.Int
|
|
113
|
+
public var rawValue: Swift.Int {
|
|
114
|
+
get
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
public protocol SVLogger {
|
|
118
|
+
func log(_ level: DavoiceTTS.SVLogLevel, _ tag: Swift.String, _ msg: Swift.String)
|
|
119
|
+
}
|
|
120
|
+
final public class SVDefaultLogger : DavoiceTTS.SVLogger {
|
|
121
|
+
final public var level: DavoiceTTS.SVLogLevel
|
|
122
|
+
public init(level: DavoiceTTS.SVLogLevel = .trace)
|
|
123
|
+
final public func log(_ level: DavoiceTTS.SVLogLevel, _ tag: Swift.String, _ msg: Swift.String)
|
|
124
|
+
@objc deinit
|
|
125
|
+
}
|
|
126
|
+
public struct SpeakerVerificationConfig : Swift.Codable {
|
|
127
|
+
public var modelPath: Swift.String
|
|
128
|
+
public var sampleRate: Swift.Int
|
|
129
|
+
public var numMelBins: Swift.Int
|
|
130
|
+
public var cmn: Swift.Bool
|
|
131
|
+
public var frameLengthMs: Swift.Float
|
|
132
|
+
public var frameShiftMs: Swift.Float
|
|
133
|
+
public var nFFT: Swift.Int
|
|
134
|
+
public var decisionThreshold: Swift.Float
|
|
135
|
+
public var expectedLayoutBDT: Swift.Bool
|
|
136
|
+
public var frameSize: Swift.Int
|
|
137
|
+
public var tailSeconds: Swift.Float
|
|
138
|
+
public var maxTailSeconds: Swift.Float
|
|
139
|
+
public var meanComboEnabled: Swift.Bool
|
|
140
|
+
public var meanComboMaxK: Swift.Int
|
|
141
|
+
public var meanComboMaxTotal: Swift.Int
|
|
142
|
+
public var logLevel: DavoiceTTS.SVLogLevel
|
|
143
|
+
public init(from decoder: any Swift.Decoder) throws
|
|
144
|
+
public func encode(to encoder: any Swift.Encoder) throws
|
|
145
|
+
public init(modelPath: Swift.String, sampleRate: Swift.Int = 16_000, numMelBins: Swift.Int = 80, cmn: Swift.Bool = true, frameLengthMs: Swift.Float = 25.0, frameShiftMs: Swift.Float = 10.0, nFFT: Swift.Int = 512, decisionThreshold: Swift.Float = 0.35, expectedLayoutBDT: Swift.Bool = false, frameSize: Swift.Int = 1280, tailSeconds: Swift.Float = 2.0, maxTailSeconds: Swift.Float = 3.0, meanComboEnabled: Swift.Bool = true, meanComboMaxK: Swift.Int = 3, meanComboMaxTotal: Swift.Int = 2000, logLevel: DavoiceTTS.SVLogLevel = .debug)
|
|
146
|
+
}
|
|
147
|
+
public struct SpeakerEnrollment : Swift.Codable {
|
|
148
|
+
public let enrollmentId: Swift.String
|
|
149
|
+
public let createdAtEpochMs: Swift.Int64
|
|
150
|
+
public let configSnapshot: DavoiceTTS.SpeakerVerificationConfig
|
|
151
|
+
public let enrolledEmbeddings: [[Swift.Float]]
|
|
152
|
+
public let meanEmbedding: [Swift.Float]
|
|
153
|
+
public let meanComboEmbeddings: [[Swift.Float]]
|
|
154
|
+
public let meanComboLabels: [Swift.String]
|
|
155
|
+
public init(enrollmentId: Swift.String, createdAtEpochMs: Swift.Int64, configSnapshot: DavoiceTTS.SpeakerVerificationConfig, enrolledEmbeddings: [[Swift.Float]], meanEmbedding: [Swift.Float], meanComboEmbeddings: [[Swift.Float]] = [], meanComboLabels: [Swift.String] = [])
|
|
156
|
+
public init(from decoder: any Swift.Decoder) throws
|
|
157
|
+
public func serialize() throws -> Foundation.Data
|
|
158
|
+
public static func deserialize(_ data: Foundation.Data) throws -> DavoiceTTS.SpeakerEnrollment
|
|
159
|
+
public func encode(to encoder: any Swift.Encoder) throws
|
|
160
|
+
}
|
|
161
|
+
public struct SVPendingInfo {
|
|
162
|
+
public let bufferedSamples: Swift.Int
|
|
163
|
+
public let bufferedSeconds: Swift.Float
|
|
164
|
+
public let neededSeconds: Swift.Float
|
|
165
|
+
}
|
|
166
|
+
public struct SpeakerVerificationResult {
|
|
167
|
+
public let scoreBest: Swift.Float
|
|
168
|
+
public let scoreMean: Swift.Float
|
|
169
|
+
public let scoreWorst: Swift.Float
|
|
170
|
+
public let scoreBestRaw: Swift.Float
|
|
171
|
+
public let scoreBestMeancombo: Swift.Float
|
|
172
|
+
public let bestKind: Swift.String
|
|
173
|
+
public let bestId: Swift.String
|
|
174
|
+
public let isMatch: Swift.Bool
|
|
175
|
+
public let embeddingDim: Swift.Int
|
|
176
|
+
public let usedSeconds: Swift.Float
|
|
177
|
+
public let ortRunMs: Swift.Double
|
|
178
|
+
public let featureMs: Swift.Double
|
|
179
|
+
public let totalMs: Swift.Double
|
|
180
|
+
}
|
|
181
|
+
public enum SpeakerVerificationOutput {
|
|
182
|
+
case pending(DavoiceTTS.SVPendingInfo)
|
|
183
|
+
case result(DavoiceTTS.SpeakerVerificationResult)
|
|
184
|
+
}
|
|
185
|
+
public enum SpeakerVerificationError : Swift.Error, Swift.CustomStringConvertible {
|
|
186
|
+
case invalidFrameSize(expected: Swift.Int, got: Swift.Int)
|
|
187
|
+
case enrollmentMissing
|
|
188
|
+
case emptyAudio
|
|
189
|
+
case onnx(Swift.String)
|
|
190
|
+
case feature(Swift.String)
|
|
191
|
+
public var description: Swift.String {
|
|
192
|
+
get
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
@objc @objcMembers final public class SpeakerVerificationEngine : ObjectiveC.NSObject {
|
|
196
|
+
final public let config: DavoiceTTS.SpeakerVerificationConfig
|
|
197
|
+
final public let logger: any DavoiceTTS.SVLogger
|
|
198
|
+
public init(config: DavoiceTTS.SpeakerVerificationConfig, logger: (any DavoiceTTS.SVLogger)? = nil) throws
|
|
199
|
+
final public func setEnrollment(_ enrollment: DavoiceTTS.SpeakerEnrollment?)
|
|
200
|
+
@objc final public func resetStreamingState()
|
|
201
|
+
final public func processFrame(frame: [Swift.Float]) throws -> DavoiceTTS.SpeakerVerificationOutput
|
|
202
|
+
final public func verifyWavFileStreaming(path: Swift.String, resetState: Swift.Bool = true) throws -> DavoiceTTS.SpeakerVerificationResult
|
|
203
|
+
@objc deinit
|
|
204
|
+
}
|
|
205
|
+
@_inheritsConvenienceInitializers @objc(DavoiceSpeakerVerificationRNFacade) final public class SpeakerVerificationRNFacade : ObjectiveC.NSObject {
|
|
206
|
+
@objc(createEngineWithModelPath:enrollmentJsonPath:options:error:) public static func createEngine(modelPath: Swift.String, enrollmentJsonPath: Swift.String, options: [Swift.String : Any], error outError: Foundation.NSErrorPointer) -> Any?
|
|
207
|
+
@objc(verifyWavWithEngine:wavPath:reset:error:) public static func verifyWav(engine: Any, wavPath: Swift.String, reset: Swift.Bool, error outError: Foundation.NSErrorPointer) -> [Swift.String : Any]?
|
|
208
|
+
@objc override dynamic public init()
|
|
209
|
+
@objc deinit
|
|
210
|
+
}
|
|
211
|
+
extension DavoiceTTS.SVLogLevel : Swift.Equatable {}
|
|
212
|
+
extension DavoiceTTS.SVLogLevel : Swift.Hashable {}
|
|
213
|
+
extension DavoiceTTS.SVLogLevel : Swift.RawRepresentable {}
|