awsdocs / amazon-transcribe-developer-guide

The open source version of the Amazon Transcribe docs. You can submit feedback & requests for changes by submitting issues in this repo or by making proposed changes & submitting a pull request.
Other
25 stars 26 forks source link

Include Examples of Event-Stream encoding #6

Closed asymness closed 1 year ago

asymness commented 5 years ago

Hi, I am trying to use Amazon Stream Transcription service with Python using the HTTP/2 interface. The documentation page that I am following is located here: https://docs.aws.amazon.com/transcribe/latest/dg/streaming-format.html#event-stream I have completed step 1 and 2 as shown in the example request and response. However, I am not able to figure out how toevent stream encode an audio event. Since this is a relatively new concept as well as HTTP/2 itself. It would be greatly helpful if you can include some example code on how to encode an audio event using some high-level language like Python. I was not able to find any material relevant to this concept on the internet. Thanks!

ffernandomaximo commented 4 years ago

Hi @asymness did you find out how to use event stream encode? I am also trying to do it, using HTTP/2,

Thanks

ceuk commented 4 years ago

If possible I'd suggest using the fairly new Websocket API. The HTTP/2 api was pretty unviable for anything except Java last time I checked (around September 2019, might have moved on since then)

marioDatatris commented 3 years ago

Has there been any progress?.Has any example been added? I have opened several support cases with the developer plan and I have no response.

marioDatatris commented 3 years ago

If possible I'd suggest using the fairly new Websocket API. The HTTP/2 api was pretty unviable for anything except Java last time I checked (around September 2019, might have moved on since then)

Do you know any example of how to generate the event stream encoding for websocket? I found someone trying it without success: Link

ceuk commented 3 years ago

Hi @marioDatatris I've built a polyfill for native browser speech recognition that uses the websocket API. There's instructions on how to get set up on AWS and the source code should be fairly simple to interpret hopefully.

You can find it here: https://github.com/ceuk/speech-recognition-aws-polyfill

Also happy to answer any questions if you run into any issues

marioDatatris commented 3 years ago

Hi @marioDatatris I've built a polyfill for native browser speech recognition that uses the websocket API. There's instructions on how to get set up on AWS and the source code should be fairly simple to interpret hopefully.

You can find it here: https://github.com/ceuk/speech-recognition-aws-polyfill

Also happy to answer any questions if you run into any issues

I really appreciate your reply.

I have seen that in python, following the indicated example (https://stackoverflow.com/questions/57875522/bad-request-exception-when-trying-to-use-aws-transcribe-using-python-to-transc) creates the json structure but the creation of the event audio is missing.

For them, after creating the json you use "EventStreamMarshaller". I have not seen anything like it for python. Looking for something similar I have found the following: https://aws.amazon.com/es/blogs/developer/transcribe-streaming-sdk-for-python-preview/, a preview new feature.

I'm going to see if I can figure it out. Thank you very much again.

mildsunrise commented 3 years ago

For the record: remember that the documentation is incorrect and incomplete, see #8.

Also if you're looking for an implementation in Node.js, see this example which uses my a4s library.

Remember also that, even when not mentioned anywhere on the docs, the audio chunks apparently need to have equal size, and there are restrictions on what that size can be.

mildsunrise commented 3 years ago

More docs / examples of event stream encoding can be found in AWS official eventstream library for Java (and its tests): https://github.com/awslabs/aws-eventstream-java/blob/master/src/test/java/software/amazon/eventstream/MessageTest.java

nikilsprouts commented 2 years ago

Hi @marioDatatris were you able to get the event stream coding to work in python with websocket? I cannot find any example of python version of Amazon Transcribe Service working with websockets.

joshbean commented 1 year ago

Closing this issue or pull request in advance of archiving this repo. For more information about the decision to archive this repo (and others in the 'awsdocs' org), see the announcement on the AWS News Blog.