powered by
Pass text to the synthesis API and return an audio file
get_synthesis( text, voice, format = c("mp3", "ogg_vorbis", "pcm"), rate = c(22050, 16000, 8000), lexicon = NULL, ssml = FALSE, ... )synthesize(text, voice, ...)
synthesize(text, voice, ...)
Either a plain text character string (maximum 1500 characters) or a character string containing SSML (ssml should be set to TRUE).
ssml
TRUE
A character string specifying the name of an AWS Polly voice. See list_voices.
list_voices
A character string specifying an output file format.
An integer value specifying the audio frequency in Hertz.
Optionally, a character vector (max length 5) specifying the names of lexicons to apply during synthesis. See get_lexicon.
get_lexicon
A logical indicating whether text contains SSML markup.
text
Additional arguments passed to pollyHTTP.
pollyHTTP
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).
get_synthesis
synthesize
Wave
# NOT RUN { hello <- synthesize("hello world!", voice = "Geraint") if (interactive() & require("tuneR")) { try(play(hello)) } # }
Run the code above in your browser using DataLab