Add new "On Demand Mode" for Text to Speech processing#1125
Open
dkotter wants to merge 8 commits into
Open
Conversation
…ore clear what mode we're in and what will actually happen. If on-demand is the mode, keep the toggle on by default but allow it to be toggled off to disable for that specific post
… to a failing nonce check
…ff or generation turned off
✅ WordPress Plugin Check Report
📊 ReportAll checks passed! No errors or warnings found. 🤖 Generated by WordPress Plugin Check Action • Learn more about Plugin Check |
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of the Change
When the Text to Speech Feature is turned on, there are two "modes" currently: generate speech automatically when content is saved or require generation to be manually turned on at the post level first (so kind of automatic vs manual though both fire on save, there isn't an actual manual button you can press).
This PR introduces a new mode: on-demand. The idea here is to avoid generating speech for posts that no one is going to listen to (and thus costing you more for no reason). As a good example, if you have a large backlog of content that doesn't yet have speech generated, instead of generating speech for all of that upfront, you can generate it on-demand as a user requests it.
With this new mode turned on, the audio controls will show on the front-end and the first time a user clicks to listen, it will make a request to generate the audio first. After it's generated once, that audio is stored and re-used for any subsequent requests so unless the content changes, audio is only generated on-demand once.
Couple things to keep in mind:
Screenshot and screenshare
on-demand-tts.1.mov
How to test the Change
npm i && npm run buildChangelog Entry
Credits
Props @dkotter
Checklist: