adrianlyjak / obsidian-aloud-tts

MIT License
12 stars 1 forks source link

Change playback rate with web-audio API rather than OpenAI parameter #29

Open adrianlyjak opened 4 weeks ago

adrianlyjak commented 4 weeks ago

See https://github.com/adrianlyjak/obsidian-aloud-tts/issues/28 for original context

OpenAI has a speed option in their API that the plug-in is using. This was just the most straightforward option to implement the feature. I haven't been impressed with the quality of the non-1x audio though. It seems like its lower quality? There's a playbackRate parameter in web audio that this could use (example), however it ends up changing the pitch of the audio as well, so there'd be more involved here than just tuning that parameter. Perhaps the detune parameter could counter-balance the pitch change.

adrianlyjak commented 3 weeks ago

Looks like this is a rabbit hole. Might be able to achieve simply it by bringing in tone.js as a dependency. (stack overflow)