Reinvent WP
BlogText to Speech

Text to Speech Highlight for React and Next.js

Add a text to speech player that highlights sentences and words as they are being spoken in React and Next.js apps. Works with any TTS API like OpenAI, ElevenLabs, ReinventWP Cloud, etc.

Text to Speech DashboardNPM Package
Try the code generatorJS version

Highlight preview

Give every reader another way to follow your story. Keep each word in focus.

Explore highlighting

Try it on your website

Get a public site key and 40,000 hosted characters for 14 days.
No card required.

Paste a domain or full website URL.

Why add audio to your website?

Give every visitor a simple choice: read your content or listen to it.

Reach more people

Some visitors find long articles difficult to read. Audio gives them a simpler way to enjoy your content.

See the fact

W3C technique

W3C recognizes a spoken version as one way to make difficult written content more accessible.

See W3C guidance

Boost dwell time and SEO

Visitors who listen stay 2-3x longer than those who skim. Audio holds attention through the full article, extending time on page and improving the engagement signals search engines value.

See the fact

9:31 vs 3:51

One publisher saw audio listeners spend 9 minutes 31 seconds on site, compared with 3 minutes 51 seconds for readers.

Read the publisher story

Let them listen anywhere

People can follow your posts while commuting, exercising, cooking, or doing anything away from a screen.

See the fact

131 million daily

Edison Research estimates that 131 million people in the U.S. listen to spoken-word audio every day.

See the audience report

Reduce bounce rate

Visitors who press play are far less likely to leave. Natural AI voices keep them through the full article, while robotic-sounding tools cause people to bounce within seconds.

See the fact

Listeners stayed longer

The publisher reported that audio listeners spent much longer on the site—a useful sign that people were not leaving immediately.

Read the publisher story

Built for React, Next.js

A light component, simple configuration

React component API

Mount the player beside an article ref instead of manually scanning the DOM.

Next.js friendly

Start with browser speech, or provide a resolver that calls your own API route.

Your choice of audio

Connect to industry leading text to speech providers, or start with browser speech.
OpenAI
OpenAI

Any provider

Configure without guesswork

Generate a real code snippet from our config editor and paste it into the website.

Try it on your website

Get a public site key and 40,000 hosted characters for 14 days.
No card required.

Paste a domain or full website URL.

Install. Connect. Start listening.

One package, a public site key, and an article ref. Start with browser speech before adding hosted audio.

  1. Install the package

    Add @reinventwp/text-to-speech to your app.

  2. Choose a plan

    Buy a plan from the pricing section, then open the Text to Speech dashboard.

  3. Connect your website

    Create a project, add your domain, and copy the public site key.

  4. Attach your article

    Create an articleRef, pass it with your publicKey to ReinventTTS, and attach the ref to your article element.

Generate my code

Install the package

npm install @reinventwp/text-to-speech

Simple React component

TypeScript

"use client";

import ReinventTTS from "@reinventwp/text-to-speech";
import { useRef } from "react";

/**
 * Generate public config visually with our config editor: 
 * https://reinventwp.com/text-to-speech/npm#code-generator
 */
const pluginConfig = {
  audio_source: "browser",
  read_title: true
};

// Get public key on https://reinventwp.com/dashboard/text-to-speech
const publicKey = "rwp_public_xxx";

export default function ArticlePage() {
  const articleRef = useRef<HTMLElement | null>(null);

  return (
    <>
      <ReinventTTS
        target={articleRef}
        publicKey={publicKey}
        pluginConfig={pluginConfig}
      />
      <article ref={articleRef}>...</article>
    </>
  );
}

Your settings. Your React code.

Adjust the settings, preview the player, then switch to Code to copy a TypeScript component for your app.

Your player

Designing a calmer publishing workflow

Audio versions help readers keep moving through a story while they cook, commute, or rest their eyes between tasks.

Go to the Text To Speech dashboard to get the public key. You must insert a valid public key to use the tts player.

Plugin config:

Read section

Which sections of your page will be read?

Altering Text

Edit text before sending it to the TTS API. The text will processed with the following sequence steps:

Exclude HTML Selectors

script
style
noscript
code
pre

Enter HTML selectors, then press Enter to add. You can also paste comma or space-separated values.

Exclude Texts

Enter text or words to exclude, then press Enter to add

Global Text Spoken Form

Example: Displayed = WP → Spoken form = WeePee

Case Sensitive

Spoken Prefix

Automatically say a short phrase before matched content such as image captions.

Caption Spoken Prefix Rules

Example: selectors = figcaption, prefix = Image showcasing

No spoken prefix rules yet. Add one to automatically say something like Image showcasing before matched caption text.

Try it on your website

Get a public site key and 40,000 hosted characters for 14 days.
No card required.

Paste a domain or full website URL.

Join our community.

Ask questions, share implementation issues, and help shape the next Text to Speech examples.

Join TelegramJoin Discord

Need a custom solution?

Running a high-traffic website or planning an enterprise integration? We can help you fit the technology to your application.

Discuss your project

reinventwp@gmail.com