Multiple default voices

Created on 19 March 2025, about 2 months ago

Problem/Motivation

At the SpeakEasy settings page (/admin/config/speakeasy) you have the opportunity to paste in one voice, for one browser in the Default Voice Name field.

Choosing default voices/a default voice per browser would be better, as different browsers provide wildly different voices.

Proposed resolution

At the moment, we find voice names by tapping F12 and copying the desired option value from the SpeakEasy-dropdown on the page about to be read aloud, and paste the name into the text field at /admin/config/speakeasy. Hard work for newbies.

Using JS to get the available voices and setting default voices would be a friendlier approach.

Pasting this into your browser's console (tested with Edge, Chrome and Firefox) should give you a list of the voices available in the browser:

function listVoices() {
  setTimeout(() => {
    const voices = speechSynthesis.getVoices();
    if (voices.length === 0) {
      console.log("No voices available. Try running this again after a few seconds.");
    } else {
      console.table(voices.map(v => ({
        Name: v.name,
        Language: v.lang,
        Default: v.default
      })));
    }
  }, 500);
}

listVoices();
speechSynthesis.onvoiceschanged = listVoices;

The SpeakEasy module could, using /modules/contrib/speakeasy/js/speakeasy.js, hoover up all the voices it can find (in different browsers), and the Default Voice Name field could be turned into a comma separated autocomplete field, where you could type in your default voices.

I'd probably store the unique voice names in a variable, but YMMV.

Remaining tasks

Decide if it's worth it. A session with ChatGPT or Claude. Have them do the work.

✨ Feature request
Status

Active

Version

1.0

Component

User interface

Created by

πŸ‡©πŸ‡°Denmark Steven Snedker

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024