How to update and call inside 'then()' function

72 Views Asked by At
playSpeech(body) {
    this._isSpeaking = true;

    this._hostSpeechComponent.addSpeech(this._speech);

    this._speech.updateConfig({
        entity: this._host,
        body: '<speak>' + body + '</speak>',
        type: 'ssml',
        voice: this._voice
    });

    this._speech.play().then(() => {
        this._isSpeaking = false;
    });
};

This is my PlaySpeech method in Amazon Sumerian Script. In the 'then' function I want to update the speech.body and then call speech.play(). How can I do it?

0

There are 0 best solutions below