use-whisper  by chengsokdara

React hook for OpenAI Whisper API with speech recorder

Created 2 years ago
779 stars

Top 44.9% on SourcePulse

GitHubView on GitHub
Project Summary

This React hook simplifies integrating OpenAI's Whisper API into web applications, offering built-in speech recording, real-time transcription, and silence removal. It targets React developers seeking to add voice input and transcription capabilities to their projects, providing a convenient abstraction over complex audio processing and API interactions.

How It Works

The hook leverages browser Web Audio APIs for recording and integrates libraries like recordrtc for cross-browser compatibility and lamejs for MP3 encoding. For silence removal, it utilizes @ffmpeg/ffmpeg. The core functionality involves capturing audio, optionally processing it (silence removal), and sending it to the OpenAI Whisper API for transcription. It supports both direct API calls and custom server integration for enhanced security and control.

Quick Start & Requirements

Highlighted Details

  • Real-time streaming transcription with configurable timeSlice.
  • Silence removal feature to reduce API costs.
  • nonStop recording option with stopTimeout.
  • Customizable Whisper API parameters (language, response_format, temperature, prompt).
  • Option to handle transcription via a custom server (onTranscribe callback).

Maintenance & Community

The project is actively developed by chengsokdara, with a roadmap including React Native support. Contact information for development services is provided.

Licensing & Compatibility

The README does not explicitly state a license. Compatibility for commercial use or closed-source linking is not specified.

Limitations & Caveats

The project is primarily focused on web applications; React Native support is under development. The lack of an explicit license may pose a risk for commercial adoption.

Health Check
Last Commit

1 year ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
5 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.