| get_synthesis | R Documentation |
Pass text to the synthesis API and return an audio file
get_synthesis(
text,
voice,
format = c("mp3", "ogg_vorbis", "pcm"),
rate = deprecated(),
lexicon = deprecated(),
ssml = FALSE,
lexicon_names = NULL,
sample_rate = NULL,
engine = c("standard", "neural"),
language = NULL,
...
)
synthesize(text, voice, ...)
text |
Either a plain text character string (maximum 1500 characters) or
a character string containing SSML ( |
voice |
Name of an AWS Polly voice. See |
format |
Output file format: one of ''mp3'‘ (default), '’ogg_vorbis'' or ''pcm''. |
rate |
Deprecated. Use |
lexicon |
Deprecated. Use |
ssml |
A logical indicating whether |
lexicon_names |
Optional character vector (max length 5) specifying the
names of lexicons to apply during synthesis. See |
sample_rate |
Audio frequency in Hertz. One of '24000', '22050', '16000' or '8000'. If 'NULL' (default), 'AWS' will pick an appropriate value depending on the voice, engine and output format. |
engine |
Engine type: either ''standard'‘ (default) or '’neural''.
Not all voices support the neural engine, see |
language |
Optional language code. This is useful for bilingual voices. |
... |
Additional arguments passed to |
get_synthesis returns a raw vector (i.e., the bytes
representing the audio as the requested file format). synthesize is
a convenience wrapper around that, which returns an object of class
“Wave” (see Wave).
## Not run:
hello <- synthesize("hello world!", voice = "Geraint")
if (interactive() & require("tuneR")) {
try(play(hello))
}
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.