expo-speech 13.1.1 → 13.1.3

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.
Files changed (42) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/android/build.gradle +2 -2
  3. package/build/ExponentSpeech.web.d.ts.map +1 -1
  4. package/build/ExponentSpeech.web.js +1 -1
  5. package/build/ExponentSpeech.web.js.map +1 -1
  6. package/build/Speech.js.map +1 -1
  7. package/expo-module.config.json +1 -1
  8. package/local-maven-repo/host/exp/exponent/expo.modules.speech/{13.1.1/expo.modules.speech-13.1.1.module → 13.1.3/expo.modules.speech-13.1.3.module} +7 -7
  9. package/local-maven-repo/host/exp/exponent/expo.modules.speech/13.1.3/expo.modules.speech-13.1.3.module.md5 +1 -0
  10. package/local-maven-repo/host/exp/exponent/expo.modules.speech/13.1.3/expo.modules.speech-13.1.3.module.sha1 +1 -0
  11. package/local-maven-repo/host/exp/exponent/expo.modules.speech/13.1.3/expo.modules.speech-13.1.3.module.sha256 +1 -0
  12. package/local-maven-repo/host/exp/exponent/expo.modules.speech/13.1.3/expo.modules.speech-13.1.3.module.sha512 +1 -0
  13. package/local-maven-repo/host/exp/exponent/expo.modules.speech/{13.1.1/expo.modules.speech-13.1.1.pom → 13.1.3/expo.modules.speech-13.1.3.pom} +1 -1
  14. package/local-maven-repo/host/exp/exponent/expo.modules.speech/13.1.3/expo.modules.speech-13.1.3.pom.md5 +1 -0
  15. package/local-maven-repo/host/exp/exponent/expo.modules.speech/13.1.3/expo.modules.speech-13.1.3.pom.sha1 +1 -0
  16. package/local-maven-repo/host/exp/exponent/expo.modules.speech/13.1.3/expo.modules.speech-13.1.3.pom.sha256 +1 -0
  17. package/local-maven-repo/host/exp/exponent/expo.modules.speech/13.1.3/expo.modules.speech-13.1.3.pom.sha512 +1 -0
  18. package/local-maven-repo/host/exp/exponent/expo.modules.speech/maven-metadata.xml +4 -4
  19. package/local-maven-repo/host/exp/exponent/expo.modules.speech/maven-metadata.xml.md5 +1 -1
  20. package/local-maven-repo/host/exp/exponent/expo.modules.speech/maven-metadata.xml.sha1 +1 -1
  21. package/local-maven-repo/host/exp/exponent/expo.modules.speech/maven-metadata.xml.sha256 +1 -1
  22. package/local-maven-repo/host/exp/exponent/expo.modules.speech/maven-metadata.xml.sha512 +1 -1
  23. package/package.json +3 -3
  24. package/src/Speech/ExponentSpeech.web.ts +1 -1
  25. package/local-maven-repo/host/exp/exponent/expo.modules.speech/13.1.1/expo.modules.speech-13.1.1.module.md5 +0 -1
  26. package/local-maven-repo/host/exp/exponent/expo.modules.speech/13.1.1/expo.modules.speech-13.1.1.module.sha1 +0 -1
  27. package/local-maven-repo/host/exp/exponent/expo.modules.speech/13.1.1/expo.modules.speech-13.1.1.module.sha256 +0 -1
  28. package/local-maven-repo/host/exp/exponent/expo.modules.speech/13.1.1/expo.modules.speech-13.1.1.module.sha512 +0 -1
  29. package/local-maven-repo/host/exp/exponent/expo.modules.speech/13.1.1/expo.modules.speech-13.1.1.pom.md5 +0 -1
  30. package/local-maven-repo/host/exp/exponent/expo.modules.speech/13.1.1/expo.modules.speech-13.1.1.pom.sha1 +0 -1
  31. package/local-maven-repo/host/exp/exponent/expo.modules.speech/13.1.1/expo.modules.speech-13.1.1.pom.sha256 +0 -1
  32. package/local-maven-repo/host/exp/exponent/expo.modules.speech/13.1.1/expo.modules.speech-13.1.1.pom.sha512 +0 -1
  33. /package/local-maven-repo/host/exp/exponent/expo.modules.speech/{13.1.1/expo.modules.speech-13.1.1-sources.jar → 13.1.3/expo.modules.speech-13.1.3-sources.jar} +0 -0
  34. /package/local-maven-repo/host/exp/exponent/expo.modules.speech/{13.1.1/expo.modules.speech-13.1.1-sources.jar.md5 → 13.1.3/expo.modules.speech-13.1.3-sources.jar.md5} +0 -0
  35. /package/local-maven-repo/host/exp/exponent/expo.modules.speech/{13.1.1/expo.modules.speech-13.1.1-sources.jar.sha1 → 13.1.3/expo.modules.speech-13.1.3-sources.jar.sha1} +0 -0
  36. /package/local-maven-repo/host/exp/exponent/expo.modules.speech/{13.1.1/expo.modules.speech-13.1.1-sources.jar.sha256 → 13.1.3/expo.modules.speech-13.1.3-sources.jar.sha256} +0 -0
  37. /package/local-maven-repo/host/exp/exponent/expo.modules.speech/{13.1.1/expo.modules.speech-13.1.1-sources.jar.sha512 → 13.1.3/expo.modules.speech-13.1.3-sources.jar.sha512} +0 -0
  38. /package/local-maven-repo/host/exp/exponent/expo.modules.speech/{13.1.1/expo.modules.speech-13.1.1.aar → 13.1.3/expo.modules.speech-13.1.3.aar} +0 -0
  39. /package/local-maven-repo/host/exp/exponent/expo.modules.speech/{13.1.1/expo.modules.speech-13.1.1.aar.md5 → 13.1.3/expo.modules.speech-13.1.3.aar.md5} +0 -0
  40. /package/local-maven-repo/host/exp/exponent/expo.modules.speech/{13.1.1/expo.modules.speech-13.1.1.aar.sha1 → 13.1.3/expo.modules.speech-13.1.3.aar.sha1} +0 -0
  41. /package/local-maven-repo/host/exp/exponent/expo.modules.speech/{13.1.1/expo.modules.speech-13.1.1.aar.sha256 → 13.1.3/expo.modules.speech-13.1.3.aar.sha256} +0 -0
  42. /package/local-maven-repo/host/exp/exponent/expo.modules.speech/{13.1.1/expo.modules.speech-13.1.1.aar.sha512 → 13.1.3/expo.modules.speech-13.1.3.aar.sha512} +0 -0
