-1

I was able to build Amazon Lex sample app with a new bot including several new intents.

What I'm trying to support now is to change the character and output voice

For example,

Currently we have 7 characters in default : Joanna, Salli, Kimberly, Kendra, Justin, Joey, Ivy.

User : Who are you?
Bot : (Salli's Voice) I'm Salli.

User : I want to change to Joey.
Bot : (Salli's Voice) Ok. I'll change to Joey
      ( --> System Command : Change the voice to Joey)

User : Who are you?
Bot : (Joey's Voice) I'm Joey.

In order to achieve the goal, I need to know 3 things. (At least third one)

  1. How to get the current output voice
  2. How to add the current output voice name in the utterance answer
  3. How to change the output voice with system command (maybe Lambda with Restful API?)

I tried to get the information from the API doc (http://docs.aws.amazon.com/en_en/lex/latest/dg/API_Reference.html), but it wasn't helpful.

Any comments will be welcomed.

Thanks.

1 Answers1

1

This isn't something that Lex is built for, as the voice setting is configured against the bot itself, rather than a per use basis.

Though I can think of a couple ways to hack this if you really want it.

Option 1 - Edit the bot on the fly

Make a command line call to switch the bot using the Put Bot API, supplying the voice-id of the new voice.

You can use the Get Bot API to see which voice the bot currently has.

Problems:

  • The bot may require being rebuilt, which can take some time and slow responses.
  • This change will affect all requests to the bot so all uses will have the new voice.

Option 2 - Multiple bots

Create a bot for each voice you want to use. Make calls to your bot go through a lambda function which tracks which bot the user is currently wanting to use (e.g. database table/S3 file mapping the user-id supplied in the request to their desired bot). Route the request to the required bot.

Problems:

  • A lot of overhead.
  • A lot of bots to maintain.
  • Additional services to retain user state.
Milk
  • 2,469
  • 5
  • 31
  • 54