I am trying to use the @aws-sdk/client-transcribe-streaming in an Angular project, without any luck.
The below code is the only example provided by AWS
// ES6+ example
import {
TranscribeStreamingClient,
StartStreamTranscriptionCommand,
} from "@aws-sdk/client-transcribe-streaming";
// a client can be shared by different commands.
const client = new TranscribeStreamingClient({ region: "REGION" });
const params = {
/** input parameters */
};
const command = new StartStreamTranscriptionCommand(params);
As said by the SDK's documentation, the StartStreamTranscriptionCommand
object expects the params
parameter to be of type StartStreamTranscriptionCommandInput.
This StartStreamTranscriptionCommandInput
object has an AudioStream
field that is of type AsyncIterable<AudioStream>
, which is, I assume, the audio stream that will be sent to be transcribed by AWS.
The problem is that I don't know how to create this AudioStream
object, and the only hint that the documentation gives us is that it is a "PCM-encoded stream of audio blobs. The audio stream is encoded as an HTTP2 data frame."
Any help on how to create an AsyncIterable<AudioStream>
will be greatly appreciated.
It turns out that they removed the only explanation on how to get this AsyncIterable<AudioStream>
from their readme for some reason. By searching through their GitHub issues, someone pointed me to this old version of the readme from an old commit. This version contains a few examples on how to create this object.