awslabs / aws-lex-browser-audio-capture

An example web application using the Lex JavaScript SDK to send and receive audio from the Lex PostContent API. Demonstrates how to capture an audio device, record audio, and convert the audio into a format that Lex will recognize, and play the response. All from a web browser.
MIT No Attribution
165 stars 74 forks source link

Capture audio that playing from browser and send to LEX PostContent API #1

Closed sasiarjun closed 6 years ago

sasiarjun commented 7 years ago

We are working on web application with amazon connect, Here amazon connect playing audio response that we need to capture from browser and send it AWS Javascript LEX Post Content API.

We used this sample application as reference and worked with microphone, but its not capturing audio response that amazon connect playing audio response.

https://aws.amazon.com/blogs/ai/capturing-voice-input-in-a-browser/

Please help me, how can we record web browser audio response from amazon connect.

palafranchise commented 7 years ago

Hi sasiarjun,

Can you provide more details? How are you capturing the Audio that you want to send to Lex? Is Connect providing the audio as a stream or file? The most common issue when sending audio to Lex is that it's not sampled at the correct rate or the wrong sample rate is specified in the request.

http://docs.aws.amazon.com/lex/latest/dg/API_runtime_PostContent.html#API_runtime_PostContent_RequestSyntax

If you can provide more details I can better assist you. Are you getting any error messages from the PostContent API?

Cheers,

Andrew

sasiarjun commented 7 years ago

I'm using amazon connect and created outbound contact flow to make call. Once the call is established it provides audio response which needs to be forwarded to LEX. I'm not able to capture the response kindly help on the same.

palafranchise commented 7 years ago

Hi sasiarjun,

Can you provide a little more detail? Are you using a JavaScript API to create the outbound contact flow? What type of object is the provided audio response? If you can tell me the Connect API you are using and the return type of the audio response I can determine how to pass the audio to Lex.

Cheers,

Andrew