aws / amazon-chime-sdk-js

A JavaScript client library for integrating multi-party communications powered by the Amazon Chime service.
Apache License 2.0
709 stars 477 forks source link

Live transcription `IdentifyLanguage` not working #2861

Open haow-abc opened 6 months ago

haow-abc commented 6 months ago

What happened and what did you expect to happen?

I am trying to use Chime live transcription feature, but having an issue with enabling IdentifyLanguage. Everything works fine if I specific LanguageCode: 'en-US', but when I do:

const transcribeResponse = await meetingClient.send(
                new StartMeetingTranscriptionCommand({
                    MeetingId: meetingId,
                    TranscriptionConfiguration: {
                        EngineTranscribeSettings: {
                            IdentifyLanguage: true,
                            PreferredLanguage: 'en-US'
                        }
                    }
                })
            );

I got a success message on the server side: transcribeResponse {"$metadata":{"httpStatusCode":200,"requestId":"b20b7f6e-07a1-4da4-a26e-86c89f7a3a5b","attempts":1,"totalRetryDelay":0}}

However, on the frontend, I got this error message:

image

Based on the documentation, seems like I don't need to specific LanguageCode when IdentifyLanguage is set to true:

image

Any idea about why this happens? Am I missing something? Thank you for helping in advance.

Have you reviewed our existing documentation?

Reproduction steps

Server-side code:

const transcribeResponse = await meetingClient.send(
                new StartMeetingTranscriptionCommand({
                    MeetingId: meetingId,
                    TranscriptionConfiguration: {
                        EngineTranscribeSettings: {
                            // LanguageCode: 'en-US'
                            IdentifyLanguage: true,
                            PreferredLanguage: 'en-US'
                        }
                    }
                })
            );

Client-side code:

audioVideo.transcriptionController?.subscribeToTranscriptEvent((transcriptEvent) => {
            console.log('transcriptEvent', transcriptEvent);
            // do something with transcriptEvent
        });

Amazon Chime SDK for JavaScript version

3.535.0

What browsers are you seeing the problem on?

Chrome

Browser version

122.0.6261.129

Meeting and Attendee ID Information.

No response

Browser console logs

skip

pracheth commented 4 weeks ago

It looks like there is a difference in documentation between AWS Chime SDK and AWS Transcribe.

AWS Chime SDK: https://docs.aws.amazon.com/chime/latest/APIReference/API_EngineTranscribeSettings.html#chime-Type-EngineTranscribeSettings-LanguageOptions

AWS Transcribe: https://docs.aws.amazon.com/transcribe/latest/APIReference/API_streaming_StartStreamTranscription.html#API_streaming_StartStreamTranscription_RequestParameters

In the AWS Transcribe one it says

IdentifyLanguage 
        Enables automatic language identification for your transcription.

        If you include IdentifyLanguage, you must include a list of language codes, using LanguageOptions, that you think may be present in your audio stream.

        You can also include a preferred language using PreferredLanguage. Adding a preferred language can help Amazon Transcribe identify the language faster than if you omit this parameter.

Does it work if you add the LanguageCode?

haow-abc commented 4 weeks ago

@pracheth I am no longer involved with this project, so you'll need to test and verify this on your end. I believe I tried various combinations before, but none of them worked.