discord-player-tts
TypeScript icon, indicating that this package has built-in type declarations

1.0.9 • Public • Published

Text-to-Speech Extractor

This is a custom extractor for discord-player that allows you to use Google's Text-to-Speech API to convert text into audio.

Installation

npm install discord-player-tts

Usage

const { Player } = require("discord-player");

const { TTSExtractor } = require("discord-player-tts");
// Or
import { TTSExtractor } from "discord-player-tts";

const player = new Player(client, {});

await player.extractors.register(TTSExtractor, { /* options */ });

To call it, you will need to use the tts protocol in your search query.

For example:

const query = "Never gonna give you up";

player.play(voiceChannel, `tts:${query}`);

Supported features

Feature Supported
Single tracks ❌*
Playlists
Search
Direct streaming
Can be used as a bridge
Can bridge to ...
Autoplay

* Only works with raw queries.

Options

Option Type Default Description
language string "en" The language to use for the TTS query.
slow boolean false Whether to use slower TTS speed.

Package Sidebar

Install

npm i discord-player-tts

Weekly Downloads

21

Version

1.0.9

License

MIT

Unpacked Size

21.4 kB

Total Files

8

Last publish

Collaborators

  • itsmaat