Search code examples
amazon-web-servicesamazon-s3speech-recognitionspeech-to-textaws-java-sdk-2.x

AWS Javascript SDK - startMedicalTranscriptionJob not support mic device


I am a newbie in using AWS JavaScript SDK. I am trying to create an HTML page like the UI of Amazon Transcribe Medical - Real-time transcription (link). The Real-time transcription works fine with microphone device. I mean it converts the speech data (input the audio from mic device) to text in real-time, Works fine and I really impressed and decided to create a UI like below image.

enter image description here

I read the documentation of the AWS JavaScript SDK in https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/TranscribeService.html#startMedicalTranscriptionJob-property

enter image description here

but there is confusion about the input audio input parameter (MediaFileUri parameter), in the documentation of the above method it's not allowed to capture the audio from the mic device (or I can't find any input parameter for mic devices), it's only possible to input audio files from amazon bucket.

z

So how I create a UI like Amazon real-time transcription using this method? Any advice for acheive this?


Solution

  • Transcribe medical support two modes: streaming and batch. The SDK you use is batch API, as in https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/TranscribeService.html#startMedicalTranscriptionJob-property

    Javascript SDK for transcribe medical streaming is not yet released. But you can implement your own WebSocket client.

    This is tech document about Transcribe medical streaming WebSocket protocol: https://docs.aws.amazon.com/transcribe/latest/dg/websocket-med.html

    For implementation in javascript, please refer to sample code: https://github.com/aws-samples/amazon-transcribe-medical-demo/blob/master/src/transcribe/TranscriptionWindow.js#L138-L160