Extension Icon

Say - Text to Speech

Use the built-in text-to-speech engine to say the text you provide.
AvatarLitoMore
1,932 Installs
Overview

Say - Text to Speech

This extension uses the system built-in text-to-speech engine on macOS and Windows to say the text you provide. No network connection is needed.

raycast-cross-extension-badge

Features

  • Type to Say - Quick type your text and say
  • Text to Say - Input your text or paragraph and say
  • Selected Text to Say - Say the selected text on any application
  • Stop Running Say - Stop the current running Say process
  • Configure Say - Configure the voice, rate, and output device

Configurations

Currently, the Configure Say command we provided does not alter your system settings. You can go to macOS System Settings or Windows Settings to download new voices and get more advanced configurations.

On macOS, see https://support.apple.com/en-us/guide/mac-help/spch638/mac. On Windows, open Windows Settings -> Time & language -> Speech.

Recommended Voices on macOS

Siri is the closest thing to a real human voice. You can go to System Settings -> Accessibility -> Live Speech. Pick your favorite Siri voice for the best experience.

API

With this extension, users can use this extension's configuration page for more settings within Raycast.

Use raycast-cross-extension

This is the most recommended way, raycast-cross-extension will verify the crossExtensions field in the package.json. This helps your upstream extension provider to get to know who is using their extension. For more details, see Raycast Cross Extension Conventsions.

import { crossLaunchCommand } from "raycast-cross-extension";

crossLaunchCommand({
  name: "typeToSay",
  type: LaunchType.Background,
  extensionName: "say",
  ownerOrAuthorName: "litomore",
  arguments: {
    content: "Hello, world!",
  },
  context: {
    sayOptions: {
      voice: "Cellos",
    },
  },
});

Use launchCommand

import { launchCommand } from "@raycast/api";

launchCommand({
  name: "typeToSay",
  type: LaunchType.Background,
  extensionName: "say",
  ownerOrAuthorName: "litomore",
  arguments: {
    content: "Hello, world!",
  },
  context: {
    sayOptions: {
      voice: "Cellos",
    },
  },
});

Use Deeplinks

arguments=$(jq -rR @uri <<< '{"content":"Hello from Deeplinks!"}')
launchContext=$(jq -rR @uri <<< '{"sayOptions":{"voice":"Cello"}}')
deeplink="raycast://extensions/litomore/say/typeToSay?launchType=background&arguments=$arguments&launchContext=$launchContext"
open $deeplink

Use mac-say or @litomore/win-say

Get them from https://github.com/LitoMore/mac-say and https://github.com/LitoMore/win-say.

They provide JavaScript interfaces for the built-in text-to-speech engines on macOS and Windows. You can use them if you want some advanced API usage.

FAQ

1. How to stop a speaking agent?

You could type a space or any other new contents to the Type to Say command to abort current speaking agent.

2. Some voices can be found in system settings but not listed in the Configure Say command

Yes. Not all voices are listed in the Configure Say command, because it's limited by the OS. But you can choose those voices from system settings.

License

MIT