-
Notifications
You must be signed in to change notification settings - Fork 603
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: support bi-directional transcribe streaming over Websocket #1216
Conversation
fix: uuid not available in rn
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
cf3c4cd
to
e98d94d
Compare
...ain/java/software/amazon/smithy/aws/typescript/codegen/AddTranscribeStreamingDependency.java
Outdated
Show resolved
Hide resolved
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, minor comments
...ain/java/software/amazon/smithy/aws/typescript/codegen/AddTranscribeStreamingDependency.java
Outdated
Show resolved
Hide resolved
Now this package can fully serialize & deserailize eventstream with web APIs. In browsers, it converts from user-side iterables of input structure to internal ReadableStream of binaries. In ReactNative, it converts from user-side iterables of input structure to internal iterables of binaries. The same applies to the other converting direction.
e98d94d
to
7e50b36
Compare
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
packages/middleware-sdk-transcribe-streaming/src/websocket-handler.ts
Outdated
Show resolved
Hide resolved
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
packages/middleware-sdk-transcribe-streaming/src/configuration.ts
Outdated
Show resolved
Hide resolved
packages/middleware-sdk-transcribe-streaming/src/configuration.ts
Outdated
Show resolved
Hide resolved
packages/middleware-sdk-transcribe-streaming/src/middleware-session-id.ts
Outdated
Show resolved
Hide resolved
packages/middleware-sdk-transcribe-streaming/src/middleware-session-id.ts
Outdated
Show resolved
Hide resolved
packages/middleware-sdk-transcribe-streaming/src/middleware-session-id.ts
Show resolved
Hide resolved
packages/middleware-sdk-transcribe-streaming/src/websocket-handler.ts
Outdated
Show resolved
Hide resolved
packages/middleware-sdk-transcribe-streaming/src/websocket-handler.ts
Outdated
Show resolved
Hide resolved
packages/middleware-sdk-transcribe-streaming/src/websocket-handler.ts
Outdated
Show resolved
Hide resolved
packages/middleware-sdk-transcribe-streaming/src/websocket-handler.ts
Outdated
Show resolved
Hide resolved
50bddce
to
90ef0e0
Compare
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just one minor comment
packages/middleware-sdk-transcribe-streaming/src/middleware-session-id.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Trivikram Kamat <[email protected]>
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clear from Java side.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread. |
Add customizations for Transcribe Streaming client to support bi-directional streaming in browsers over websocket. The client is compatible with ReactNative too. But currently there's no viable solution to access void record in chunks.
The customizations are in the
@aws-sdk/middleware-sdk-transcribe-streaming
package. They are crafted according to 'Using Amazon Transcribe Streaming with WebSockets'. The customizations are as below:middleware-endpoint
: convert original http endpoint to Websocket endpint. Supplying custome endpoints for TranscribeStreaming in browser may lead to unknow behaviormiddleware-session-id
: inject defaultsession-id
parameter in the request. Because websocket handler doesn't expose the request ID header from the response, we usesession-id
to map request to server-side logs. This middleware also inject other non-streaming response parameters likeLanguageCode
,MediaEncodeing
,MediaSampleRateHertz
, so that the SDK behavior is consistent in NodeJS runtime.signer
: SigV4-based signer used to sign websocket request. It signs the request by presigning the requestwebsocket-handler
: An Websocket handler wrapped in aRequestHandler
interface. The request's payload can beReadableStream
orAsyncIterable
. The response from it has payload inAsyncIterable
. But ifReadableStream
constructor is available in the environment, the response payload is prefered inReadableStream
. This is for interface consistency across the browsers. If any error thrown from input stream, the handler will close the WebSocket connection and throw error from response payload stream.TODO: Create a ReactNative library that emits recorder binary chunks so that RN users can supply recorder data to WebSocket API.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.