Demo — Text to Speech

Listen to this article 2 min

Adds a “Listen to this article” player to a post. As the audio plays, each word lights up on the page in time with the voice. It is the strongest of the eight to demo to a client.

See it working

There is no shortcode — audio is generated per post, and on this site the player is switched on for Posts only. Open the demo post and press play:

Demo Alpha — post with generated audio

Watch for three things: the words highlighting in time with the voice, the page scrolling itself to follow along, and the bar re-appearing pinned to the bottom-right once you scroll past it.

This one costs money

It needs a Google Cloud project with the Cloud Text-to-Speech API enabled and billing turned on. Google charges per character.

Audio is generated once and saved to the site’s media folder. Visitors play that file and never reach Google, so the client is charged when someone presses Generate in wp-admin, not when visitors listen. The editor panel shows the character count before you generate, so the cost is always visible up front.

Setting it up

Settings are at Settings → Text to Speech, across five tabs: Connection, Voice, Content, Player, Advanced. On Connection you paste an API key or a service account JSON and press Test connection, which reports how many usable voices it found.

Never enter a client’s Google credentials yourself — send them the steps and have them paste the key in.

Day to day

Open a post, find the Text to Speech panel in the sidebar, press Generate audio. Once it finishes the panel offers Regenerate and Delete instead. Edit the post later and you regenerate to match. A toggle in the same panel turns the player off for one post.

One limitation to flag early

Not every Google voice supports word highlighting. Studio, Journey, Chirp and a few other families cannot return word timings, so the plugin hides them from the voice list. Standard, WaveNet, Neural2 and News voices all work — several hundred to choose from.