import type { MetadataBearer as __MetadataBearer, StreamingBlobPayloadOutputTypes } from "@smithy/types"; import type { SynthesizeSpeechInput, SynthesizeSpeechOutput } from "../models/models_0"; /** * @public */ export type { __MetadataBearer }; /** * @public * * The input for {@link SynthesizeSpeechCommand}. */ export interface SynthesizeSpeechCommandInput extends SynthesizeSpeechInput { } /** * @public * * The output of {@link SynthesizeSpeechCommand}. */ export interface SynthesizeSpeechCommandOutput extends Omit, __MetadataBearer { AudioStream?: StreamingBlobPayloadOutputTypes; } declare const SynthesizeSpeechCommand_base: { new (input: SynthesizeSpeechCommandInput): import("@smithy/core/client").CommandImpl; new (input: SynthesizeSpeechCommandInput): import("@smithy/core/client").CommandImpl; getEndpointParameterInstructions(): import("@smithy/types").EndpointParameterInstructions; }; /** *

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.

* @example * Use a bare-bones client and the command you need to make an API call. * ```javascript * import { PollyClient, SynthesizeSpeechCommand } from "@aws-sdk/client-polly"; // ES Modules import * // const { PollyClient, SynthesizeSpeechCommand } = require("@aws-sdk/client-polly"); // CommonJS import * // import type { PollyClientConfig } from "@aws-sdk/client-polly"; * const config = {}; // type is PollyClientConfig * const client = new PollyClient(config); * const input = { // SynthesizeSpeechInput * Engine: "standard" || "neural" || "long-form" || "generative", * LanguageCode: "arb" || "cmn-CN" || "cy-GB" || "da-DK" || "de-DE" || "en-AU" || "en-GB" || "en-GB-WLS" || "en-IN" || "en-US" || "es-ES" || "es-MX" || "es-US" || "fr-CA" || "fr-FR" || "is-IS" || "it-IT" || "ja-JP" || "hi-IN" || "ko-KR" || "nb-NO" || "nl-NL" || "pl-PL" || "pt-BR" || "pt-PT" || "ro-RO" || "ru-RU" || "sv-SE" || "tr-TR" || "en-NZ" || "en-ZA" || "ca-ES" || "de-AT" || "yue-CN" || "ar-AE" || "fi-FI" || "en-IE" || "nl-BE" || "fr-BE" || "cs-CZ" || "de-CH" || "en-SG", * LexiconNames: [ // LexiconNameList * "STRING_VALUE", * ], * OutputFormat: "json" || "mp3" || "ogg_opus" || "ogg_vorbis" || "pcm" || "mulaw" || "alaw", // required * SampleRate: "STRING_VALUE", * SpeechMarkTypes: [ // SpeechMarkTypeList * "sentence" || "ssml" || "viseme" || "word", * ], * Text: "STRING_VALUE", // required * TextType: "ssml" || "text", * VoiceId: "Aditi" || "Amy" || "Astrid" || "Bianca" || "Brian" || "Camila" || "Carla" || "Carmen" || "Celine" || "Chantal" || "Conchita" || "Cristiano" || "Dora" || "Emma" || "Enrique" || "Ewa" || "Filiz" || "Gabrielle" || "Geraint" || "Giorgio" || "Gwyneth" || "Hans" || "Ines" || "Ivy" || "Jacek" || "Jan" || "Joanna" || "Joey" || "Justin" || "Karl" || "Kendra" || "Kevin" || "Kimberly" || "Lea" || "Liv" || "Lotte" || "Lucia" || "Lupe" || "Mads" || "Maja" || "Marlene" || "Mathieu" || "Matthew" || "Maxim" || "Mia" || "Miguel" || "Mizuki" || "Naja" || "Nicole" || "Olivia" || "Penelope" || "Raveena" || "Ricardo" || "Ruben" || "Russell" || "Salli" || "Seoyeon" || "Takumi" || "Tatyana" || "Vicki" || "Vitoria" || "Zeina" || "Zhiyu" || "Aria" || "Ayanda" || "Arlet" || "Hannah" || "Arthur" || "Daniel" || "Liam" || "Pedro" || "Kajal" || "Hiujin" || "Laura" || "Elin" || "Ida" || "Suvi" || "Ola" || "Hala" || "Andres" || "Sergio" || "Remi" || "Adriano" || "Thiago" || "Ruth" || "Stephen" || "Kazuha" || "Tomoko" || "Niamh" || "Sofie" || "Lisa" || "Isabelle" || "Zayd" || "Danielle" || "Gregory" || "Burcu" || "Jitka" || "Sabrina" || "Jasmine" || "Jihye" || "Ambre" || "Beatrice" || "Florian" || "Lennart" || "Lorenzo" || "Tiffany" || "Arjun" || "Carlos" || "Carolina" || "Curtis" || "Hyunduk" || "Kenneth" || "Kiara" || "Leo" || "Nate" || "Tina", // required * }; * const command = new SynthesizeSpeechCommand(input); * const response = await client.send(command); * // consume or destroy the stream to free the socket. * const bytes = await response.AudioStream.transformToByteArray(); * // const str = await response.AudioStream.transformToString(); * // response.AudioStream.destroy(); // only applicable to Node.js Readable streams. * * // { // SynthesizeSpeechOutput * // AudioStream: "", // see \@smithy/types -> StreamingBlobPayloadOutputTypes * // ContentType: "STRING_VALUE", * // RequestCharacters: Number("int"), * // }; * * ``` * * @param SynthesizeSpeechCommandInput - {@link SynthesizeSpeechCommandInput} * @returns {@link SynthesizeSpeechCommandOutput} * @see {@link SynthesizeSpeechCommandInput} for command's `input` shape. * @see {@link SynthesizeSpeechCommandOutput} for command's `response` shape. * @see {@link PollyClientResolvedConfig | config} for PollyClient's `config` shape. * * @throws {@link EngineNotSupportedException} (client fault) *

This engine is not compatible with the voice that you have designated. * Choose a new voice that is compatible with the engine or change the engine * and restart the operation.

* * @throws {@link InvalidSampleRateException} (client fault) *

The specified sample rate is not valid.

* * @throws {@link InvalidSsmlException} (client fault) *

The SSML you provided is invalid. Verify the SSML syntax, spelling * of tags and values, and then try again.

* * @throws {@link LanguageNotSupportedException} (client fault) *

The language specified is not currently supported by Amazon Polly in this * capacity.

* * @throws {@link LexiconNotFoundException} (client fault) *

Amazon Polly can't find the specified lexicon. This could be caused by a * lexicon that is missing, its name is misspelled or specifying a lexicon * that is in a different region.

*

Verify that the lexicon exists, is in the region (see ListLexicons) and that you spelled its name is spelled * correctly. Then try again.

* * @throws {@link MarksNotSupportedForFormatException} (client fault) *

Speech marks are not supported for the OutputFormat * selected. Speech marks are only available for content in json * format.

* * @throws {@link ServiceFailureException} (server fault) *

An unknown condition has caused a service failure.

* * @throws {@link SsmlMarksNotSupportedForTextTypeException} (client fault) *

SSML speech marks are not supported for plain text-type * input.

* * @throws {@link TextLengthExceededException} (client fault) *

The value of the "Text" parameter is longer than the accepted * limits. For the SynthesizeSpeech API, the limit for input * text is a maximum of 6000 characters total, of which no more than 3000 can * be billed characters. For the StartSpeechSynthesisTask API, * the maximum is 200,000 characters, of which no more than 100,000 can be * billed characters. SSML tags are not counted as billed * characters.

* * @throws {@link PollyServiceException} *

Base exception class for all service exceptions from Polly service.

* * * @example To synthesize speech * ```javascript * // Synthesizes plain text or SSML into a file of human-like speech. * const input = { * LexiconNames: [ * "example" * ], * OutputFormat: "mp3", * SampleRate: "8000", * Text: "All Gaul is divided into three parts", * TextType: "text", * VoiceId: "Joanna" * }; * const command = new SynthesizeSpeechCommand(input); * const response = await client.send(command); * // consume or destroy the stream to free the socket. * const bytes = await response.AudioStream.transformToByteArray(); * // const str = await response.AudioStream.transformToString(); * // response.AudioStream.destroy(); // only applicable to Node.js Readable streams. * * /* response is * { * AudioStream: "TEXT", * ContentType: "audio/mpeg", * RequestCharacters: 37 * } * *\/ * ``` * * @public */ export declare class SynthesizeSpeechCommand extends SynthesizeSpeechCommand_base { /** @internal type navigation helper, not in runtime. */ protected static __types: { api: { input: SynthesizeSpeechInput; output: SynthesizeSpeechOutput; }; sdk: { input: SynthesizeSpeechCommandInput; output: SynthesizeSpeechCommandOutput; }; }; }