Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nitaiaharoni1/whisper-speech-to-text
Whisper Speech-to-Text is a JavaScript library for recording and transcribing user audio into text via OpenAI's Whisper, intended for web applications.
https://github.com/nitaiaharoni1/whisper-speech-to-text
javascript openai openai-whisper react speech speech-recognition speech-to-text text-recognition typescript webapp whisper whisper-ai
Last synced: 17 days ago
JSON representation
Whisper Speech-to-Text is a JavaScript library for recording and transcribing user audio into text via OpenAI's Whisper, intended for web applications.
- Host: GitHub
- URL: https://github.com/nitaiaharoni1/whisper-speech-to-text
- Owner: nitaiaharoni1
- License: mit
- Created: 2023-05-05T14:36:46.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-05-06T18:10:28.000Z (over 1 year ago)
- Last Synced: 2024-04-29T19:07:08.824Z (6 months ago)
- Topics: javascript, openai, openai-whisper, react, speech, speech-recognition, speech-to-text, text-recognition, typescript, webapp, whisper, whisper-ai
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/whisper-speech-to-text
- Size: 184 KB
- Stars: 25
- Watchers: 1
- Forks: 7
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Whisper Speech-to-Text
Whisper Speech-to-Text is a JavaScript library that allows you to record audio from a user's microphone, and then
transcribe the audio into text using OpenAI's Whisper ASR system. This library is designed to be used in web
applications.## Features
- Real-time transcription of speech to text using OpenAI's Whisper ASR system.
- Easy to use API for starting, pausing, resuming, and stopping recordings.
- Automatic handling of microphone permissions and audio recording.## Installation
```bash
npm i whisper-speech-to-text
```## Usage
```typescript
// Import the WhisperSTT class from the library
import { WhisperSTT } from "whisper-speech-to-text";// Create a new instance of the WhisperSTT class, passing your OpenAI API key to the constructor
const whisper = new WhisperSTT("your-openai-api-key");// Start recording audio
await whisper.startRecording();// Pause the recording
await whisper.pauseRecording();// Resume the recording
await whisper.resumeRecording();// Stop the recording and get the transcription
await whisper.stopRecording((text) => {
console.log("Transcription:", text);
});
```## API
The `WhisperSTT` class has the following methods:
- `startRecording()`: Starts recording audio from the user's microphone.
- `pauseRecording()`: Pauses the current recording.
- `resumeRecording()`: Resumes a paused recording.
- `stopRecording(onFinish: (text: string) => void)`: Stops the current recording and transcribes the audio into text.
The transcription is passed to the `onFinish` callback.## Contributing
Contributions to this project are welcome! If you would like to contribute, please follow these steps:
1. Fork the repository on GitHub.
2. Clone your fork to your local machine.
3. Create a new branch for your changes.
4. Make your changes and commit them to your branch.
5. Push your changes to your fork on GitHub.
6. Open a pull request from your branch to the main repository.## Disclaimer
This library is not officially associated with OpenAI. Please use responsibly and ensure that your use case complies
with OpenAI's use case policy.## Support
If you encounter any problems or have any questions, please open an issue on the GitHub repository.