-
Notifications
You must be signed in to change notification settings - Fork 52
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
Support the Text-to-Speech feature in the Classic Editor #518
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR @dkotter, This looks great. Just added one minor note to discuss otherwise all LGTM!
Thanks
</p> | ||
|
||
<?php | ||
if ( $audio_id && wp_get_attachment_url( $audio_id ) ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I debated on this as I'm not sure for a UX perspective it's clear that unchecking this option should also remove the previously generated audio. But that is how we do it right now in the Block Editor so in order to try and keep parity between the two, I've updated this.
Probably worth a follow up at some point to make it more clear in both the Block and Classic Editor that unchecking this box not only won't generate audio anymore but also removes the display of any previously generated audio
…ndle this in the block editor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
Description of the Change
In #403 we introduced a feature that can convert your content into speech using the Microsoft Azure's Text to Speech API. This only worked in the Block Editor so this PR brings the same feature over to the Classic Editor.
There's a new meta box that shows in the Classic Editor that allows you to toggle audio generation on or off:
The text here mirrors what we show in the Block Editor. If this toggle is turned on, when the item is saved, we will generate an audio file for this item and connect the two.
We then show an audio preview in the same meta box:
Behind the scenes we use the same meta keys as are used in the Block Editor so things should all function the same. For example, if the toggle is turned off, we don't render the audio element on the front-end.
Closes #499
How to test the Change
Changelog Entry
Credits
Props @dkotter
Checklist: