fn synthesize_speech(
        &self,
        input: SynthesizeSpeechInput,
    ) -> RusotoFuture<SynthesizeSpeechOutput, SynthesizeSpeechError> {
        let request_uri = "/v1/speech";

        let mut request = SignedRequest::new("POST", "polly", &self.region, &request_uri);
        request.set_content_type("application/x-amz-json-1.1".to_owned());

        let encoded = Some(serde_json::to_vec(&input).unwrap());
        request.set_payload(encoded);

        self.client.sign_and_dispatch(request, |response| {
            if response.status.as_u16() == 200 {
                Box::new(response.buffer().from_err().map(|response| {
                    let mut result = SynthesizeSpeechOutput::default();
                    result.audio_stream = Some(response.body);

                    if let Some(content_type) = response.headers.get("Content-Type") {
                        let value = content_type.to_owned();
                        result.content_type = Some(value)
                    };
                    if let Some(request_characters) =
                        response.headers.get("x-amzn-RequestCharacters")
                    {
                        let value = request_characters.to_owned();
                        result.request_characters = Some(value.parse::<i64>().unwrap())
                    };

                    result
                }))
            } else {
                Box::new(
                    response
                        .buffer()
                        .from_err()
                        .and_then(|response| Err(SynthesizeSpeechError::from_response(response))),
                )
            }
        })
    }
/// <p>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 <a href="http://docs.aws.amazon.com/polly/latest/dg/how-text-to-speech-works.html">How it Works</a>.</p>
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.
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 .
fn synthesize_speech(
        &self,
        input: SynthesizeSpeechInput,
    ) -> RusotoFuture<SynthesizeSpeechOutput, SynthesizeSpeechError> {
        let request_uri = "/v1/speech";
        let mut request = SignedRequest::new("POST", "polly", &self.region, &request_uri);
        request.set_content_type("application/x-amz-json-1.1".to_owned());
        let encoded = Some(serde_json::to_vec(&input).unwrap());
        request.set_payload(encoded);
        self.client.sign_and_dispatch(request, |response| {
            if response.status.as_u16() == 200 {
                Box::new(response.buffer().from_err().map(|response| {
                    let mut result = SynthesizeSpeechOutput::default();
                    result.audio_stream = Some(response.body);
                    if let Some(content_type) = response.headers.get("Content-Type") {
                        let value = content_type.to_owned();
                        result.content_type = Some(value)
                    };
                    if let Some(request_characters) =
                        response.headers.get("x-amzn-RequestCharacters")
                    {
                        let value = request_characters.to_owned();
                        result.request_characters = Some(value.parse::<i64>().unwrap())
                    };
                    result
                }))
            } else {
                Box::new(
                    response
                        .buffer()
                        .from_err()
                        .and_then(|response| Err(SynthesizeSpeechError::from_response(response))),
                )
            }
        })
    }
fn synthesize_speech ( & self , input : SynthesizeSpeechInput , ) -> RusotoFuture < SynthesizeSpeechOutput , SynthesizeSpeechError > { let request_uri = " " ; let mut request = SignedRequest :: new ( " " , " " , & self . region , & request_uri ) ; request . set_content_type ( " " . to_owned ( ) ) ; let encoded = Some ( serde_json :: to_vec ( & input ) . unwrap ( ) ) ; request . set_payload ( encoded ) ; self . client . sign_and_dispatch ( request , | response | { if response . status . as_u16 ( ) == 200 { Box :: new ( response . buffer ( ) . from_err ( ) . map ( | response | { let mut result = SynthesizeSpeechOutput :: default ( ) ; result . audio_stream = Some ( response . body ) ; if let Some ( content_type ) = response . headers . get ( " " ) { let value = content_type . to_owned ( ) ; result . content_type = Some ( value ) } ; if let Some ( request_characters ) = response . headers . get ( " " ) { let value = request_characters . to_owned ( ) ; result . request_characters = Some ( value . parse :: < i64 > ( ) . unwrap ( ) ) } ; result } ) ) } else { Box :: new ( response . buffer ( ) . from_err ( ) . and_then ( | response | Err ( SynthesizeSpeechError :: from_response ( response ) ) ) , ) } } ) }
<p>Synthesizes UTF-8 input, plain text or SSML, to a stream of bytes.
<p > Synthesizes UTF - 8 input plain text or SSML to a stream of bytes .
&self
input
SynthesizeSpeechInput
&self
input
SynthesizeSpeechInput