read-aloud icon indicating copy to clipboard operation
read-aloud copied to clipboard

Piper voices changing speed also changes pitch

Open MendyBerger opened this issue 3 months ago • 9 comments

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!

MendyBerger avatar Apr 05 '24 11:04 MendyBerger

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!

ken107 avatar Apr 06 '24 02:04 ken107

Thanks so much @ken107! Really appreciate it!

Just curious, why is that a separate extension?

MendyBerger avatar Apr 07 '24 01:04 MendyBerger

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.

ken107 avatar Apr 07 '24 02:04 ken107

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

MendyBerger avatar Apr 07 '24 18:04 MendyBerger

They share the code, so the fix fixes both.

ken107 avatar Apr 07 '24 19:04 ken107

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.

ken107 avatar Apr 08 '24 10:04 ken107

@ken107 when can we expect to get this update ?

AvAkanksh avatar Apr 16 '24 13:04 AvAkanksh

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

ken107 avatar Apr 16 '24 13:04 ken107