0

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?

Tim Long
  • 393
  • 1
  • 5
  • 17

1 Answers1

0

It seems the medical endpoint (at this time) only allows a language of 'en-US' but I was trying to us 'en-AU'.

Tim Long
  • 393
  • 1
  • 5
  • 17