AWSSDK.Polly
Amazon Polly is a web service that makes it easy to synthesize speech from text.
The Amazon Polly service provides API operations for synthesizing high-quality speech from plain text and Speech Synthesis Markup Language (SSML), along with managing pronunciations lexicons that enable you to get the best results for your application domain.
This document is generated from apis/polly-2016-06-10.normal.json. See JuliaCloud/AWSCore.jl.
AWSSDK.Polly.delete_lexicon
AWSSDK.Polly.describe_voices
AWSSDK.Polly.get_lexicon
AWSSDK.Polly.list_lexicons
AWSSDK.Polly.put_lexicon
AWSSDK.Polly.synthesize_speech
AWSSDK.Polly.delete_lexicon
— Function.using AWSSDK.Polly.delete_lexicon
delete_lexicon([::AWSConfig], arguments::Dict)
delete_lexicon([::AWSConfig]; LexiconName=)
using AWSCore.Services.polly
polly([::AWSConfig], "DELETE", "/v1/lexicons/{LexiconName}", arguments::Dict)
polly([::AWSConfig], "DELETE", "/v1/lexicons/{LexiconName}", LexiconName=)
DeleteLexicon Operation
Deletes the specified pronunciation lexicon stored in an AWS Region. A lexicon which has been deleted is not available for speech synthesis, nor is it possible to retrieve it using either the GetLexicon
or ListLexicon
APIs.
For more information, see Managing Lexicons.
Arguments
LexiconName = ::String
– Required
The name of the lexicon to delete. Must be an existing lexicon in the region.
Returns
DeleteLexiconOutput
Exceptions
LexiconNotFoundException
or ServiceFailureException
.
Example: To delete a lexicon
Deletes a specified pronunciation lexicon stored in an AWS Region.
Input:
[
"Name" => "example"
]
Output:
Dict(
)
See also: AWS API Documentation
AWSSDK.Polly.describe_voices
— Function.using AWSSDK.Polly.describe_voices
describe_voices([::AWSConfig], arguments::Dict)
describe_voices([::AWSConfig]; <keyword arguments>)
using AWSCore.Services.polly
polly([::AWSConfig], "GET", "/v1/voices", arguments::Dict)
polly([::AWSConfig], "GET", "/v1/voices", <keyword arguments>)
DescribeVoices Operation
Returns the list of voices that are available for use when requesting speech synthesis. Each voice speaks a specified language, is either male or female, and is identified by an ID, which is the ASCII version of the voice name.
When synthesizing speech ( SynthesizeSpeech
), you provide the voice ID for the voice you want from the list of voices returned by DescribeVoices
.
For example, you want your news reader application to read news in a specific language, but giving a user the option to choose the voice. Using the DescribeVoices
operation you can provide the user with a list of available voices to select from.
You can optionally specify a language code to filter the available voices. For example, if you specify en-US
, the operation returns a list of all available US English voices.
This operation requires permissions to perform the polly:DescribeVoices
action.
Arguments
LanguageCode = "cy-GB", "da-DK", "de-DE", "en-AU", "en-GB", "en-GB-WLS", "en-IN", "en-US", "es-ES", "es-US", "fr-CA", "fr-FR", "is-IS", "it-IT", "ja-JP", "nb-NO", "nl-NL", "pl-PL", "pt-BR", "pt-PT", "ro-RO", "ru-RU", "sv-SE" or "tr-TR"
The language identification tag (ISO 639 code for the language name-ISO 3166 country code) for filtering the list of voices returned. If you don't specify this optional parameter, all available voices are returned.
NextToken = ::String
An opaque pagination token returned from the previous DescribeVoices
operation. If present, this indicates where to continue the listing.
Returns
DescribeVoicesOutput
Exceptions
InvalidNextTokenException
or ServiceFailureException
.
Example: To describe available voices
Returns the list of voices that are available for use when requesting speech synthesis. Displayed languages are those within the specified language code. If no language code is specified, voices for all available languages are displayed.
Input:
[
"LanguageCode" => "en-GB"
]
Output:
Dict(
"Voices" => [
Dict(
"Gender" => "Female",
"Id" => "Emma",
"LanguageCode" => "en-GB",
"LanguageName" => "British English",
"Name" => "Emma"
),
Dict(
"Gender" => "Male",
"Id" => "Brian",
"LanguageCode" => "en-GB",
"LanguageName" => "British English",
"Name" => "Brian"
),
Dict(
"Gender" => "Female",
"Id" => "Amy",
"LanguageCode" => "en-GB",
"LanguageName" => "British English",
"Name" => "Amy"
)
]
)
See also: AWS API Documentation
AWSSDK.Polly.get_lexicon
— Function.using AWSSDK.Polly.get_lexicon
get_lexicon([::AWSConfig], arguments::Dict)
get_lexicon([::AWSConfig]; LexiconName=)
using AWSCore.Services.polly
polly([::AWSConfig], "GET", "/v1/lexicons/{LexiconName}", arguments::Dict)
polly([::AWSConfig], "GET", "/v1/lexicons/{LexiconName}", LexiconName=)
GetLexicon Operation
Returns the content of the specified pronunciation lexicon stored in an AWS Region. For more information, see Managing Lexicons.
Arguments
LexiconName = ::String
– Required
Name of the lexicon.
Returns
GetLexiconOutput
Exceptions
LexiconNotFoundException
or ServiceFailureException
.
Example: To retrieve a lexicon
Returns the content of the specified pronunciation lexicon stored in an AWS Region.
Input:
[
"Name" => ""
]
Output:
Dict(
"Lexicon" => Dict(
"Content" => "<?xml version="1.0" encoding="UTF-8"?>
<lexicon version="1.0"
xmlns="http://www.w3.org/2005/01/pronunciation-lexicon"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.w3.org/2005/01/pronunciation-lexicon
http://www.w3.org/TR/2007/CR-pronunciation-lexicon-20071212/pls.xsd"
alphabet="ipa"
xml:lang="en-US">
<lexeme>
<grapheme>W3C</grapheme>
<alias>World Wide Web Consortium</alias>
</lexeme>
</lexicon>",
"Name" => "example"
),
"LexiconAttributes" => Dict(
"Alphabet" => "ipa",
"LanguageCode" => "en-US",
"LastModified" => 1.478542980117e9,
"LexemesCount" => 1,
"LexiconArn" => "arn:aws:polly:us-east-1:123456789012:lexicon/example",
"Size" => 503
)
)
See also: AWS API Documentation
AWSSDK.Polly.list_lexicons
— Function.using AWSSDK.Polly.list_lexicons
list_lexicons([::AWSConfig], arguments::Dict)
list_lexicons([::AWSConfig]; <keyword arguments>)
using AWSCore.Services.polly
polly([::AWSConfig], "GET", "/v1/lexicons", arguments::Dict)
polly([::AWSConfig], "GET", "/v1/lexicons", <keyword arguments>)
ListLexicons Operation
Returns a list of pronunciation lexicons stored in an AWS Region. For more information, see Managing Lexicons.
Arguments
NextToken = ::String
An opaque pagination token returned from previous ListLexicons
operation. If present, indicates where to continue the list of lexicons.
Returns
ListLexiconsOutput
Exceptions
InvalidNextTokenException
or ServiceFailureException
.
Example: To list all lexicons in a region
Returns a list of pronunciation lexicons stored in an AWS Region.
Input:
[
]
Output:
Dict(
"Lexicons" => [
Dict(
"Attributes" => Dict(
"Alphabet" => "ipa",
"LanguageCode" => "en-US",
"LastModified" => 1.478542980117e9,
"LexemesCount" => 1,
"LexiconArn" => "arn:aws:polly:us-east-1:123456789012:lexicon/example",
"Size" => 503
),
"Name" => "example"
)
]
)
See also: AWS API Documentation
AWSSDK.Polly.put_lexicon
— Function.using AWSSDK.Polly.put_lexicon
put_lexicon([::AWSConfig], arguments::Dict)
put_lexicon([::AWSConfig]; LexiconName=, Content=)
using AWSCore.Services.polly
polly([::AWSConfig], "PUT", "/v1/lexicons/{LexiconName}", arguments::Dict)
polly([::AWSConfig], "PUT", "/v1/lexicons/{LexiconName}", LexiconName=, Content=)
PutLexicon Operation
Stores a pronunciation lexicon in an AWS Region. If a lexicon with the same name already exists in the region, it is overwritten by the new lexicon. Lexicon operations have eventual consistency, therefore, it might take some time before the lexicon is available to the SynthesizeSpeech operation.
For more information, see Managing Lexicons.
Arguments
LexiconName = ::String
– Required
Name of the lexicon. The name must follow the regular express format [0-9A-Za-z]{1,20}. That is, the name is a case-sensitive alphanumeric string up to 20 characters long.
Content = ::String
– Required
Content of the PLS lexicon as string data.
Returns
PutLexiconOutput
Exceptions
InvalidLexiconException
, UnsupportedPlsAlphabetException
, UnsupportedPlsLanguageException
, LexiconSizeExceededException
, MaxLexemeLengthExceededException
, MaxLexiconsNumberExceededException
or ServiceFailureException
.
Example: To save a lexicon
Stores a pronunciation lexicon in an AWS Region.
Input:
[
"Content" => "file://example.pls",
"Name" => "W3C"
]
Output:
Dict(
)
See also: AWS API Documentation
AWSSDK.Polly.synthesize_speech
— Function.using AWSSDK.Polly.synthesize_speech
synthesize_speech([::AWSConfig], arguments::Dict)
synthesize_speech([::AWSConfig]; OutputFormat=, Text=, VoiceId=, <keyword arguments>)
using AWSCore.Services.polly
polly([::AWSConfig], "POST", "/v1/speech", arguments::Dict)
polly([::AWSConfig], "POST", "/v1/speech", OutputFormat=, Text=, VoiceId=, <keyword arguments>)
SynthesizeSpeech Operation
Synthesizes UTF-8 input, plain text or SSML, to a stream of bytes. SSML input must be valid, well-formed SSML. Some alphabets might not be available with all the voices (for example, Cyrillic might not be read at all by English voices) unless phoneme mapping is used. For more information, see How it Works.
Arguments
LexiconNames = [::String, ...]
List of one or more pronunciation lexicon names you want the service to apply during synthesis. Lexicons are applied only if the language of the lexicon is the same as the language of the voice. For information about storing lexicons, see PutLexicon.
OutputFormat = "json", "mp3", "ogg_vorbis" or "pcm"
– Required
The format in which the returned output will be encoded. For audio stream, this will be mp3, ogg_vorbis, or pcm. For speech marks, this will be json.
SampleRate = ::String
The audio frequency specified in Hz.
The valid values for mp3
and ogg_vorbis
are "8000", "16000", and "22050". The default value is "22050".
Valid values for pcm
are "8000" and "16000" The default value is "16000".
SpeechMarkTypes = ["sentence", "ssml", "viseme" or "word", ...]
The type of speech marks returned for the input text.
Text = ::String
– Required
Input text to synthesize. If you specify ssml
as the TextType
, follow the SSML format for the input text.
TextType = "ssml" or "text"
Specifies whether the input text is plain text or SSML. The default value is plain text. For more information, see Using SSML.
VoiceId = "Geraint", "Gwyneth", "Mads", "Naja", "Hans", "Marlene", "Nicole", "Russell", "Amy", "Brian", "Emma", "Raveena", "Ivy", "Joanna", "Joey", "Justin", "Kendra", "Kimberly", "Matthew", "Salli", "Conchita", "Enrique", "Miguel", "Penelope", "Chantal", "Celine", "Mathieu", "Dora", "Karl", "Carla", "Giorgio", "Mizuki", "Liv", "Lotte", "Ruben", "Ewa", "Jacek", "Jan", "Maja", "Ricardo", "Vitoria", "Cristiano", "Ines", "Carmen", "Maxim", "Tatyana", "Astrid", "Filiz", "Vicki" or "Takumi"
– Required
Voice ID to use for the synthesis. You can get a list of available voice IDs by calling the DescribeVoices operation.
Returns
SynthesizeSpeechOutput
Exceptions
TextLengthExceededException
, InvalidSampleRateException
, InvalidSsmlException
, LexiconNotFoundException
, ServiceFailureException
, MarksNotSupportedForFormatException
or SsmlMarksNotSupportedForTextTypeException
.
Example: To synthesize speech
Synthesizes plain text or SSML into a file of human-like speech.
Input:
[
"LexiconNames" => [
"example"
],
"OutputFormat" => "mp3",
"SampleRate" => "8000",
"Text" => "All Gaul is divided into three parts",
"TextType" => "text",
"VoiceId" => "Joanna"
]
Output:
Dict(
"AudioStream" => "TEXT",
"ContentType" => "audio/mpeg",
"RequestCharacters" => 37
)
See also: AWS API Documentation