Aws-sdk-js: Plans to support StartStreamTranscription for Amazon Transcribe?

Created on 10 Dec 2018  路  16Comments  路  Source: aws/aws-sdk-js

I watched the keynote recently where streaming was introduced for the Amazon Transcribe product. Looks really fantastic and I'd like to set up a prototype browser application in JS. But it seems like the SDK doesn't support the StartStreamTranscription function that is key for this?

https://docs.aws.amazon.com/transcribe/latest/dg/API_streaming_StartStreamTranscription.html

Are there any plans to introduce this into the SDK soon? I would have thought streaming from the browser would be a main use case.

feature-request needs-major-version

Most helpful comment

I had a similar requirement for using the AWS transcribe service with their WebSocket API in node js. Seeing as there was no support for this in the official package as of yet, I have gone ahead and written a package that is called AWS-transcribe and can be found here. I hope that helps.

It provides a stream interface around the WebSocket, and can be used like the below example

import { AwsTranscribe, StreamingClient } from "aws-transcribe"

const client = new AwsTranscribe({
    // if these aren't provided, they will be taken from the environment
    accessKeyId: "ACCESS KEY HERE",
    secretAccessKey: "SECRET KEY HERE",
})

const transcribeStream = client
    .createStreamingClient({
        region: "eu-west-1",
        sampleRate,
        languageCode: "en-US",
    })
    // enums for returning the event names which the stream will emit
    .on(StreamingClient.EVENTS.OPEN, () => console.log(`transcribe connection opened`))
    .on(StreamingClient.EVENTS.ERROR, console.error)
    .on(StreamingClient.EVENTS.CLOSE, () => console.log(`transcribe connection closed`))
    .on(StreamingClient.EVENTS.DATA, (data) => {
        const results = data.Transcript.Results

        if (!results || results.length === 0) {
            return
        }

        const result = results[0]
        const final = !result.IsPartial
        const prefix = final ? "recognized" : "recognizing"
        const text = result.Alternatives[0].Transcript
        console.log(`${prefix} text: ${text}`)
    })

someStream.pipe(transcribeStream)

All 16 comments

@dominiceden

Thanks for opening this feature request. We're reviewing the best way to support this in the SDK.

@srchase Great, thanks for the quick response! I'll keep my eyes on this one then.

+1 ... also looking for support in js sdk; i have a current web app that I would love to port to aws.

Is any work being done on this? I'd love to get a look at it. thanks.

Looking forward too. Is there another way to use this feature for now? Thank you.

StartStreamTranscription requires HTTP2, which is not available in the SDK currently.

HTTP2 is likely going to be made available in the Version 3 of the SDK. I've tagged this issue as 'needs-major-version' to reflect that direction for this request.

If you haven't already, give V3 a look. We'd love any feedback while it's in Developer Preview.

Would enforcing the use of StartStreamTranscription not be applicable via the use of existing web-socket libraries? I am wondering what is the particular need for the use of HTTP2 in this regard. Thankyou.

Is there any package that supports this service on node.js?

Any progress on this? If not, could you please comment on a specific question about implementing this on my own: https://forums.aws.amazon.com/thread.jspa?messageID=896709

The question there is about the event stream encoding, as well as the broad 200 response that simply says

{
  "Output":{
    "__type":"com.amazon.coral.service#SerializationException"
  },
  "Version":"1.0"
}

Any progress on this? If not, could you please comment on a specific question about implementing this on my own: https://forums.aws.amazon.com/thread.jspa?messageID=896709

The question there is about the event stream encoding, as well as the broad 200 response that simply says

{
  "Output":{
    "__type":"com.amazon.coral.service#SerializationException"
  },
  "Version":"1.0"
}

Hi @formigone , i'm with this same problem, you found any solution ?

Is there any package that supports this service on node.js?

I am also looking for the same . Please let me know if anyone found the solution.

Hi @srchase ,
Referring to the official doc ,i am able to make a session with AWS streaming transcribe service and getting proper response .

Now when i am trying to pass audio chunk in eventMessage , i am getting error
message-type aexception{"Message":"Could not process the audio stream that you provided. Try your request again."}

Please refer to my Code , Any help would be much appreciated

aws_streaming_transcribe_demo.zip

.

I too am running into the same issue "Could not process the audio stream that you provided". Are there any solutions to this? Now that Google doesn't allow electron to use STT I fear I've run out of options.

馃憢
Would it be possible to implement this in the node SDK via web socket rather then HTTP2?
As per the AWS example, amazon-transcribe-websocket-static?

I had a similar requirement for using the AWS transcribe service with their WebSocket API in node js. Seeing as there was no support for this in the official package as of yet, I have gone ahead and written a package that is called AWS-transcribe and can be found here. I hope that helps.

It provides a stream interface around the WebSocket, and can be used like the below example

import { AwsTranscribe, StreamingClient } from "aws-transcribe"

const client = new AwsTranscribe({
    // if these aren't provided, they will be taken from the environment
    accessKeyId: "ACCESS KEY HERE",
    secretAccessKey: "SECRET KEY HERE",
})

const transcribeStream = client
    .createStreamingClient({
        region: "eu-west-1",
        sampleRate,
        languageCode: "en-US",
    })
    // enums for returning the event names which the stream will emit
    .on(StreamingClient.EVENTS.OPEN, () => console.log(`transcribe connection opened`))
    .on(StreamingClient.EVENTS.ERROR, console.error)
    .on(StreamingClient.EVENTS.CLOSE, () => console.log(`transcribe connection closed`))
    .on(StreamingClient.EVENTS.DATA, (data) => {
        const results = data.Transcript.Results

        if (!results || results.length === 0) {
            return
        }

        const result = results[0]
        const final = !result.IsPartial
        const prefix = final ? "recognized" : "recognizing"
        const text = result.Alternatives[0].Transcript
        console.log(`${prefix} text: ${text}`)
    })

someStream.pipe(transcribeStream)

Please add this to your SDK so I don't have to give IBM money

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jaggu07 picture jaggu07  路  3Comments

ataraxus picture ataraxus  路  4Comments

hashans picture hashans  路  3Comments

Sunil6591 picture Sunil6591  路  4Comments

ddo88 picture ddo88  路  3Comments