- Newest
- Most votes
- Most comments
The error you're encountering suggests that there might be an issue with the audio stream or how it's being sent to Amazon Transcribe. Here are a few things to consider:
-
Audio format: Ensure that your PCM audio is in the correct format. Amazon Transcribe expects 16-bit PCM audio for streaming transcription.
-
Sample rate: You've set the MediaSampleRateHertz to 16000, which is correct for the 16 kHz audio that Amazon Transcribe supports for streaming.
-
Chunk size: Your chunk size of 320 bytes is quite small. While Amazon Transcribe can handle various chunk sizes, you might want to try increasing it to see if it resolves the issue. A common chunk size is around 32 KB.
-
Stream initialization: Your stream initialization looks correct, using the StartCallAnalyticsStreamTranscriptionCommand.
-
Audio stream generator: Your getAudioStream function seems to be implemented correctly, yielding audio chunks as they become available.
-
Error handling: Make sure you have proper error handling in place, especially for the first chunk of audio data.
-
AWS SDK version: Ensure you're using the latest version of the AWS SDK for JavaScript, as older versions might have bugs that have been fixed in newer releases.
-
Network issues: The error could potentially be related to network connectivity problems. Ensure you have a stable connection to AWS.
-
Account limits: Check if you've hit any account limits for Amazon Transcribe streaming.
If the issue persists after checking these points, you may want to try the following:
- Implement more detailed logging to capture the exact state when the error occurs.
- Try using a different audio file to see if the problem is specific to your current audio data.
- Consider using the AWS CLI or SDK to test the streaming transcription with a known good audio file to isolate whether the issue is with your code or the service.
If none of these suggestions resolve the issue, you may need to contact AWS Support for further assistance, as they can provide more detailed diagnostics based on your account and usage patterns.
Sources
Transcribing with HTTP or WebSockets - Amazon Transcribe
TranscriptResultStream - Amazon Transcribe
Streaming transcription overview - Amazon Transcribe
Relevant content
asked 4 years ago

Thanks I did check all those things, and I've also tried with recorded audio dumped to a text file in base64. I've tried from my local machine and from a deployed ECS container.
Also I've already recieved this answer from a bunch of other AI tools.
Sample chunk:
FQA0ADgAQgAxACYANQA1ACQAHAATACAAEgAZABsAAwAHAAkADAADAP3/CQADAPn/9P/4/wMA///0//r/7v/v//X/8P/0//P/BgABAN//5f/4//3/8P/1/wsA+v8MAPL/8P/v/9r/0f/I/9b/5P/m/9j/s/+l/6b/mP+d/7f/wP+9/7v/hP/G/73/zf/p/9v/8//d/9j/4//J/5z/m/+D/5H/eP90/2X/Tv9F/1z/VP9D/0v/NP8n/xr/DP/9/gv/Ev8O/wz/Cf/1/u/+9P7w/uX+8P7+/gP//v71/vf+CP8Q/xP/G/8w/17/d/+C/5n/wP/V/+3//P8PAB8AKQA/AFoAcABzAIEAlACpAL4A0ADbAOoA/wASAS4BOgFPAWQBcwGNAZ0BtAHJAd0B6wH8Af8B/gEHAhQCHgIsAjUCRgI=