package/CHANGELOG.md CHANGED
@@ -10,6 +10,14 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
+ ## 13.1.3 — 2025-04-11
14
+
15
+ _This version does not introduce any user-facing changes._
16
+
17
+ ## 13.1.2 — 2025-04-09
18
+
19
+ _This version does not introduce any user-facing changes._
20
+
13
21
  ## 13.1.1 — 2025-04-08
14
22
 
15
23
  _This version does not introduce any user-facing changes._
@@ -4,12 +4,12 @@ plugins {
4
4
  }
5
5
 
6
6
  group = 'host.exp.exponent'
7
- version = '13.1.1'
7
+ version = '13.1.3'
8
8
 
9
9
  android {
10
10
  namespace "expo.modules.speech"
11
11
  defaultConfig {
12
12
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 -95,5 +95,5 @@ class ExpoSpeech extends NativeModule {
95
95
  }
96
96
  maxSpeechInputLength = MAX_SPEECH_INPUT_LENGTH;
97
97
  }
98
- export default registerWebModule(ExpoSpeech);
98
+ export default registerWebModule(ExpoSpeech, 'ExpoSpeech');
99
99
  //# sourceMappingURL=ExponentSpeech.web.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ExponentSpeech.web.js","sourceRoot":"","sources":["../src/Speech/ExponentSpeech.web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEhF,OAAO,EAA2B,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEvE,gFAAgF;AAChF,MAAM,uBAAuB,GAAG,KAAK,CAAC;AAEtC,KAAK,UAAU,SAAS;IACtB,OAAO,IAAI,OAAO,CAAyB,CAAC,OAAO,EAAE,EAAE;QACrD,MAAM,MAAM,GAAG,MAAM,CAAC,eAAe,CAAC,SAAS,EAAE,CAAC;QAElD,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE;YACrB,OAAO,CAAC,MAAM,CAAC,CAAC;YAChB,OAAO;SACR;QAED,6EAA6E;QAC7E,mDAAmD;QACnD,MAAM,CAAC,eAAe,CAAC,eAAe,GAAG;YACvC,MAAM,MAAM,GAAG,MAAM,CAAC,eAAe,CAAC,SAAS,EAAE,CAAC;YAClD,OAAO,CAAC,MAAM,CAAC,CAAC;QAClB,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC;AASD,MAAM,UAAW,SAAQ,YAA8B;IACrD,KAAK,CAAC,KAAK,CAAC,EAAU,EAAE,IAAY,EAAE,OAAsB;QAC1D,IAAI,IAAI,CAAC,MAAM,GAAG,uBAAuB,EAAE;YACzC,MAAM,IAAI,UAAU,CAClB,yBAAyB,EACzB,2DAA2D,GAAG,uBAAuB,CACtF,CAAC;SACH;QAED,MAAM,OAAO,GAAG,IAAI,wBAAwB,E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AAO;YACxB,QAAQ,EAAE,KAAK,CAAC,IAAI;YACpB,YAAY,EAAE,KAAK,CAAC,YAAY;YAChC,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,QAAQ,EAAE,KAAK,CAAC,QAAQ;SACzB,CAAC,CAAC,CAAC;IACN,CAAC;IACD,KAAK,CAAC,UAAU;QACd,OAAO,MAAM,CAAC,eAAe,CAAC,QAAQ,CAAC;IACzC,CAAC;IACD,KAAK,CAAC,IAAI;QACR,OAAO,MAAM,CAAC,eAAe,CAAC,MAAM,EAAE,CAAC;IACzC,CAAC;IACD,KAAK,CAAC,KAAK;QACT,OAAO,MAAM,CAAC,eAAe,CAAC,KAAK,EAAE,CAAC;IACxC,CAAC;IACD,KAAK,CAAC,MAAM;QACV,OAAO,MAAM,CAAC,eAAe,CAAC,MAAM,EAAE,CAAC;IACzC,CAAC;IACD,oBAAoB,GAAG,uBAAuB,CAAC;CAChD;AAED,eAAe,iBAAiB,CAAC,UAAU,CAAC,CAAC","sourcesContent":["import { CodedError, NativeModule, registerWebModule } from 'expo-modules-core';\n\nimport { SpeechOptions, WebVoice, VoiceQuality } from './Speech.types';\n\n//https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesisUtterance/text\nconst MAX_SPEECH_INPUT_LENGTH = 32767;\n\nasync function getVoices(): Promise<SpeechSynthesisVoice[]> {\n return new Promise<SpeechSynthesisVoice[]>((resolve) => {\n const voices = window.speechSynthesis.getVoices();\n\n if (voices.length > 0) {\n resolve(voices);\n return;\n }\n\n // when a page loads it takes some amount of time to populate the voices list\n // see https://stackoverflow.com/a/52005323/4337317\n window.speechSynthesis.onvoiceschanged = function () {\n const voices = window.speechSynthesis.getVoices();\n resolve(voices);\n };\n });\n}\n\ntype ExpoSpeechEvents = {\n 'Exponent.speakingStarted': (params: { id: string; nativeEvent: SpeechSynthesisEvent }) => void;\n 'Exponent.speakingDone': (params: { id: string; nativeEvent: SpeechSynthesisEvent }) => void;\n 'Exponent.speakingStopped': (params: { id: string; nativeEvent: SpeechSynthesisEvent }) => void;\n 'Exponent.speakingError': (params: { id: string; nativeEvent: SpeechSynthesisEvent }) => void;\n};\n\nclass ExpoSpeech extends NativeModule<ExpoSpeechEvents> {\n async speak(id: string, text: string, options: SpeechOptions): Promise<SpeechSynthesisUtterance> {\n if (text.length > MAX_SPEECH_INPUT_LENGTH) {\n throw new CodedError(\n 'ERR_SPEECH_INPUT_LENGTH',\n 'Speech input text is too long! Limit of input length is: ' + MAX_SPEECH_INPUT_LENGTH\n );\n }\n\n const message = new SpeechSynthesisUtterance();\n\n if (typeof options.rate === 'number') {\n message.rate = options.rate;\n }\n if (typeof options.pitch === 'number') {\n message.pitch = options.pitch;\n }\n if (typeof options.language === 'string') {\n message.lang = options.language;\n }\n if (typeof options.volume === 'number') {\n message.volume = options.volume;\n }\n if ('_voiceIndex' in options && options._voiceIndex != null) {\n const voices = await getVoices();\n message.voice = voices[Math.min(voices.length - 1, Math.max(0, options._voiceIndex))];\n }\n if (typeof options.voice === 'string') {\n const voices = await getVoices();\n message.voice =\n voices[\n Math.max(\n 0,\n voices.findIndex((voice) => voice.voiceURI === options.voice)\n )\n ];\n }\n if (typeof options.onResume === 'function') {\n message.onresume = options.onResume;\n }\n if (typeof options.onMark === 'function') {\n message.onmark = options.onMark;\n }\n if (typeof options.onBoundary === 'function') {\n message.onboundary = options.onBoundary;\n }\n\n message.onstart = (nativeEvent: SpeechSynthesisEvent) => {\n this.emit('Exponent.speakingStarted', { id, nativeEvent });\n };\n message.onend = (nativeEvent: SpeechSynthesisEvent) => {\n this.emit('Exponent.speakingDone', { id, nativeEvent });\n };\n message.onpause = (nativeEvent: SpeechSynthesisEvent) => {\n this.emit('Exponent.speakingStopped', { id, nativeEvent });\n };\n message.onerror = (nativeEvent: SpeechSynthesisErrorEvent) => {\n this.emit('Exponent.speakingError', { id, nativeEvent });\n };\n\n message.text = text;\n\n window.speechSynthesis.speak(message);\n\n return message;\n }\n async getVoices(): Promise<WebVoice[]> {\n const voices = await getVoices();\n return voices.map((voice) => ({\n identifier: voice.voiceURI,\n quality: VoiceQuality.Default,\n isDefault: voice.default,\n language: voice.lang,\n localService: voice.localService,\n name: voice.name,\n voiceURI: voice.voiceURI,\n }));\n }\n async isSpeaking(): Promise<boolean> {\n return window.speechSynthesis.speaking;\n }\n async stop(): Promise<void> {\n return window.speechSynthesis.cancel();\n }\n async pause(): Promise<void> {\n return window.speechSynthesis.pause();\n }\n async resume(): Promise<void> {\n return window.speechSynthesis.resume();\n }\n maxSpeechInputLength = MAX_SPEECH_INPUT_LENGTH;\n}\n\nexport default registerWebModule(ExpoSpeech);\n"]}
1
+ {"version":3,"file":"ExponentSpeech.web.js","sourceRoot":"","sources":["../src/Speech/ExponentSpeech.web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEhF,OAAO,EAA2B,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEvE,gFAAgF;AAChF,MAAM,uBAAuB,GAAG,KAAK,CAAC;AAEtC,KAAK,UAAU,SAAS;IACtB,OAAO,IAAI,OAAO,CAAyB,CAAC,OAAO,EAAE,EAAE;QACrD,MAAM,MAAM,GAAG,MAAM,CAAC,eAAe,CAAC,SAAS,EAAE,CAAC;QAElD,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACtB,OAAO,CAAC,MAAM,CAAC,CAAC;YAChB,OAAO;QACT,CAAC;QAED,6EAA6E;QAC7E,mDAAmD;QACnD,MAAM,CAAC,eAAe,CAAC,eAAe,GAAG;YACvC,MAAM,MAAM,GAAG,MAAM,CAAC,eAAe,CAAC,SAAS,EAAE,CAAC;YAClD,OAAO,CAAC,MAAM,CAAC,CAAC;QAClB,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC;AASD,MAAM,UAAW,SAAQ,YAA8B;IACrD,KAAK,CAAC,KAAK,CAAC,EAAU,EAAE,IAAY,EAA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,OAAO,CAAC,CAAC;QAEtC,OAAO,OAAO,CAAC;IACjB,CAAC;IACD,KAAK,CAAC,SAAS;QACb,MAAM,MAAM,GAAG,MAAM,SAAS,EAAE,CAAC;QACjC,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;YAC5B,UAAU,EAAE,KAAK,CAAC,QAAQ;YAC1B,OAAO,EAAE,YAAY,CAAC,OAAO;YAC7B,SAAS,EAAE,KAAK,CAAC,OAAO;YACxB,QAAQ,EAAE,KAAK,CAAC,IAAI;YACpB,YAAY,EAAE,KAAK,CAAC,YAAY;YAChC,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,QAAQ,EAAE,KAAK,CAAC,QAAQ;SACzB,CAAC,CAAC,CAAC;IACN,CAAC;IACD,KAAK,CAAC,UAAU;QACd,OAAO,MAAM,CAAC,eAAe,CAAC,QAAQ,CAAC;IACzC,CAAC;IACD,KAAK,CAAC,IAAI;QACR,OAAO,MAAM,CAAC,eAAe,CAAC,MAAM,EAAE,CAAC;IACzC,CAAC;IACD,KAAK,CAAC,KAAK;QACT,OAAO,MAAM,CAAC,eAAe,CAAC,KAAK,EAAE,CAAC;IACxC,CAAC;IACD,KAAK,CAAC,MAAM;QACV,OAAO,MAAM,CAAC,eAAe,CAAC,MAAM,EAAE,CAAC;IACzC,CAAC;IACD,oBAAoB,GAAG,uBAAuB,CAAC;CAChD;AAED,eAAe,iBAAiB,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC","sourcesContent":["import { CodedError, NativeModule, registerWebModule } from 'expo-modules-core';\n\nimport { SpeechOptions, WebVoice, VoiceQuality } from './Speech.types';\n\n//https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesisUtterance/text\nconst MAX_SPEECH_INPUT_LENGTH = 32767;\n\nasync function getVoices(): Promise<SpeechSynthesisVoice[]> {\n return new Promise<SpeechSynthesisVoice[]>((resolve) => {\n const voices = window.speechSynthesis.getVoices();\n\n if (voices.length > 0) {\n resolve(voices);\n return;\n }\n\n // when a page loads it takes some amount of time to populate the voices list\n // see https://stackoverflow.com/a/52005323/4337317\n window.speechSynthesis.onvoiceschanged = function () {\n const voices = window.speechSynthesis.getVoices();\n resolve(voices);\n };\n });\n}\n\ntype ExpoSpeechEvents = {\n 'Exponent.speakingStarted': (params: { id: string; nativeEvent: SpeechSynthesisEvent }) => void;\n 'Exponent.speakingDone': (params: { id: string; nativeEvent: SpeechSynthesisEvent }) => void;\n 'Exponent.speakingStopped': (params: { id: string; nativeEvent: SpeechSynthesisEvent }) => void;\n 'Exponent.speakingError': (params: { id: string; nativeEvent: SpeechSynthesisEvent }) => void;\n};\n\nclass ExpoSpeech extends NativeModule<ExpoSpeechEvents> {\n async speak(id: string, text: string, options: SpeechOptions): Promise<SpeechSynthesisUtterance> {\n if (text.length > MAX_SPEECH_INPUT_LENGTH) {\n throw new CodedError(\n 'ERR_SPEECH_INPUT_LENGTH',\n 'Speech input text is too long! Limit of input length is: ' + MAX_SPEECH_INPUT_LENGTH\n );\n }\n\n const message = new SpeechSynthesisUtterance();\n\n if (typeof options.rate === 'number') {\n message.rate = options.rate;\n }\n if (typeof options.pitch === 'number') {\n message.pitch = options.pitch;\n }\n if (typeof options.language === 'string') {\n message.lang = options.language;\n }\n if (typeof options.volume === 'number') {\n message.volume = options.volume;\n }\n if ('_voiceIndex' in options && options._voiceIndex != null) {\n const voices = await getVoices();\n message.voice = voices[Math.min(voices.length - 1, Math.max(0, options._voiceIndex))];\n }\n if (typeof options.voice === 'string') {\n const voices = await getVoices();\n message.voice =\n voices[\n Math.max(\n 0,\n voices.findIndex((voice) => voice.voiceURI === options.voice)\n )\n ];\n }\n if (typeof options.onResume === 'function') {\n message.onresume = options.onResume;\n }\n if (typeof options.onMark === 'function') {\n message.onmark = options.onMark;\n }\n if (typeof options.onBoundary === 'function') {\n message.onboundary = options.onBoundary;\n }\n\n message.onstart = (nativeEvent: SpeechSynthesisEvent) => {\n this.emit('Exponent.speakingStarted', { id, nativeEvent });\n };\n message.onend = (nativeEvent: SpeechSynthesisEvent) => {\n this.emit('Exponent.speakingDone', { id, nativeEvent });\n };\n message.onpause = (nativeEvent: SpeechSynthesisEvent) => {\n this.emit('Exponent.speakingStopped', { id, nativeEvent });\n };\n message.onerror = (nativeEvent: SpeechSynthesisErrorEvent) => {\n this.emit('Exponent.speakingError', { id, nativeEvent });\n };\n\n message.text = text;\n\n window.speechSynthesis.speak(message);\n\n return message;\n }\n async getVoices(): Promise<WebVoice[]> {\n const voices = await getVoices();\n return voices.map((voice) => ({\n identifier: voice.voiceURI,\n quality: VoiceQuality.Default,\n isDefault: voice.default,\n language: voice.lang,\n localService: voice.localService,\n name: voice.name,\n voiceURI: voice.voiceURI,\n }));\n }\n async isSpeaking(): Promise<boolean> {\n return window.speechSynthesis.speaking;\n }\n async stop(): Promise<void> {\n return window.speechSynthesis.cancel();\n }\n async pause(): Promise<void> {\n return window.speechSynthesis.pause();\n }\n async resume(): Promise<void> {\n return window.speechSynthesis.resume();\n }\n maxSpeechInputLength = MAX_SPEECH_INPUT_LENGTH;\n}\n\nexport default registerWebModule(ExpoSpeech, 'ExpoSpeech');\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Speech.js","sourceRoot":"","sources":["../src/Speech/Speech.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAsC,YAAY,EAAmB,MAAM,gBAAgB,CAAC;AAEnG,OAAO,EAAsC,YAAY,EAAmB,CAAC;AAE7E,MAAM,UAAU,GAAG,EAAE,CAAC;AACtB,IAAI,eAAe,GAAG,CAAC,CAAC;AACxB,IAAI,gBAAgB,GAAG,KAAK,CAAC;AAE7B,SAAS,4BAA4B;IACnC,IAAI,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE;QACxC,sBAAsB,CAAC,0BAA0B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,CAAC;AACrC,CAAC;AAED,cAAc;AACd;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,IAAI;IACxB,OAAO,cAAc,CAAC,IAAI,EAAE,CAAC;AAC/B,CAAC;AAED,cAAc;AACd;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,KAAK;IACzB,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE;QACzB,MAAM,IAAI,mBAAmB,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;KAClD;IACD,OAAO,cAAc,CAAC,KAAK,EAAE,CAAC;AAChC,CAAC;AAED,cAAc;AACd;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,MAAM;IAC1B,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE;QAC1B,MAAM,IAAI,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;KACnD;IAED,OAAO,cAAc,CAAC,MAAM,EAAE,CAAC;AACjC,CAAC;AAED,SAAS,mBAAmB,CAAC,SAAS,EAAE,QAAQ;IAC9C,MAAM,aAAa,GAAG,cAAc,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;IAC9D,IAAI,aAAa,GAAG,CAAC,EAAE;QACrB,cAAc,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAC;KAC9C;IACD,cAAc,CAAC,WAAW,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;AAClD,CAAC;AAED,SAAS,sBAAsB,CAAC,SAAS;IACvC,cAAc,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAC;AAC/C,CAAC;AAED,cAAc;AACd;;;GAGG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAW,cAAc,CAAC,oBAAoB,IAAI,MAAM,CAAC,SAAS,CAAC","sourcesContent":["import { UnavailabilityError } from 'expo-modules-core';\n\nimport ExponentSpeech from './ExponentSpeech';\nimport { SpeechOptions, SpeechEventCallback, VoiceQuality, Voice, WebVoice } from './Speech.types';\n\nexport { SpeechOptions, SpeechEventCallback, VoiceQuality, Voice, WebVoice };\n\nconst _CALLBACKS = {};\nlet _nextCallbackId = 1;\nlet _didSetListeners = false;\n\nfunction _unregisterListenersIfNeeded() {\n if (Object.keys(_CALLBACKS).length === 0) {\n removeSpeakingListener('Exponent.speakingStarted');\n removeSpeakingListener('Exponent.speakingWillSayNextString');\n removeSpeakingListener('Exponent.speakingDone');\n removeSpeakingListener('Exponent.speakingStopped');\n removeSpeakingListener('Exponent.speakingError');\n _didSetListeners = false;\n }\n}\n\nfunction _registerListenersIfNeeded() {\n if (_didSetListeners) return;\n _didSetListeners = true;\n setSpeakingListener('Exponent.speakingStarted', ({ id }) => {\n const options = _CALLBACKS[id];\n if (options && options.onStart) {\n options.onStart();\n }\n });\n setSpeakingListener('Exponent.speakingWillSayNextString', ({ id, charIndex, charLength }) => {\n const options = _CALLBACKS[id];\n if (options && options.onBoundary) {\n options.onBoundary({\n charIndex,\n charLength,\n });\n }\n });\n setSpeakingListener('Exponent.speakingDone', ({ id }) => {\n const options = _CALLBACKS[id];\n if (options && options.onDone) {\n options.onDone();\n }\n delete _CALLBACKS[id];\n _unregisterListenersIfNeeded();\n });\n setSpeakingListener('Exponent.speakingStopped', ({ id }) => {\n const options = _CALLBACKS[id];\n if (options && options.onStopped) {\n options.onStopped();\n }\n delete _CALLBACKS[id];\n _unregisterListenersIfNeeded();\n });\n setSpeakingListener('Exponent.speakingError', ({ id, error }) => {\n const options = _CALLBACKS[id];\n if (options && options.onError) {\n options.onError(new Error(error));\n }\n delete _CALLBACKS[id];\n _unregisterListenersIfNeeded();\n });\n}\n\n// @needsAudit\n/**\n * Speak out loud the text given options. Calling this when another text is being spoken adds\n * an utterance to queue.\n * @param text The text to be spoken. Cannot be longer than [`Speech.maxSpeechInputLength`](#speechmaxspeechinputlength).\n * @param options A `SpeechOptions` object.\n */\nexport function speak(text: string, options: SpeechOptions = {}) {\n const id = _nextCallbackId++;\n _CALLBACKS[id] = options;\n _registerListenersIfNeeded();\n ExponentSpeech.speak(String(id), text, options);\n}\n\n// @needsAudit\n/**\n * Returns list of all available voices.\n * @return List of `Voice` objects.\n */\nexport async function getAvailableVoicesAsync(): Promise<Voice[]> {\n if (!ExponentSpeech.getVoices) {\n throw new UnavailabilityError('Speech', 'getVoices');\n }\n return ExponentSpeech.getVoices();\n}\n\n//@needsAudit\n/**\n * Determine whether the Text-to-speech utility is currently speaking. Will return `true` if speaker\n * is paused.\n * @return Returns a Promise that fulfils with a boolean, `true` if speaking, `false` if not.\n */\nexport async function isSpeakingAsync(): Promise<boolean> {\n return ExponentSpeech.isSpeaking();\n}\n\n// @needsAudit\n/**\n * Interrupts current speech and deletes all in queue.\n */\nexport async function stop(): Promise<void> {\n return ExponentSpeech.stop();\n}\n\n// @needsAudit\n/**\n * Pauses current speech. This method is not available on Android.\n */\nexport async function pause(): Promise<void> {\n if (!ExponentSpeech.pause) {\n throw new UnavailabilityError('Speech', 'pause');\n }\n return ExponentSpeech.pause();\n}\n\n// @needsAudit\n/**\n * Resumes speaking previously paused speech or does nothing if there's none. This method is not\n * available on Android.\n */\nexport async function resume(): Promise<void> {\n if (!ExponentSpeech.resume) {\n throw new UnavailabilityError('Speech', 'resume');\n }\n\n return ExponentSpeech.resume();\n}\n\nfunction setSpeakingListener(eventName, callback) {\n const listenerCount = ExponentSpeech.listenerCount(eventName);\n if (listenerCount > 0) {\n ExponentSpeech.removeAllListeners(eventName);\n }\n ExponentSpeech.addListener(eventName, callback);\n}\n\nfunction removeSpeakingListener(eventName) {\n ExponentSpeech.removeAllListeners(eventName);\n}\n\n// @needsAudit\n/**\n * Maximum possible text length acceptable by `Speech.speak()` method. It is platform-dependent.\n * On iOS, this returns `Number.MAX_VALUE`.\n */\nexport const maxSpeechInputLength: number = ExponentSpeech.maxSpeechInputLength || Number.MAX_VALUE;\n"]}
1
+ {"version":3,"file":"Speech.js","sourceRoot":"","sources":["../src/Speech/Speech.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAEx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kBAAkB,CAAC,SAAS,CAAC,CAAC;IAC/C,CAAC;IACD,cAAc,CAAC,WAAW,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;AAClD,CAAC;AAED,SAAS,sBAAsB,CAAC,SAAS;IACvC,cAAc,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAC;AAC/C,CAAC;AAED,cAAc;AACd;;;GAGG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAW,cAAc,CAAC,oBAAoB,IAAI,MAAM,CAAC,SAAS,CAAC","sourcesContent":["import { UnavailabilityError } from 'expo-modules-core';\n\nimport ExponentSpeech from './ExponentSpeech';\nimport { SpeechOptions, SpeechEventCallback, VoiceQuality, Voice, WebVoice } from './Speech.types';\n\nexport { SpeechOptions, SpeechEventCallback, VoiceQuality, Voice, WebVoice };\n\nconst _CALLBACKS = {};\nlet _nextCallbackId = 1;\nlet _didSetListeners = false;\n\nfunction _unregisterListenersIfNeeded() {\n if (Object.keys(_CALLBACKS).length === 0) {\n removeSpeakingListener('Exponent.speakingStarted');\n removeSpeakingListener('Exponent.speakingWillSayNextString');\n removeSpeakingListener('Exponent.speakingDone');\n removeSpeakingListener('Exponent.speakingStopped');\n removeSpeakingListener('Exponent.speakingError');\n _didSetListeners = false;\n }\n}\n\nfunction _registerListenersIfNeeded() {\n if (_didSetListeners) return;\n _didSetListeners = true;\n setSpeakingListener('Exponent.speakingStarted', ({ id }) => {\n const options = _CALLBACKS[id];\n if (options && options.onStart) {\n options.onStart();\n }\n });\n setSpeakingListener('Exponent.speakingWillSayNextString', ({ id, charIndex, charLength }) => {\n const options = _CALLBACKS[id];\n if (options && options.onBoundary) {\n options.onBoundary({\n charIndex,\n charLength,\n });\n }\n });\n setSpeakingListener('Exponent.speakingDone', ({ id }) => {\n const options = _CALLBACKS[id];\n if (options && options.onDone) {\n options.onDone();\n }\n delete _CALLBACKS[id];\n _unregisterListenersIfNeeded();\n });\n setSpeakingListener('Exponent.speakingStopped', ({ id }) => {\n const options = _CALLBACKS[id];\n if (options && options.onStopped) {\n options.onStopped();\n }\n delete _CALLBACKS[id];\n _unregisterListenersIfNeeded();\n });\n setSpeakingListener('Exponent.speakingError', ({ id, error }) => {\n const options = _CALLBACKS[id];\n if (options && options.onError) {\n options.onError(new Error(error));\n }\n delete _CALLBACKS[id];\n _unregisterListenersIfNeeded();\n });\n}\n\n// @needsAudit\n/**\n * Speak out loud the text given options. Calling this when another text is being spoken adds\n * an utterance to queue.\n * @param text The text to be spoken. Cannot be longer than [`Speech.maxSpeechInputLength`](#speechmaxspeechinputlength).\n * @param options A `SpeechOptions` object.\n */\nexport function speak(text: string, options: SpeechOptions = {}) {\n const id = _nextCallbackId++;\n _CALLBACKS[id] = options;\n _registerListenersIfNeeded();\n ExponentSpeech.speak(String(id), text, options);\n}\n\n// @needsAudit\n/**\n * Returns list of all available voices.\n * @return List of `Voice` objects.\n */\nexport async function getAvailableVoicesAsync(): Promise<Voice[]> {\n if (!ExponentSpeech.getVoices) {\n throw new UnavailabilityError('Speech', 'getVoices');\n }\n return ExponentSpeech.getVoices();\n}\n\n//@needsAudit\n/**\n * Determine whether the Text-to-speech utility is currently speaking. Will return `true` if speaker\n * is paused.\n * @return Returns a Promise that fulfils with a boolean, `true` if speaking, `false` if not.\n */\nexport async function isSpeakingAsync(): Promise<boolean> {\n return ExponentSpeech.isSpeaking();\n}\n\n// @needsAudit\n/**\n * Interrupts current speech and deletes all in queue.\n */\nexport async function stop(): Promise<void> {\n return ExponentSpeech.stop();\n}\n\n// @needsAudit\n/**\n * Pauses current speech. This method is not available on Android.\n */\nexport async function pause(): Promise<void> {\n if (!ExponentSpeech.pause) {\n throw new UnavailabilityError('Speech', 'pause');\n }\n return ExponentSpeech.pause();\n}\n\n// @needsAudit\n/**\n * Resumes speaking previously paused speech or does nothing if there's none. This method is not\n * available on Android.\n */\nexport async function resume(): Promise<void> {\n if (!ExponentSpeech.resume) {\n throw new UnavailabilityError('Speech', 'resume');\n }\n\n return ExponentSpeech.resume();\n}\n\nfunction setSpeakingListener(eventName, callback) {\n const listenerCount = ExponentSpeech.listenerCount(eventName);\n if (listenerCount > 0) {\n ExponentSpeech.removeAllListeners(eventName);\n }\n ExponentSpeech.addListener(eventName, callback);\n}\n\nfunction removeSpeakingListener(eventName) {\n ExponentSpeech.removeAllListeners(eventName);\n}\n\n// @needsAudit\n/**\n * Maximum possible text length acceptable by `Speech.speak()` method. It is platform-dependent.\n * On iOS, this returns `Number.MAX_VALUE`.\n */\nexport const maxSpeechInputLength: number = ExponentSpeech.maxSpeechInputLength || Number.MAX_VALUE;\n"]}
@@ -8,7 +8,7 @@
8
8
  "publication": {
9
9
  "groupId": "host.exp.exponent",
10
10
  "artifactId": "expo.modules.speech",
11
- "version": "13.1.1",
11
+ "version": "13.1.3",
12
12
  "repository": "local-maven-repo"
13
13
  }
14
14
  }
@@ -3,7 +3,7 @@
3
3
  "component": {
4
4
  "group": "host.exp.exponent",
5
5
  "module": "expo.modules.speech",
6
- "version": "13.1.1",
6
+ "version": "13.1.3",
7
7
  "attributes": {
8
8
  "org.gradle.status": "release"
9
9
  }
@@ -24,8 +24,8 @@
24
24
  },
25
25
  "files": [
26
26
  {
27
- "name": "expo.modules.speech-13.1.1.aar",
28
- "url": "expo.modules.speech-13.1.1.aar",
27
+ "name": "expo.modules.speech-13.1.3.aar",
28
+ "url": "expo.modules.speech-13.1.3.aar",
29
29
  "size": 30104,
30
30
  "sha512": "031d8c3f613ba6be2d4b6909cb263e394de17577dedf9a95eee47dafbaeee9463519e512df381d4c3ef0fb59201285a1c6d6943f7625de598b671d9273f02f7d",
31
31
  "sha256": "91dc8a4689b3da6c077ed485fea90daae9372e5bdfd589e1ec3562ff3fe76cb6",
@@ -53,8 +53,8 @@
53
53
  ],
54
54
  "files": [
55
55
  {
56
- "name": "expo.modules.speech-13.1.1.aar",
57
- "url": "expo.modules.speech-13.1.1.aar",
56
+ "name": "expo.modules.speech-13.1.3.aar",
57
+ "url": "expo.modules.speech-13.1.3.aar",
58
58
  "size": 30104,
59
59
  "sha512": "031d8c3f613ba6be2d4b6909cb263e394de17577dedf9a95eee47dafbaeee9463519e512df381d4c3ef0fb59201285a1c6d6943f7625de598b671d9273f02f7d",
60
60
  "sha256": "91dc8a4689b3da6c077ed485fea90daae9372e5bdfd589e1ec3562ff3fe76cb6",
@@ -73,8 +73,8 @@
73
73
  },
74
74
  "files": [
75
75
  {
76
- "name": "expo.modules.speech-13.1.1-sources.jar",
77
- "url": "expo.modules.speech-13.1.1-sources.jar",
76
+ "name": "expo.modules.speech-13.1.3-sources.jar",
77
+ "url": "expo.modules.speech-13.1.3-sources.jar",
78
78
  "size": 4300,
79
79
  "sha512": "da96e3592bc8eadeee376508feca7da36b54f37d55eda3839bff8a57980635601764dee698324c698581cc01f707596e83a96f8f84b706f60446ca2f0922c3a3",
80
80
  "sha256": "3a9e571372d42a0a09f3f55e574aa7af6409aea92e4e69de91fc12ae256348f3",
@@ -0,0 +1 @@
1
+ c02dd1fae717a62eaa262c59ae02fb0e7809767c0b77133f391a4b77f5911ea2
@@ -0,0 +1 @@
1
+ e3a82da64415a2d6e43a283e4426eae256e8e29954fdca0ebc21e321fce3cd2cf95c301401c0fe766c801046452c62a84be12cc63e5c7d23da54a8ada62777f2
@@ -9,7 +9,7 @@
9
9
  <modelVersion>4.0.0</modelVersion>
10
10
  <groupId>host.exp.exponent</groupId>
11
11
  <artifactId>expo.modules.speech</artifactId>
12
- <version>13.1.1</version>
12
+ <version>13.1.3</version>
13
13
  <packaging>aar</packaging>
14
14
  <name>expo.modules.speech</name>
15
15
  <url>https://github.com/expo/expo</url>
@@ -0,0 +1 @@
1
+ 92c211f201e37ab47d796d8e00f1e9300307ac783a7008ae954a46b805e84576
@@ -0,0 +1 @@
1
+ 5e9968105f4066b70dc896af57ad6143bd361ac158d498cead54331fb494c447bf074c33933d9952b214d33af35d55a5f78309c2dba47aaecf8790e3f0ce0449
@@ -3,11 +3,11 @@
3
3
  <groupId>host.exp.exponent</groupId>
4
4
  <artifactId>expo.modules.speech</artifactId>
5
5
  <versioning>
6
- <latest>13.1.1</latest>
7
- <release>13.1.1</release>
6
+ <latest>13.1.3</latest>
7
+ <release>13.1.3</release>
8
8
  <versions>
9
- <version>13.1.1</version>
9
+ <version>13.1.3</version>
10
10
  </versions>
11
- <lastUpdated>20250408212901</lastUpdated>
11
+ <lastUpdated>20250411190920</lastUpdated>
12
12
  </versioning>
13
13
  </metadata>
@@ -1 +1 @@
1
- 9455a4fb0aceadb4a36a300db02cbe31
1
+ f26f85da0ccd6f22c925b78c47a69b85
@@ -1 +1 @@
1
- ca2f05e9ab99ea3abd5196f8e69f7bc6ece394e7
1
+ 21b892b48d76bc039af030ab58acae3a0a492d08
@@ -1 +1 @@
1
- bd18b804d145eba61a485a643dd0fc886ca0c23a29c37b15ea302c2179fd2d84
1
+ 255bf3434501f1a7d0d18a65b472b8c29556a984d0d74f8cfdda2ef2a5569e5e
@@ -1 +1 @@
1
- 690cb61c21d0453a69bc1c3d982398a7bc5857f9c539e7f2319ee4e237e8896321c9ba7e630d76be78f22e43ff2ea1ff9ddc5135ec6a8d88f52d28d08acb7977
1
+ bb75aac4870ba3e421996042a8d92a79c3d38fd6558a90a8e8fd136cfed4edb6b597c8f72bd305c02d63030373a93bc2b9c047b8b733c7668b8c3730e8bf56cd
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-speech",
3
- "version": "13.1.1",
3
+ "version": "13.1.3",
4
4
  "description": "Provides text-to-speech functionality.",
5
5
  "main": "build/Speech.js",
6
6
  "types": "build/Speech.d.ts",
@@ -37,10 +37,10 @@
37
37
  },
38
38
  "dependencies": {},
39
39
  "devDependencies": {
40
- "expo-module-scripts": "^4.1.0"
40
+ "expo-module-scripts": "^4.1.1"
41
41
  },
42
42
  "peerDependencies": {
43
43
  "expo": "*"
44
44
  },
45
- "gitHead": "2487c7aa9b5ef6a7052e82bbf9a53604c2ed273f"
45
+ "gitHead": "dd2c7150fd75c56505aa6d3f805c14e255649c5d"
46
46
  }
@@ -123,4 +123,4 @@ class ExpoSpeech extends NativeModule<ExpoSpeechEvents> {
123
123
  maxSpeechInputLength = MAX_SPEECH_INPUT_LENGTH;
124
124
  }
125
125
 
126
- export default registerWebModule(ExpoSpeech);
126
+ export default registerWebModule(ExpoSpeech, 'ExpoSpeech');
@@ -1 +0,0 @@
1
- ffcd818bd03800de93b357eb2fab30e5d08274361e9ae780967f62ac7c4ca594
@@ -1 +0,0 @@
1
- ee37536e563b9507365500b278a5e0e5c569015d65351f693826ab57d91c11c9e87ff7c963d9aa45e14fad48d54f9ac9d48fb20c292676c9eb071ed770b116cf
@@ -1 +0,0 @@
1
- 8d1d0707c345ce9a34cbd65ac4f8a04273987cac
@@ -1 +0,0 @@
1
- 68ddaa27ffeb2ec3785234112b4ab2bbc369f46af92d3ed29d850c738f351106
@@ -1 +0,0 @@
1
- 2c1b12fa88a7e227b19a5e3de63fcd65490a78afba60927fc7a08f3d25cf673806df86af77a3e0cb2c825e5e2973cec7e251d79bea2e6e71591ac6d084bec833