@focus8/expo-acapela-tts 0.1.11 → 0.1.12

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.
@@ -198,14 +198,21 @@ class ExpoAcapelaTtsModule : Module(), iTTSEventsCallback {
198
198
  logInfo(" Voice: $v")
199
199
  }
200
200
 
201
- val voices = voicesList.map { voiceName ->
201
+ val seen = mutableMapOf<String, Int>()
202
+ val voices = voicesList.mapIndexed { index, voiceName ->
202
203
  val info = tts!!.getVoiceInfo(voiceName) ?: emptyMap()
203
204
  val genderValue = info["gender"] ?: "0"
205
+ val internalName = info["name"] ?: "voice_$index"
206
+ // Track duplicates and create unique id
207
+ val count = seen.getOrDefault(voiceName, 0)
208
+ seen[voiceName] = count + 1
209
+ val uniqueId = if (count == 0) voiceName else "${voiceName}_${count}"
204
210
  mapOf(
211
+ "id" to uniqueId,
205
212
  "name" to voiceName,
206
213
  "locale" to (info["locale"] ?: ""),
207
214
  "language" to (info["language"] ?: ""),
208
- "speaker" to (info["name"]?.let { extractSpeakerName(it) } ?: ""),
215
+ "speaker" to internalName,
209
216
  "gender" to if (genderValue == "1") "female" else "male",
210
217
  "quality" to (info["quality"] ?: ""),
211
218
  "age" to (info["age"] ?: ""),
@@ -1,4 +1,5 @@
1
1
  export type AcapelaVoice = {
2
+ id: string;
2
3
  name: string;
3
4
  locale: string;
4
5
  language: string;
@@ -1 +1 @@
1
- {"version":3,"file":"ExpoAcapelaTts.types.d.ts","sourceRoot":"","sources":["../src/ExpoAcapelaTts.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG;IACvC,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,OAAO,EAAE,CAAC,KAAK,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;CAC7D,CAAC"}
1
+ {"version":3,"file":"ExpoAcapelaTts.types.d.ts","sourceRoot":"","sources":["../src/ExpoAcapelaTts.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG;IACvC,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,OAAO,EAAE,CAAC,KAAK,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;CAC7D,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ExpoAcapelaTts.types.js","sourceRoot":"","sources":["../src/ExpoAcapelaTts.types.ts"],"names":[],"mappings":"","sourcesContent":["export type AcapelaVoice = {\n name: string;\n locale: string;\n language: string;\n speaker: string;\n gender: 'male' | 'female';\n quality: string;\n age: string;\n frequency: string;\n};\n\nexport type ExpoAcapelaTtsModuleEvents = {\n onSpeechStart: () => void;\n onSpeechEnd: () => void;\n onError: (event: { message: string; code: number }) => void;\n};\n"]}
1
+ {"version":3,"file":"ExpoAcapelaTts.types.js","sourceRoot":"","sources":["../src/ExpoAcapelaTts.types.ts"],"names":[],"mappings":"","sourcesContent":["export type AcapelaVoice = {\n id: string;\n name: string;\n locale: string;\n language: string;\n speaker: string;\n gender: 'male' | 'female';\n quality: string;\n age: string;\n frequency: string;\n};\n\nexport type ExpoAcapelaTtsModuleEvents = {\n onSpeechStart: () => void;\n onSpeechEnd: () => void;\n onError: (event: { message: string; code: number }) => void;\n};\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@focus8/expo-acapela-tts",
3
- "version": "0.1.11",
3
+ "version": "0.1.12",
4
4
  "description": "Acapela TTS integration for Expo on Android",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -1,4 +1,5 @@
1
1
  export type AcapelaVoice = {
2
+ id: string;
2
3
  name: string;
3
4
  locale: string;
4
5
  language: string;