Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: speech rate behavior on iOS #134

Closed
dwassmer opened this issue Sep 11, 2024 · 1 comment · Fixed by #136
Closed

bug: speech rate behavior on iOS #134

dwassmer opened this issue Sep 11, 2024 · 1 comment · Fixed by #136
Labels
bug/fix Something isn't working needs: triage platform: ios iOS platform

Comments

@dwassmer
Copy link
Contributor

Plugin version:
4.1.0

Platform(s):
iOS

Current behavior:
Non linear behavior of speech rate on iOS.
Providing a range between 0.1-0.5 results in a slowly spoken text (half or smaller than default speech rate), where a value between 0.6 - 1.0 is always almost the same as the default speech rate. The jump in speed between 0.5 and 0.6 is considerably higher than between 0.6 to 0.7 for example.

With #36 speech rate is adjusted before assigning it to self.ttsUtterance?.rate. The following table shows (assuming AVSpeechUtteranceDefaultSpeechRate is 0.5) the plugin speed rate config compared to the utternace.rate

speed rate utternace.rate
0.1 0.05
0.2 0.1
0.3 0.15
0.4 0.2
0.5 0.25
0.6 0.515
0.7 0.5175
0.8 0.52
0.9 0.5225
1.0 0.5

May I do not get the whole picture on this, but on devices I have tested (iOS 15.7.9, iPadOS 16.3, iPadOS 17.6.1) this makes it very hard to set an appropriate speed rate. What if I need the utternace.rate to be around 0.4? Also actual speed at 0.9 is even higher than with 1.0.

Expected behavior:
More linear behavior when using values between 0 and 1.

Steps to reproduce:

  1. Pull https://github.com/robingenz/capacitor-plugin-demo/tree/main
  2. Install and run on iOS
  3. Announce text at different speed rates.

Related code:
#36

Other information:
Related bug: #34

Capacitor doctor:

💊   Capacitor Doctor  💊 

Latest Dependencies:

  @capacitor/cli: 6.1.2
  @capacitor/core: 6.1.2
  @capacitor/android: 6.1.2
  @capacitor/ios: 6.1.2

Installed Dependencies:

  @capacitor/android: 6.1.2
  @capacitor/cli: 6.1.2
  @capacitor/core: 6.1.2
  @capacitor/ios: 6.1.2

[success] Android looking great! 👌
[success] iOS looking great! 👌
@dwassmer dwassmer changed the title bug: speed rate behavior bug: speech rate behavior on iOS Sep 11, 2024
@robingenz
Copy link
Member

Yes, it's not perfect yet. Feel free to create a PR.

@robingenz robingenz added platform: ios iOS platform bug/fix Something isn't working labels Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/fix Something isn't working needs: triage platform: ios iOS platform
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants