Registry / ai-ml / aws-transcribe

aws-transcribe

JSON →
library1.1.1jsnpmunverified

A client for Amazon Transcribe using the websocket interface. This package is deprecated (v1.1.1, last released 2020) and no longer maintained. It provides a streaming client for real-time speech transcription via WebSocket, with support for a subset of AWS regions and language codes. Users should migrate to the official AWS SDK @aws-sdk/client-transcribe.

npm install aws-transcribe
INSTALL
IMPORT
SIG · AWS-TRANSCRIBE
A
aws-transcribe
ai-mljavascriptv1.1.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

AwsTranscribe
import { AwsTranscribe } from 'aws-transcribe'
const AwsTranscribe = require('aws-transcribe')
Default export was also available, but named import is recommended. CommonJS require works but may cause issues in ESM projects.
StreamingClient
import { StreamingClient } from 'aws-transcribe'
const StreamingClient = require('aws-transcribe').StreamingClient
Named import for the streaming client wrapper.
TranscriptEvent
import { TranscriptEvent } from 'aws-transcribe'
TypeScript type for event data. Not needed for JavaScript but useful for type safety.

Shows how to transcribe audio from a file by piping it to a streaming client.

import { AwsTranscribe, StreamingClient, TranscriptEvent } from 'aws-transcribe' import { createReadStream } from 'fs' const client = new AwsTranscribe({ accessKeyId: process.env.AWS_ACCESS_KEY_ID ?? '', secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY ?? '', }) const transcribeStream = client .createStreamingClient({ region: 'us-east-1', sampleRate: 16000, languageCode: 'en-US', }) .on(StreamingClient.EVENTS.OPEN, () => console.log('Connection opened')) .on(StreamingClient.EVENTS.ERROR, console.error) .on(StreamingClient.EVENTS.DATA, (data: TranscriptEvent) => { const results = data.Transcript.Results if (!results || results.length === 0) return const result = results[0] const final = !result.IsPartial console.log(`${final ? 'Final' : 'Interim'}: ${result.Alternatives[0].Transcript}`) }) createReadStream('audio.raw').pipe(transcribeStream)
Debug
Known issues
deprecatedPackage is deprecated and no longer maintained.
fix
Migrate to @aws-sdk/client-transcribe from the official AWS SDK.
affects: >=1.0.0
breakingThe aws-sdk dependency (v2) may cause conflicts with newer AWS SDK v3 in the same project.
fix
Avoid mixing v2 and v3 SDKs; use only aws-sdk v2 if using this package.
affects: >=1.0.0
gotchaCommonJS require may not work in ESM-only environments.
fix
Use import syntax or dynamic import if in ESM context.
affects: >=1.0.0
Errors
Common errors & fixes
Cannot find module 'aws-sdk'
aws-sdk is a peer dependency not installed automatically.
fix
Run npm install aws-sdk@2 to install the required peer dependency.
TypeError: client.createStreamingClient is not a function
Misconfigured AwsTranscribe instance; missing or incorrect clientConfig.
fix
Ensure you pass valid accessKeyId and secretAccessKey.
Error: Region must be one of...
Invalid region code provided.
fix
Use a supported region: us-east-1, us-east-2, us-west-2, ap-southeast-2, ca-central-1, eu-west-1.
Upgrade
Version history
1.1.1latest on npm
Audit
Dependencies
aws-sdkrequiredUsed to generate presigned URLs for WebSocket connection
Agent activity
22 hits · last 30 days
node
18
Amazon
1
OpenAI (training)
1
Resources