@focus8/expo-acapela-tts 0.1.6 → 0.1.9
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/.eslintrc.js +0 -0
- package/README.md +0 -0
- package/android/build.gradle +7 -0
- package/android/libs/acattsandroid-sdk-library-release.aar +0 -0
- package/android/src/main/AndroidManifest.xml +0 -0
- package/android/src/main/java/expo/modules/acapelatts/ExpoAcapelaTtsModule.kt +22 -7
- package/android/src/main/jniLibs/arm64-v8a/libacattsandroid.so +0 -0
- package/android/src/main/jniLibs/armeabi-v7a/libacattsandroid.so +0 -0
- package/android/src/main/jniLibs/x86/libacattsandroid.so +0 -0
- package/android/src/main/jniLibs/x86_64/libacattsandroid.so +0 -0
- package/build/ExpoAcapelaTts.types.d.ts +0 -0
- package/build/ExpoAcapelaTts.types.d.ts.map +0 -0
- package/build/ExpoAcapelaTts.types.js +0 -0
- package/build/ExpoAcapelaTts.types.js.map +0 -0
- package/build/ExpoAcapelaTtsModule.android.d.ts +0 -0
- package/build/ExpoAcapelaTtsModule.android.d.ts.map +0 -0
- package/build/ExpoAcapelaTtsModule.android.js +0 -0
- package/build/ExpoAcapelaTtsModule.android.js.map +0 -0
- package/build/ExpoAcapelaTtsModule.d.ts +0 -0
- package/build/ExpoAcapelaTtsModule.d.ts.map +0 -0
- package/build/ExpoAcapelaTtsModule.js +0 -0
- package/build/ExpoAcapelaTtsModule.js.map +0 -0
- package/build/index.d.ts +0 -0
- package/build/index.d.ts.map +0 -0
- package/build/index.js +0 -0
- package/build/index.js.map +0 -0
- package/expo-module.config.json +0 -0
- package/package.json +1 -1
- package/src/ExpoAcapelaTts.types.ts +0 -0
- package/src/ExpoAcapelaTtsModule.android.ts +0 -0
- package/src/ExpoAcapelaTtsModule.ts +0 -0
- package/src/index.ts +0 -0
- package/tsconfig.json +0 -0
package/.eslintrc.js
CHANGED
|
File without changes
|
package/README.md
CHANGED
|
File without changes
|
package/android/build.gradle
CHANGED
|
@@ -32,6 +32,13 @@ android {
|
|
|
32
32
|
defaultConfig {
|
|
33
33
|
versionCode 1
|
|
34
34
|
versionName "0.1.0"
|
|
35
|
+
|
|
36
|
+
buildConfigField "long", "ACAPELA_USER_ID", "${System.getenv('ACAPELA_USER_ID') ?: '0'}L"
|
|
37
|
+
buildConfigField "long", "ACAPELA_PASSWORD", "${System.getenv('ACAPELA_PASSWORD') ?: '0'}L"
|
|
38
|
+
buildConfigField "String", "ACAPELA_LICENSE_KEY", "\"${System.getenv('ACAPELA_LICENSE_KEY') ?: ''}\""
|
|
39
|
+
}
|
|
40
|
+
buildFeatures {
|
|
41
|
+
buildConfig true
|
|
35
42
|
}
|
|
36
43
|
lintOptions {
|
|
37
44
|
abortOnError false
|
|
File without changes
|
|
File without changes
|
|
@@ -113,11 +113,11 @@ class ExpoAcapelaTtsModule : Module(), iTTSEventsCallback {
|
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
-
Function("setLicense") { userId:
|
|
117
|
-
licenseUserId = userId
|
|
118
|
-
licensePassword = password
|
|
116
|
+
Function("setLicense") { userId: Double, password: Double, key: String ->
|
|
117
|
+
licenseUserId = userId.toLong()
|
|
118
|
+
licensePassword = password.toLong()
|
|
119
119
|
licenseKey = key
|
|
120
|
-
logInfo("License set")
|
|
120
|
+
logInfo("License set: userId=0x${java.lang.Long.toHexString(licenseUserId!!)} password=0x${java.lang.Long.toHexString(licensePassword!!)}")
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
AsyncFunction("initializeAsync") {
|
|
@@ -131,8 +131,13 @@ class ExpoAcapelaTtsModule : Module(), iTTSEventsCallback {
|
|
|
131
131
|
return@AsyncFunction true
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
-
|
|
135
|
-
|
|
134
|
+
// Use BuildConfig values as fallback if setLicense() was not called from JS
|
|
135
|
+
val uid = licenseUserId ?: BuildConfig.ACAPELA_USER_ID
|
|
136
|
+
val pwd = licensePassword ?: BuildConfig.ACAPELA_PASSWORD
|
|
137
|
+
val key = licenseKey ?: BuildConfig.ACAPELA_LICENSE_KEY
|
|
138
|
+
|
|
139
|
+
if (uid == 0L || key.isNullOrEmpty()) {
|
|
140
|
+
logWarning("Cannot initialize: no license configured (neither via setLicense() nor BuildConfig)")
|
|
136
141
|
return@AsyncFunction false
|
|
137
142
|
}
|
|
138
143
|
|
|
@@ -144,7 +149,13 @@ class ExpoAcapelaTtsModule : Module(), iTTSEventsCallback {
|
|
|
144
149
|
|
|
145
150
|
tts = acattsandroid(context, this@ExpoAcapelaTtsModule, null)
|
|
146
151
|
tts!!.setLog(true)
|
|
147
|
-
|
|
152
|
+
logInfo("setLicense userId=0x${java.lang.Long.toHexString(uid)} password=0x${java.lang.Long.toHexString(pwd)} keyLength=${key?.length}")
|
|
153
|
+
tts!!.setLicense(uid, pwd, key)
|
|
154
|
+
|
|
155
|
+
// Store for re-use after getVoicesList
|
|
156
|
+
licenseUserId = uid
|
|
157
|
+
licensePassword = pwd
|
|
158
|
+
licenseKey = key
|
|
148
159
|
|
|
149
160
|
val version = tts!!.version
|
|
150
161
|
logInfo("Initialized, SDK version: $version")
|
|
@@ -178,6 +189,10 @@ class ExpoAcapelaTtsModule : Module(), iTTSEventsCallback {
|
|
|
178
189
|
}
|
|
179
190
|
}
|
|
180
191
|
val voicesList = tts!!.getVoicesList(voiceDirPaths) ?: emptyArray()
|
|
192
|
+
// Re-set license after getVoicesList as it may reset internal state
|
|
193
|
+
if (licenseUserId != null && licensePassword != null && licenseKey != null) {
|
|
194
|
+
tts!!.setLicense(licenseUserId!!, licensePassword!!, licenseKey)
|
|
195
|
+
}
|
|
181
196
|
logInfo("Found ${voicesList.size} voices")
|
|
182
197
|
for (v in voicesList) {
|
|
183
198
|
logInfo(" Voice: $v")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/build/index.d.ts
CHANGED
|
File without changes
|
package/build/index.d.ts.map
CHANGED
|
File without changes
|
package/build/index.js
CHANGED
|
File without changes
|
package/build/index.js.map
CHANGED
|
File without changes
|
package/expo-module.config.json
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/index.ts
CHANGED
|
File without changes
|
package/tsconfig.json
CHANGED
|
File without changes
|