This open-source repo demonstrates how to create live video captions using AssemblyAI's real-time API!
This app uses a web camera to record live video. It will also grab an audio stream from the user's computer and then send that over a WebSocket to AssemblyAI for real-time transcription. Once AssemblyAI begins transcribing, live captions will be displayed on the video. This is accomplished using Express for our backend and Vanilla JavaScript with the npm package recordrtc for our front-end.
- Before running this app, you need to upgrade your AssemblyAI account. The real-time API is only available to upgraded accounts at this time.
- Running the app before upgrading will cause an error with a 402 status code.
⚠️ - To upgrade your account you need to add a card. You can do that in your dashboard here!
- Clone the repo to your local machine.
- Open the terminal in the root directory of the project.
- Run
npm install
to install all dependencies. - Create a
.env
file in the project root and add this line with your API Key
API_KEY=<YOUR API KEY HERE>
- While still in the root directory, start the server with the command
npm run start
(will run on port 8000). - Open a second terminal in the root directory of the project and start the client side with
npm run client
(will run on port 3000). - Navigate to http://localhost:3000 in your browser and click "Start Recording" to see the live captions!
If you have any questions, please feel free to reach out to our Support team - support@assemblyai.com!