Real-time captions
This project implements a real-time speech-to-text transcription service with optional translation capabilities using React, Next.js, Deepgram for speech recognition, and Groq for translation.
Features
- Real-time speech-to-text transcription
- Optional automatic translation to English
- Toggle switch for enabling/disabling translation
Technologies Used
- React
- Next.js
- Deepgram API for speech recognition
- Groq API for translation
- Framer Motion for animations
- Tailwind CSS for styling
Setup
- Clone the repository
- Install dependencies:
pnpm install
- Set up environment variables:
DEEPGRAM_API_KEY
: Your Deepgram API key
GROQ_API_KEY
: Your Groq API key
- Run the development server:
pnpm run dev
API Routes
/api/authenticate
: Provides the Deepgram API key to the client
/api/translate
: Handles text translation using the Groq API
Usage
- Start the application
- Grant microphone access when prompted
- Speak into the microphone to see real-time transcription
- Toggle the switch to enable/disable automatic translation to English
Notes
- The transcription is set up for Spanish (
es-ES
) by default. Modify the language parameter in connectToDeepgram
to change the input language.
- The translation service uses Groq's
gemma-7b-it
model for English translation.