I am working with @aws-sdk/client-transcribe-streaming package with Node js. My code is working fine for single stream. When I create multiple clients of TranscribeStreamingClient for handling different streams at the same time then only first client is working and other clients are on hold until the first client's connection has been closed. So how can I get parallel response and end stream using above package. My code is written below
const {TranscribeStreamingClient,StartStreamTranscriptionCommand} = require("@aws-sdk/client-transcribe-streaming");
let client = new TranscribeStreamingClient({
credentials: config.get("amazon.credentials"),
region: config.get("amazon.region"),
});
let streamResponse = await client.send(
new StartStreamTranscriptionCommand({
LanguageCode: this.audioConfig.languageCode,
MediaSampleRateHertz: this.audioConfig.sampleRateHertz,
MediaEncoding: this.audioConfig.encoding,
AudioStream: audioStream(),
}),
);
client.destroy();
I want parallel stream response and end stream as well
I have also follow and look below link but not found any thing for parallel stream. https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-transcribe-streaming/index.html#send-the-speech-stream