I am attempting to use web-sockets to convert in real time medical conversations to text. I have based my work off of https://github.com/aws-samples/amazon-transcribe-websocket-static.
It is working great until I change to the medical endpoint. At this stage I get the error response- The requested language doesn't support the specified sample rate. Use the correct sample rate then try again.
I have tried different sample rates but with no luck. The documentation says: "The sample rate of the input audio in hertz. 16,000 Hz or higher sample rates are accepted." which I have tried but with no luck.
Here are the relevate sections of code:
function createPresignedUrl() {
let endpoint = "transcribestreaming." + region + ".amazonaws.com:8443";
// get a preauthenticated URL that we can use to establish our WebSocket
return v4.createPresignedURL(
'GET',
endpoint,
'/medical-stream-transcription-websocket',
'transcribe',
crypto.createHash('sha256').update('', 'utf8').digest('hex'), {
'key': '',
'secret': '',
'sessionToken': '',
'protocol': 'wss',
'expires': 120,
'region': region,
'query': "specialty=PRIMARYCARE&type=" + $('#type').val() + "&language-code=" + languageCode + "&media-encoding=pcm&sample-rate="+ sampleRate
}
);
}
function setLanguage() {
languageCode = 'en-AU';
if (languageCode == "en-US" || languageCode == "es-US")
sampleRate = 44100;
else
sampleRate = 8000;
}
What sample rates do I need to use for the different languages when using the medical endpoint?