This web application, built with Next.js and React, provides near-realtime speech-to-text transcription using chunked audio processing and AssemblyAI's async transcription API.
- Async chunking audio recording and chunking in the browser
- Asynchronous transcription using AssemblyAI API
- Ordered transcript display in real-time
- Configurable chunk size
- Support for multiple languages (based on AssemblyAI's capabilities)
- Node.js (v14 or later recommended)
- npm package manager
- AssemblyAI API key
-
Clone the repository:
git clone https://github.com/zkleb-aai/async-chunk-react-next-js.git cd async-chunk-react-next-js -
Install dependencies:
npm install -
Create a
.env.localfile in the root directory and add your AssemblyAI API key:ASSEMBLYAI_API_KEY=your_api_key_here
-
Start the development server:
npm run dev -
Open your browser and navigate to
http://localhost:3000 -
Use the interface to set the chunk size, start/stop recording, and view the real-time transcription.
- Chunk Size: Adjustable in the web interface
- Language settings: Modify
api/transcribe/route.tsto change language or enable detection
src/app/page.tsx: Main application componentsrc/app/api/transcribe/route.ts: API route for transcription tasks
Ensure:
- Your microphone is properly connected
- AssemblyAI API key is correctly set in
.env.local - You have a stable internet connection
Check the browser console for error messages if issues persist.
- Implement Voice Activity Detection (VAD) if a suitable library is found
- Allow overlap logic to ensure context isn't lost if VAD remains unavailable
Contributions are welcome. Please submit a Pull Request or create an Issue to discuss potential changes/additions.