TTS: Define a Text-To-Speech Engine

Description Usage Arguments Details Value Author(s) References See Also

View source: R/tts.R

Description

Define a text-to-speech engine that can convert text into audio.

Usage

1
2
3
4
5
6
7
8
9
TTS(read, speak, ...)
espeakTTS()
pollyTTS(voice="Matthew",
         engine=c("standard", "neural"),
         format=c("mp3", "ogg_vorbis", "pcm"),
         sampleRate="default",
         language=NULL,
         lexicons=NULL,
         docker=FALSE) 

Arguments

read

A function that reads text from a <dialogue> element. This function should return a character value that is in a format that the corresponding speak function can consume. This function should be able to handle SSML content, even if it is only to ignore it.

speak

A function that accepts the name of an infile containing text (or SMML) and the name of an outfile that the function should write to. This function is responsible for generating audio from the infile text and saving that audio in the outfile.

...

Other arguments passed to the TTS engine.

voice

The name of an Amazon Polly voice.

engine

The name of an Amazon Polly engine; either "standard" or "neural".

format

The format for the audio recording.

sampleRate

The sample rate for the audio recording. The default value depends on the choice of engine and format.

language

The language used for the audio recording (only some voices are multilingual).

lexicons

The lexicons (special pronunciations) used for the audio recording; a vector of filenames.

docker

A logical indicating whether to use Docker image for AWS CLI control of Polly (rather than local install of AWS CLI).

Details

The TTS function is for defining new TTS engines for recording the audio in a video. The espeakTTS and pollyTTS functions define TTS engines based on the espeak and Amazon Polly text-to-speech systems.

The pollyTTS engine assumes that the Amazon CLI has been installed and configured.

Value

An object of class DirectorTTS.

Author(s)

Paul Murrell

References

espeak http://espeak.sourceforge.net/. Amazon Polly https://aws.amazon.com/polly/.

See Also

shootVideo


pmur002/director documentation built on Feb. 18, 2021, 10:23 p.m.