Skip to content

Real-time captions with optional translation using Next.js.

Notifications You must be signed in to change notification settings

paratustra/captions

Repository files navigation

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

  1. Clone the repository
  2. Install dependencies: pnpm install
  3. Set up environment variables:
    • DEEPGRAM_API_KEY: Your Deepgram API key
    • GROQ_API_KEY: Your Groq API key
  4. 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

  1. Start the application
  2. Grant microphone access when prompted
  3. Speak into the microphone to see real-time transcription
  4. 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.

About

Real-time captions with optional translation using Next.js.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published