OST Read Aloud

外掛說明

OST Read Aloud adds a “Listen to this article” player to your posts. The audio is made once with Google Cloud Text-to-Speech and saved in your media uploads folder, so visitors never call Google and you are only charged when you generate audio.

While the audio plays, the word being read is highlighted, along with its paragraph, and the page scrolls gently to follow along.

Everything is set up from Settings Text to Speech. No code changes are needed.

Features

  • Connect with a Google API key or a service account JSON key.
  • “Test connection” and “Preview voice” buttons on the settings page.
  • Choose language, voice, speed, pitch and audio format (MP3 or WAV).
  • Choose which post types get audio, and whether the title is read first.
  • Generate audio from a panel in the block editor or a box in the classic editor, or automatically when a post is published or updated.
  • Long posts are split into small parts and made one part at a time, so there are no timeouts.
  • Word and paragraph highlighting that keeps your links and formatting intact.
  • Player above or below the post, or anywhere with the [ost_tts_player] shortcode.
  • Sticky player while listening, custom highlight colours, auto-scroll that pauses when the visitor scrolls.
  • Add the class ost-tts-skip to any block (Advanced Additional CSS class) to leave it out of the audio.

External service

This plugin sends post text to the Google Cloud Text-to-Speech API (texttospeech.googleapis.com) when an editor or administrator generates audio or a voice preview, or when automatic generation is turned on and a post is published or updated. When a service account is used, a sign-in token is requested from oauth2.googleapis.com. No data is sent to Google when visitors view or play audio.

Google charges per character after the free monthly allowance. See the Google Cloud Text-to-Speech pricing and the Google Cloud terms and Google privacy policy.

螢幕擷圖

安裝方式

  1. Upload and activate the plugin.
  2. In Google Cloud, enable the Cloud Text-to-Speech API and create an API key (restrict it to that API) or a service account key.
  3. Go to Settings Text to Speech, paste the key, save, and click Test connection.
  4. Pick a voice on the Voice tab and click Preview voice.
  5. Open a post, find the Text to Speech panel in the editor sidebar and click Generate audio.

Sites that prefer to keep the key out of the database can add define( 'OST_TTS_API_KEY', 'your-key' ); to wp-config.php.

常見問題集

Which voices can highlight words?

Word highlighting needs word timings (SSML marks). Voice families that do not return them, such as Chirp HD, Journey and Studio, are not listed. If a voice returns no timings, the audio still works and highlighting stays off.

I changed the post. Do I need to generate again?

Yes. The editor panel shows “out of date” when the post text or voice settings no longer match the audio. With automatic generation turned on, this happens in the background. If the page text and the audio do not match, the audio still plays but highlighting is switched off until you regenerate.

Where are the audio files stored?

In wp-content/uploads/ost-tts/. Files are removed when you delete the audio or delete the post.

What happens when I delete the plugin?

Settings and audio are kept, unless you tick “delete all generated audio files and settings” on the Advanced tab first.

使用者評論

這個外掛目前沒有任何使用者評論。

參與者及開發者

以下人員參與了開源軟體〈OST Read Aloud〉的開發相關工作。

參與者

將〈OST Read Aloud〉外掛本地化為台灣繁體中文版

對開發相關資訊感興趣?

任何人均可瀏覽程式碼、查看 SVN 存放庫,或透過 RSS 訂閱開發記錄。

變更記錄

1.0.0

  • First release.