in source/transcribedocker/transcribe-to-dynamo-withSDK.js [128:155]
let handleEventStreamMessage = function (messageJson) {
let results = messageJson.Transcript.Results;
if (results.length > 0) {
if (results[0].Alternatives.length > 0) {
let transcript = results[0].Alternatives[0].Transcript;
// fix encoding for accented characters
transcript = decodeURIComponent(escape(transcript));
// update the textarea with the latest result
console.log(transcript);
// if this transcript segment is final, add it to the overall transcription
// if (!results[0].IsPartial) {
// //scroll the textarea down
// $('#transcript').scrollTop($('#transcript')[0].scrollHeight);
// transcription += transcript + "\n";
// }
// Send to dynamo DB.
const requestStartTime = timestamp_millis();
sendResultsToDynamo(results[0], requestStartTime);
}
}
}