0
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?

Raghul SK
  • 1,256
  • 5
  • 22
  • 30
  • You already have code. What is wrong with it? Please describe the expected versus actual results. – CherryDT Jul 07 '20 at 07:46
  • I have 4 different strings and when they are passed to ctx.entityData.Speech.play speech(string) it starts speaking that. Refer https://i.stack.imgur.com/wfoZn.png and what happens is when I execute it I can hear all 4 strings speeches simultaneously, but I want them to follow a sequence. hence I am planning on using a then() and on slack I got this comment "In the 'then' function update the speech. body and then call speech.play()" so I am a little unclear how to do it. So help me out @CherryDT – ganesh tarone Jul 07 '20 at 08:05

0 Answers0