aws-samples / amazon-sumerian-hosts

Amazon Sumerian Hosts (Hosts) is an experimental open source project that aims to make it easy to create interactive animated 3D characters for Babylon.js, three.js, and other web 3D frameworks. It leverages AWS services including Amazon Polly (text-to-speech) and Amazon Lex (chatbot).
MIT No Attribution
174 stars 80 forks source link

Catch the Lex error since Lex only supports 15s speech #130

Closed eherozhao closed 2 years ago

eherozhao commented 2 years ago

Description

Amazon Lex is limited to 15 seconds for audio input. If a user tries to record more than 15 seconds of audio with our LexFeature an error is thrown. Therefore, this PR is to catch the error from Lex side and re-throw it with a customized string to notice customers if the audio is more than 15s.

Added unit testing to check that the error rethrown from the endVoiceRecording was the customized one.

Reviewer Testing Instructions

Submission Checklist

I confirm that I have...


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.