stack-chan

Using Text To Speech(TTS)

日本語

Currently there are two way to use TTS.

Local(On demand) TTS such as aquestalk is not available for now pull requests are welcome!

Prerequisites

No matter which way you choose, you should prepare an extrenal TTS engine first.

Tested below:

See also official documents of each of them.

Google Cloud TTS

Coqui AI TTS

$ tts-server --port 8080 --model_name tts_models/ja/kokoro/tacotron2-DDC
{
    "config": {
        "tts": {
            "host": "your.tts.host.local",
            "port": 8080
        }
    }
}

ElevenLabs TTS

Usage(Pregenerated)

// speeches.js
export const speeches = {
  niceToMeetYou: 'Hello. I am Stach-chan. Nice to meet you.',
  hello: 'Hello World.',
  konnichiwa: 'Konnichiwa.',
  nihao: 'Nee hao.',
}
import { speeches } from 'speeches'
const keys = Object.keys(speeches)

export async function onRobotCreated(robot) {
  await robot.say('hello')
  await robot.say(keys[0] /* 'niceToMeetYou' */)
}

Usage(Remote)

{
    "config": {
        "tts": {
            "type": "remote",
            "host": "your.tts.host.local",
            "port": 8080
        }
    }
}
// ...
export async function onRobotCreated(robot) {
  await robot.say('Now I can speak any sentense you want.')
}