https://github.com/ublib/aws-speech-to-text
Amazon Transcribe's speech to text client for TypeScript.
https://github.com/ublib/aws-speech-to-text
amazon-transcribe amazon-transcribe-api api-client packaging speech-to-text type-safe typescript
Last synced: about 2 months ago
JSON representation
Amazon Transcribe's speech to text client for TypeScript.
- Host: GitHub
- URL: https://github.com/ublib/aws-speech-to-text
- Owner: ublib
- License: mit
- Created: 2023-12-16T11:38:30.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-03T04:55:09.000Z (almost 2 years ago)
- Last Synced: 2025-03-21T09:28:55.936Z (9 months ago)
- Topics: amazon-transcribe, amazon-transcribe-api, api-client, packaging, speech-to-text, type-safe, typescript
- Language: TypeScript
- Homepage:
- Size: 71.3 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: changelog.config.cjs
- License: LICENSE
Awesome Lists containing this project
README
# aws-speech-to-text
Amazon Transcribe's speech to text client for TypeScript.
status: early development (**not published**)
## Usage
### Basic Usage
```sh
npm install aws-s2t
# install amplify core if you don't have it (for signing)
npm install @aws-amplify/core
```
```ts
import { Credentials, Signer } from "@aws-amplify/core";
import { createTranscribeClient } from "aws-s2t";
const transcribe = createTranscribeClient(Signer, await Credentials.get(), {
region: "us-east-1",
languageCode: "en-US",
});
// send your audio rawChunks
const result = await transcribe(rawChunks);
console.log(result);
```
### Use with Recorder on Browser
```sh
npm install @aws-s2t/record
```
```ts
import { Credentials, Signer } from "@aws-amplify/core";
import { createTranscribeClient } from "aws-s2t";
import { AudioRecorder } from "@aws-s2t/record";
const transcribe = createTranscribeClient(Signer, await Credentials.get(), {
region: "us-east-1",
languageCode: "en-US",
});
const recorder = new AudioRecorder({
onStopped: async (rawChunks) => {
const result = await transcribe(rawChunks);
console.log(result);
},
});
// bind actions
document
.getElementById("start-btn")
?.addEventListener("click", () => recorder.start());
document
.getElementById("stop-btn")
?.addEventListener("click", () => recorder.stop());
```
### Streaming
WIP