react-native-davoice-tts 1.0.1
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/LICENSE +21 -0
- package/README.md +16 -0
- package/README.md_wakew +282 -0
- package/TTSRNBridge.podspec +32 -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 +42 -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 +17 -0
- package/android/src/main/assets/coca_cola_model_28_05052025.onnx +0 -0
- package/android/src/main/assets/embedding_model.onnx +0 -0
- package/android/src/main/assets/hey_lookdeep.onnx +0 -0
- package/android/src/main/assets/melspectrogram.onnx +0 -0
- package/android/src/main/assets/need_help_now.onnx +0 -0
- package/android/src/main/assets/silero_vad.onnx +0 -0
- package/android/src/main/java/com/davoice/tts/rn/DaVoiceTTSBridge.java +63 -0
- package/android/src/main/java/com/davoice/tts/rn/DaVoiceTTSPackage.java +26 -0
- package/android/src/main/libs/MyLibrary-release.aar +0 -0
- package/app.plugin.js +60 -0
- package/ios/TTSRNBridge/DaVoiceTTSBridge.h +7 -0
- package/ios/TTSRNBridge/DaVoiceTTSBridge.m +77 -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 +340 -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 +1739 -0
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios.private.swiftinterface +37 -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 +37 -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 +676 -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 +1739 -0
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +37 -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 +37 -0
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.abi.json +1739 -0
- package/ios/TTSRNBridge/DavoiceTTS.xcframework/ios-arm64_x86_64-simulator/DavoiceTTS.framework/Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +37 -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 +37 -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/TTSRNBridge.swift +48 -0
- package/ios/TTSRNBridge/libphonemes.a +0 -0
- package/ios/TTSRNBridge/libucd.a +0 -0
- package/ios/TTSRNBridge/models/model.onnx +0 -0
- package/ios/TTSRNBridge/models/model.onnx.json +503 -0
- package/package.json +44 -0
- package/phonemes_dir/en_dict +0 -0
- package/phonemes_dir/intonations +0 -0
- package/phonemes_dir/lang/gmw/en-US +15 -0
- package/phonemes_dir/phondata +0 -0
- package/phonemes_dir/phonindex +0 -0
- package/phonemes_dir/phontab +0 -0
- package/tts/DaVoiceTTSBridge.d.ts +6 -0
- package/tts/DaVoiceTTSBridge.js +25 -0
- package/tts/index.d.ts +3 -0
- package/tts/index.js +4 -0
|
@@ -0,0 +1,37 @@
|
|
|
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 x86_64-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 AVFoundation
|
|
6
|
+
import Foundation
|
|
7
|
+
import Swift
|
|
8
|
+
import _Concurrency
|
|
9
|
+
import _StringProcessing
|
|
10
|
+
import _SwiftConcurrencyShims
|
|
11
|
+
import onnxruntime_objc
|
|
12
|
+
import phonemes
|
|
13
|
+
@objc @_inheritsConvenienceInitializers final public class SwiftSoundQueue : ObjectiveC.NSObject, AVFAudio.AVAudioPlayerDelegate {
|
|
14
|
+
public static let shared: DavoiceTTS.SwiftSoundQueue
|
|
15
|
+
final public var onItemDone: ((Foundation.URL) -> Swift.Void)?
|
|
16
|
+
final public var onQueueEmpty: (() -> Swift.Void)?
|
|
17
|
+
final public func enqueue(_ source: DavoiceTTS.SwiftSoundQueue.Source)
|
|
18
|
+
final public func enqueueMany(_ sources: [DavoiceTTS.SwiftSoundQueue.Source])
|
|
19
|
+
final public func stop()
|
|
20
|
+
public enum Source {
|
|
21
|
+
case fileURL(Foundation.URL)
|
|
22
|
+
case named(Swift.String)
|
|
23
|
+
}
|
|
24
|
+
@objc final public func audioPlayerDidFinishPlaying(_ p: AVFAudio.AVAudioPlayer, successfully ok: Swift.Bool)
|
|
25
|
+
@objc override dynamic public init()
|
|
26
|
+
@objc deinit
|
|
27
|
+
}
|
|
28
|
+
@objc @objcMembers final public class DaVoiceTTS : ObjectiveC.NSObject {
|
|
29
|
+
public struct Config {
|
|
30
|
+
}
|
|
31
|
+
@objc public init(model: Foundation.URL) throws
|
|
32
|
+
@objc final public func speak(_ txt: Swift.String, sid: Swift.Int32 = 0)
|
|
33
|
+
@objc final public func synthesize(_ text: Swift.String, speakerId: Swift.Int32 = 0) throws -> AVFAudio.AVAudioPCMBuffer
|
|
34
|
+
@objc final public func synthesize_top(_ text: Swift.String, speakerId: Swift.Int32 = 0) throws -> AVFAudio.AVAudioPCMBuffer
|
|
35
|
+
@objc final public func synthesize_top_v1(_ text: Swift.String, speakerId: Swift.Int32 = 0) throws -> AVFAudio.AVAudioPCMBuffer
|
|
36
|
+
@objc deinit
|
|
37
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,37 @@
|
|
|
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 x86_64-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 AVFoundation
|
|
6
|
+
import Foundation
|
|
7
|
+
import Swift
|
|
8
|
+
import _Concurrency
|
|
9
|
+
import _StringProcessing
|
|
10
|
+
import _SwiftConcurrencyShims
|
|
11
|
+
import onnxruntime_objc
|
|
12
|
+
import phonemes
|
|
13
|
+
@objc @_inheritsConvenienceInitializers final public class SwiftSoundQueue : ObjectiveC.NSObject, AVFAudio.AVAudioPlayerDelegate {
|
|
14
|
+
public static let shared: DavoiceTTS.SwiftSoundQueue
|
|
15
|
+
final public var onItemDone: ((Foundation.URL) -> Swift.Void)?
|
|
16
|
+
final public var onQueueEmpty: (() -> Swift.Void)?
|
|
17
|
+
final public func enqueue(_ source: DavoiceTTS.SwiftSoundQueue.Source)
|
|
18
|
+
final public func enqueueMany(_ sources: [DavoiceTTS.SwiftSoundQueue.Source])
|
|
19
|
+
final public func stop()
|
|
20
|
+
public enum Source {
|
|
21
|
+
case fileURL(Foundation.URL)
|
|
22
|
+
case named(Swift.String)
|
|
23
|
+
}
|
|
24
|
+
@objc final public func audioPlayerDidFinishPlaying(_ p: AVFAudio.AVAudioPlayer, successfully ok: Swift.Bool)
|
|
25
|
+
@objc override dynamic public init()
|
|
26
|
+
@objc deinit
|
|
27
|
+
}
|
|
28
|
+
@objc @objcMembers final public class DaVoiceTTS : ObjectiveC.NSObject {
|
|
29
|
+
public struct Config {
|
|
30
|
+
}
|
|
31
|
+
@objc public init(model: Foundation.URL) throws
|
|
32
|
+
@objc final public func speak(_ txt: Swift.String, sid: Swift.Int32 = 0)
|
|
33
|
+
@objc final public func synthesize(_ text: Swift.String, speakerId: Swift.Int32 = 0) throws -> AVFAudio.AVAudioPCMBuffer
|
|
34
|
+
@objc final public func synthesize_top(_ text: Swift.String, speakerId: Swift.Int32 = 0) throws -> AVFAudio.AVAudioPCMBuffer
|
|
35
|
+
@objc final public func synthesize_top_v1(_ text: Swift.String, speakerId: Swift.Int32 = 0) throws -> AVFAudio.AVAudioPCMBuffer
|
|
36
|
+
@objc deinit
|
|
37
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
+
<plist version="1.0">
|
|
4
|
+
<dict>
|
|
5
|
+
<key>files</key>
|
|
6
|
+
<dict>
|
|
7
|
+
<key>Headers/DavoiceTTS-Swift.h</key>
|
|
8
|
+
<data>
|
|
9
|
+
LvFrjB21PcpOlveIpGtYYM1nqkQ=
|
|
10
|
+
</data>
|
|
11
|
+
<key>Info.plist</key>
|
|
12
|
+
<data>
|
|
13
|
+
hrWd0oCqa3HoPJ0UNh66XrsDl18=
|
|
14
|
+
</data>
|
|
15
|
+
<key>Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.abi.json</key>
|
|
16
|
+
<data>
|
|
17
|
+
qhAdxamuFCxwidMf9WHlxA/O648=
|
|
18
|
+
</data>
|
|
19
|
+
<key>Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface</key>
|
|
20
|
+
<data>
|
|
21
|
+
ll61CzEXvjJ6DyGzRKneB31DbXk=
|
|
22
|
+
</data>
|
|
23
|
+
<key>Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.swiftdoc</key>
|
|
24
|
+
<data>
|
|
25
|
+
MwwyNSiUrim8zEeEX3iN5ZSDC9w=
|
|
26
|
+
</data>
|
|
27
|
+
<key>Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.swiftinterface</key>
|
|
28
|
+
<data>
|
|
29
|
+
ll61CzEXvjJ6DyGzRKneB31DbXk=
|
|
30
|
+
</data>
|
|
31
|
+
<key>Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.swiftmodule</key>
|
|
32
|
+
<data>
|
|
33
|
+
uWfIvrCTe3Uwu3OjkA7nQWh7ImQ=
|
|
34
|
+
</data>
|
|
35
|
+
<key>Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.abi.json</key>
|
|
36
|
+
<data>
|
|
37
|
+
qhAdxamuFCxwidMf9WHlxA/O648=
|
|
38
|
+
</data>
|
|
39
|
+
<key>Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface</key>
|
|
40
|
+
<data>
|
|
41
|
+
LXZ6/Qs7pGUMGaF6TjNvTorLLgE=
|
|
42
|
+
</data>
|
|
43
|
+
<key>Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.swiftdoc</key>
|
|
44
|
+
<data>
|
|
45
|
+
nFkkwyO6ywOQjZ9bXtHNjnJ2rAk=
|
|
46
|
+
</data>
|
|
47
|
+
<key>Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.swiftinterface</key>
|
|
48
|
+
<data>
|
|
49
|
+
LXZ6/Qs7pGUMGaF6TjNvTorLLgE=
|
|
50
|
+
</data>
|
|
51
|
+
<key>Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.swiftmodule</key>
|
|
52
|
+
<data>
|
|
53
|
+
PhmaMng+9o4uk6Kz/9FQFblDgs8=
|
|
54
|
+
</data>
|
|
55
|
+
<key>Modules/module.modulemap</key>
|
|
56
|
+
<data>
|
|
57
|
+
msWUQ3rnN5xodJw3mAMUgtovezY=
|
|
58
|
+
</data>
|
|
59
|
+
</dict>
|
|
60
|
+
<key>files2</key>
|
|
61
|
+
<dict>
|
|
62
|
+
<key>Headers/DavoiceTTS-Swift.h</key>
|
|
63
|
+
<dict>
|
|
64
|
+
<key>hash</key>
|
|
65
|
+
<data>
|
|
66
|
+
LvFrjB21PcpOlveIpGtYYM1nqkQ=
|
|
67
|
+
</data>
|
|
68
|
+
<key>hash2</key>
|
|
69
|
+
<data>
|
|
70
|
+
hPRNx1++oZvQySnfxm47y6zi4qS6g5VFxkq76RAd4Og=
|
|
71
|
+
</data>
|
|
72
|
+
</dict>
|
|
73
|
+
<key>Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.abi.json</key>
|
|
74
|
+
<dict>
|
|
75
|
+
<key>hash</key>
|
|
76
|
+
<data>
|
|
77
|
+
qhAdxamuFCxwidMf9WHlxA/O648=
|
|
78
|
+
</data>
|
|
79
|
+
<key>hash2</key>
|
|
80
|
+
<data>
|
|
81
|
+
uzyLmiKHuPrjyfC1ZAMZ187WaJZ4/mvyNRBF7/c1mBU=
|
|
82
|
+
</data>
|
|
83
|
+
</dict>
|
|
84
|
+
<key>Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface</key>
|
|
85
|
+
<dict>
|
|
86
|
+
<key>hash</key>
|
|
87
|
+
<data>
|
|
88
|
+
ll61CzEXvjJ6DyGzRKneB31DbXk=
|
|
89
|
+
</data>
|
|
90
|
+
<key>hash2</key>
|
|
91
|
+
<data>
|
|
92
|
+
qtrig+/eTaGrJ8idbshi9g4OFuNZEOUkQ0eADkyySkc=
|
|
93
|
+
</data>
|
|
94
|
+
</dict>
|
|
95
|
+
<key>Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.swiftdoc</key>
|
|
96
|
+
<dict>
|
|
97
|
+
<key>hash</key>
|
|
98
|
+
<data>
|
|
99
|
+
MwwyNSiUrim8zEeEX3iN5ZSDC9w=
|
|
100
|
+
</data>
|
|
101
|
+
<key>hash2</key>
|
|
102
|
+
<data>
|
|
103
|
+
SuxLtGaasYsaA//D6q+p26AOQWOBaiSXljmfbxdrWYY=
|
|
104
|
+
</data>
|
|
105
|
+
</dict>
|
|
106
|
+
<key>Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.swiftinterface</key>
|
|
107
|
+
<dict>
|
|
108
|
+
<key>hash</key>
|
|
109
|
+
<data>
|
|
110
|
+
ll61CzEXvjJ6DyGzRKneB31DbXk=
|
|
111
|
+
</data>
|
|
112
|
+
<key>hash2</key>
|
|
113
|
+
<data>
|
|
114
|
+
qtrig+/eTaGrJ8idbshi9g4OFuNZEOUkQ0eADkyySkc=
|
|
115
|
+
</data>
|
|
116
|
+
</dict>
|
|
117
|
+
<key>Modules/DavoiceTTS.swiftmodule/arm64-apple-ios-simulator.swiftmodule</key>
|
|
118
|
+
<dict>
|
|
119
|
+
<key>hash</key>
|
|
120
|
+
<data>
|
|
121
|
+
uWfIvrCTe3Uwu3OjkA7nQWh7ImQ=
|
|
122
|
+
</data>
|
|
123
|
+
<key>hash2</key>
|
|
124
|
+
<data>
|
|
125
|
+
z4wsKtvgHIfduOBco84rGMLvy4Hm4PVP6dZ6Hd0vEYo=
|
|
126
|
+
</data>
|
|
127
|
+
</dict>
|
|
128
|
+
<key>Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.abi.json</key>
|
|
129
|
+
<dict>
|
|
130
|
+
<key>hash</key>
|
|
131
|
+
<data>
|
|
132
|
+
qhAdxamuFCxwidMf9WHlxA/O648=
|
|
133
|
+
</data>
|
|
134
|
+
<key>hash2</key>
|
|
135
|
+
<data>
|
|
136
|
+
uzyLmiKHuPrjyfC1ZAMZ187WaJZ4/mvyNRBF7/c1mBU=
|
|
137
|
+
</data>
|
|
138
|
+
</dict>
|
|
139
|
+
<key>Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface</key>
|
|
140
|
+
<dict>
|
|
141
|
+
<key>hash</key>
|
|
142
|
+
<data>
|
|
143
|
+
LXZ6/Qs7pGUMGaF6TjNvTorLLgE=
|
|
144
|
+
</data>
|
|
145
|
+
<key>hash2</key>
|
|
146
|
+
<data>
|
|
147
|
+
iglQAk8W/viCVsepEVWir/ujeX88okHEPXGmq8Hvr24=
|
|
148
|
+
</data>
|
|
149
|
+
</dict>
|
|
150
|
+
<key>Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.swiftdoc</key>
|
|
151
|
+
<dict>
|
|
152
|
+
<key>hash</key>
|
|
153
|
+
<data>
|
|
154
|
+
nFkkwyO6ywOQjZ9bXtHNjnJ2rAk=
|
|
155
|
+
</data>
|
|
156
|
+
<key>hash2</key>
|
|
157
|
+
<data>
|
|
158
|
+
0qG1KZEc3712z+47ZZX9anogFKBDZa3bFcanUD4JTpE=
|
|
159
|
+
</data>
|
|
160
|
+
</dict>
|
|
161
|
+
<key>Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.swiftinterface</key>
|
|
162
|
+
<dict>
|
|
163
|
+
<key>hash</key>
|
|
164
|
+
<data>
|
|
165
|
+
LXZ6/Qs7pGUMGaF6TjNvTorLLgE=
|
|
166
|
+
</data>
|
|
167
|
+
<key>hash2</key>
|
|
168
|
+
<data>
|
|
169
|
+
iglQAk8W/viCVsepEVWir/ujeX88okHEPXGmq8Hvr24=
|
|
170
|
+
</data>
|
|
171
|
+
</dict>
|
|
172
|
+
<key>Modules/DavoiceTTS.swiftmodule/x86_64-apple-ios-simulator.swiftmodule</key>
|
|
173
|
+
<dict>
|
|
174
|
+
<key>hash</key>
|
|
175
|
+
<data>
|
|
176
|
+
PhmaMng+9o4uk6Kz/9FQFblDgs8=
|
|
177
|
+
</data>
|
|
178
|
+
<key>hash2</key>
|
|
179
|
+
<data>
|
|
180
|
+
NJRCrLZRX9H46N+iCj99xkXVL1+tLjc5eDlFboVP2dE=
|
|
181
|
+
</data>
|
|
182
|
+
</dict>
|
|
183
|
+
<key>Modules/module.modulemap</key>
|
|
184
|
+
<dict>
|
|
185
|
+
<key>hash</key>
|
|
186
|
+
<data>
|
|
187
|
+
msWUQ3rnN5xodJw3mAMUgtovezY=
|
|
188
|
+
</data>
|
|
189
|
+
<key>hash2</key>
|
|
190
|
+
<data>
|
|
191
|
+
X8EMB/Z5Eqzgc2iqyzdMRmISxoFtSrIHi+n3BM3d71E=
|
|
192
|
+
</data>
|
|
193
|
+
</dict>
|
|
194
|
+
</dict>
|
|
195
|
+
<key>rules</key>
|
|
196
|
+
<dict>
|
|
197
|
+
<key>^.*</key>
|
|
198
|
+
<true/>
|
|
199
|
+
<key>^.*\.lproj/</key>
|
|
200
|
+
<dict>
|
|
201
|
+
<key>optional</key>
|
|
202
|
+
<true/>
|
|
203
|
+
<key>weight</key>
|
|
204
|
+
<real>1000</real>
|
|
205
|
+
</dict>
|
|
206
|
+
<key>^.*\.lproj/locversion.plist$</key>
|
|
207
|
+
<dict>
|
|
208
|
+
<key>omit</key>
|
|
209
|
+
<true/>
|
|
210
|
+
<key>weight</key>
|
|
211
|
+
<real>1100</real>
|
|
212
|
+
</dict>
|
|
213
|
+
<key>^Base\.lproj/</key>
|
|
214
|
+
<dict>
|
|
215
|
+
<key>weight</key>
|
|
216
|
+
<real>1010</real>
|
|
217
|
+
</dict>
|
|
218
|
+
<key>^version.plist$</key>
|
|
219
|
+
<true/>
|
|
220
|
+
</dict>
|
|
221
|
+
<key>rules2</key>
|
|
222
|
+
<dict>
|
|
223
|
+
<key>.*\.dSYM($|/)</key>
|
|
224
|
+
<dict>
|
|
225
|
+
<key>weight</key>
|
|
226
|
+
<real>11</real>
|
|
227
|
+
</dict>
|
|
228
|
+
<key>^(.*/)?\.DS_Store$</key>
|
|
229
|
+
<dict>
|
|
230
|
+
<key>omit</key>
|
|
231
|
+
<true/>
|
|
232
|
+
<key>weight</key>
|
|
233
|
+
<real>2000</real>
|
|
234
|
+
</dict>
|
|
235
|
+
<key>^.*</key>
|
|
236
|
+
<true/>
|
|
237
|
+
<key>^.*\.lproj/</key>
|
|
238
|
+
<dict>
|
|
239
|
+
<key>optional</key>
|
|
240
|
+
<true/>
|
|
241
|
+
<key>weight</key>
|
|
242
|
+
<real>1000</real>
|
|
243
|
+
</dict>
|
|
244
|
+
<key>^.*\.lproj/locversion.plist$</key>
|
|
245
|
+
<dict>
|
|
246
|
+
<key>omit</key>
|
|
247
|
+
<true/>
|
|
248
|
+
<key>weight</key>
|
|
249
|
+
<real>1100</real>
|
|
250
|
+
</dict>
|
|
251
|
+
<key>^Base\.lproj/</key>
|
|
252
|
+
<dict>
|
|
253
|
+
<key>weight</key>
|
|
254
|
+
<real>1010</real>
|
|
255
|
+
</dict>
|
|
256
|
+
<key>^Info\.plist$</key>
|
|
257
|
+
<dict>
|
|
258
|
+
<key>omit</key>
|
|
259
|
+
<true/>
|
|
260
|
+
<key>weight</key>
|
|
261
|
+
<real>20</real>
|
|
262
|
+
</dict>
|
|
263
|
+
<key>^PkgInfo$</key>
|
|
264
|
+
<dict>
|
|
265
|
+
<key>omit</key>
|
|
266
|
+
<true/>
|
|
267
|
+
<key>weight</key>
|
|
268
|
+
<real>20</real>
|
|
269
|
+
</dict>
|
|
270
|
+
<key>^embedded\.provisionprofile$</key>
|
|
271
|
+
<dict>
|
|
272
|
+
<key>weight</key>
|
|
273
|
+
<real>20</real>
|
|
274
|
+
</dict>
|
|
275
|
+
<key>^version\.plist$</key>
|
|
276
|
+
<dict>
|
|
277
|
+
<key>weight</key>
|
|
278
|
+
<real>20</real>
|
|
279
|
+
</dict>
|
|
280
|
+
</dict>
|
|
281
|
+
</dict>
|
|
282
|
+
</plist>
|
|
File without changes
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import Foundation
|
|
2
|
+
import React
|
|
3
|
+
import DavoiceTTS // <-- Must match your framework/module name exactly
|
|
4
|
+
|
|
5
|
+
@objc(DaVoiceTTSBridge)
|
|
6
|
+
class DaVoiceTTSBridge: NSObject, RCTBridgeModule {
|
|
7
|
+
|
|
8
|
+
static func moduleName() -> String! {
|
|
9
|
+
return "DaVoiceTTSBridge"
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
static func requiresMainQueueSetup() -> Bool {
|
|
13
|
+
return true
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
private var ttsInstance: DaVoiceTTS?
|
|
17
|
+
|
|
18
|
+
@objc(initTTS:resolver:rejecter:)
|
|
19
|
+
func initTTS(_ configDict: NSDictionary, resolver: @escaping RCTPromiseResolveBlock, rejecter: @escaping RCTPromiseRejectBlock) {
|
|
20
|
+
guard
|
|
21
|
+
let modelPath = configDict["model"] as? String,
|
|
22
|
+
else {
|
|
23
|
+
rejecter("invalid_config", "Missing required keys in config", nil)
|
|
24
|
+
return
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
do {
|
|
28
|
+
ttsInstance = try DaVoiceTTS(
|
|
29
|
+
model: URL(fileURLWithPath: modelPath)
|
|
30
|
+
)
|
|
31
|
+
resolver("TTS initialized")
|
|
32
|
+
} catch {
|
|
33
|
+
rejecter("init_failed", "Failed to initialize DaVoiceTTS", error)
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@objc(speak:speakerId:resolver:rejecter:)
|
|
38
|
+
func speak(_ text: NSString, speakerId: NSNumber, resolver: @escaping RCTPromiseResolveBlock, rejecter: @escaping RCTPromiseRejectBlock) {
|
|
39
|
+
guard let tts = ttsInstance else {
|
|
40
|
+
rejecter("no_instance", "TTS instance not initialized", nil)
|
|
41
|
+
return
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
tts.speak(text as String, sid: Int32(truncating: speakerId))
|
|
45
|
+
resolver("Speaking")
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
Binary file
|
|
Binary file
|
|
Binary file
|