@capacitor-community/text-to-speech 4.1.1 → 5.0.0

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.
@@ -68,14 +68,11 @@ import Capacitor
68
68
 
69
69
  // Adjust rate for a closer match to other platform.
70
70
  @objc private func adjustRate(_ rate: Float) -> Float {
71
- let baseRate = AVSpeechUtteranceDefaultSpeechRate
72
- if rate == 1 {
73
- return baseRate
74
- }
75
- if rate > baseRate {
76
- return baseRate + (rate * 0.025)
77
- }
78
- return rate / 2
71
+ let baseRate: Float = AVSpeechUtteranceDefaultSpeechRate
72
+ if (rate >= 1.0 ) {
73
+ return (0.1 * rate) + (baseRate - 0.1)
74
+ }
75
+ return rate * baseRate
79
76
  }
80
77
 
81
78
  @objc private func resolveCurrentCall() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capacitor-community/text-to-speech",
3
- "version": "4.1.1",
3
+ "version": "5.0.0",
4
4
  "description": "Capacitor plugin for synthesizing speech from text.",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",