ken107 / read-aloud

An awesome browser extension that reads aloud webpage content with one click
https://readaloud.app
MIT License
1.36k stars 233 forks source link

Piper voices changing speed also changes pitch #383

Open MendyBerger opened 6 months ago

MendyBerger commented 6 months ago

Hey :wave:, thanks for this amazing extension! I love it!!!

Piper voices were added recently, the voices are great, and it works really well with ReadAloud!

One problem I did notice is that changing speed changes the pitch by a lot. Is this a fixable problem?

Thanks again for the amazing work!

ken107 commented 6 months ago

I have made the fix in the https://github.com/ken107/piper-browser-extension repo, it will be released soon. Thank you for the bug report!

MendyBerger commented 5 months ago

Thanks so much @ken107! Really appreciate it!

Just curious, why is that a separate extension?

ken107 commented 5 months ago

Ah, Read Aloud actually opens https://piper.ttstool.com and use that tool to synthesize Piper voices. The code for that page is in the repository above. And that repository releases a separate extension to provide Piper voices, not for Read Aloud, but generally for the browser and can be used by other websites and extensions. Yea, it's complicated.

MendyBerger commented 5 months ago

@ken107 I see. So does that mean that the fix will eventually trickle down to ReadAloud?

ken107 commented 5 months ago

They share the code, so the fix fixes both.

ken107 commented 5 months ago

Unfortunately I have to revert the change. We'll have to figure this out later.

The change worked by switching to using HTMLAudioElement instead of the Web Audio API to playback the synthesized speech. Unlike the latter, changing playbackRate on HTMLAudioElement does not affect pitch. However, turns out HTMLAudioElement suffers from a restriction where playback cannot begin unless the tab is active.

AvAkanksh commented 5 months ago

@ken107 when can we expect to get this update ?

ken107 commented 5 months ago

Not soon, sorry. I've exceeded my time allocation for this project for now.

SomeAB commented 3 months ago
  1. Looking forward to the addition of Pitch & Speed support for Piper voices

  2. I wish there were more offline options as well .. whether Piper or other.. but the current offline ones are pretty bad.