Alexa Auto SDK  4.3
Public Member Functions | List of all members
aace::textToSpeech::TextToSpeech Class Referenceabstract

Public Member Functions

bool prepareSpeech (const std::string &speechId, const std::string &text, const std::string &provider, const std::string &options="")
 
bool getCapabilities (const std::string &requestId, const std::string &provider)
 
virtual void prepareSpeechCompleted (const std::string &speechId, std::shared_ptr< aace::audio::AudioStream > preparedAudio, const std::string &metadata)=0
 
virtual void prepareSpeechFailed (const std::string &speechId, const std::string &reason)=0
 
virtual void capabilitiesReceived (const std::string &requestId, const std::string &capabilities)=0
 

Detailed Description

The TextToSpeech platform interface should be extended to allow the platform to synthesize Alexa and non-Alexa speech using a text or a SSML document.

The platform implementation is responsible for making request for speech synthesis and requesting capabilities of any Text To Speech provider. The platform should also handle callbacks for each prepareSpeech() and getCapabilities() requests.

Note
The TextToSpeech platform is not responsible for the playback of the synthesized speech.
Deprecated:
This platform interface is deprecated. Use the Alexa Auto Services Bridge (AASB) message broker to publish and subscribe to AASB messages instead.
See also
aace::core::MessageBroker

Member Function Documentation

◆ prepareSpeech()

bool aace::textToSpeech::TextToSpeech::prepareSpeech ( const std::string &  speechId,
const std::string &  text,
const std::string &  provider,
const std::string &  options = "" 
)

Notifies the Engine to prepare a speech asset with speechId and text. This is an asynchronous call. The platform is notified about the result of this operation through the prepareSpeechCompleted() or prepareSpeechFailed() callbacks.

Parameters
[in]speechIdThe unique identifier of the speech asset.
[in]textThe text in plain or SSML format.
[in]providerThe Text To Speech provider to be used to generate the speech asset. This parameter should be "text-to-speech-provider" since there is only one provider in Auto SDK.
[in]optionsAdditional options for the speech synthesis request. Default value is empty string which generates speech in Alexa's voice. This parameter need not be specified if the speech synthesis is expected to be in Alexa's voice

Sample options payload :

)
{
"requestPayload" : {
// Payload defined by the Text To Speech provider
}
}

Refer to the Text to Speech provider module documentation for complete details of the requestPayload schema.

Returns
true if the request was successful, else false if an error occurred.

◆ getCapabilities()

bool aace::textToSpeech::TextToSpeech::getCapabilities ( const std::string &  requestId,
const std::string &  provider 
)

Retrieves the capabilities of the provider.

This is an asynchronous call. The result of the operation is provided by the capabilitiesReceived() callback.

Parameters
[in]providerThe unique identifier of the provider. This parameter should be "text-to-speech-provider" since there is only one provider in Auto SDK.
[in]requestIdThe unique identifier for this request.
Returns
true if the request was successful, else false if an error occurred.

◆ prepareSpeechCompleted()

virtual void aace::textToSpeech::TextToSpeech::prepareSpeechCompleted ( const std::string &  speechId,
std::shared_ptr< aace::audio::AudioStream >  preparedAudio,
const std::string &  metadata 
)
pure virtual

Notifies the platform implementation that the prepareSpeech() operation of speech asset with speechId was successful.

Parameters
[in]speechIdThe unique identifier of the speech asset.
[in]preparedAudioThe audio asset.
[in]metadataThe metadata of the speech asset.

Refer to the Text to Speech provider module documentation for complete details of the metadata schema.

◆ prepareSpeechFailed()

virtual void aace::textToSpeech::TextToSpeech::prepareSpeechFailed ( const std::string &  speechId,
const std::string &  reason 
)
pure virtual

Notifies the platform implementation that the prepareSpeech() operation for the speech asset with speechId failed.

Parameters
[in]idThe unique identifier of the speech asset.
[in]reasonThe reason for the failure.

Refer to the Text to Speech provider module documentation for complete details of the error responses.

◆ capabilitiesReceived()

virtual void aace::textToSpeech::TextToSpeech::capabilitiesReceived ( const std::string &  requestId,
const std::string &  capabilities 
)
pure virtual

Notifies the platform implementation of a Text to Speech provider's capabilities. The requestId corresponds to the ID from the original getCapabilities() request.

Parameters
[in]capabilitiesThe capabilities corresponding to a Text to Speech provider.
[in]requestIdThe unique identifier for the original getCapabilities() request.

Refer to the Text to Speech provider module documentation for complete details of the capabilities payload.


Alexa Auto SDK 4.3 - Copyright 2017-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0