R/list_voices.R

Defines functions list_voices

Documented in list_voices

#' @title List available voices
#' @description Retrieve a list of available voices
#' @param language An ISO 3166 country identification tag.
#' @param token Optionally, a pagination token.
#' @param \dots Additional arguments passed to \code{\link{pollyHTTP}}.
#' @return A data frame of available names.
#' @examples
#' \dontrun{
#' list_voices(language = "cy-GB")
#' }
#' @export
list_voices <- 
function(language = "en-US",
         token,
         ...)
{
    query <- list(LanguageCode = language)
    if (!missing(token)) {
        query[["NextToken"]] <- token
    }
    out <- pollyHTTP(action = "voices", verb = "GET", query = query, ...)
    structure(out[["Voices"]], NextToken = out[["NextToken"]])
}

Try the aws.polly package in your browser

Any scripts or data that you put into this service are public.

aws.polly documentation built on April 14, 2020, 7:37 p.m.