ALPHA
This is a basic express server that shows the basic setup for live audio transcriptions using Deepgram.
The code can be found in the following places:
- Client side code: /public/client.js
- HTML: /public/index.html
- Server side code: /server.js
This code gets access to the users microphone which will be used as the audio input. Once data is available from the microphone, it gets sent to the server via websocket.
When data comes back from the server on the print-transcript
event, it takes the text and adds it to the body.
The server code creates a new web socket called globalSocket
that communicates with the client. When data comes in from the client it then sends that data to Deepgram via the SDK. (Note that the Deepgram SDK is just setting up a websocket connection with Deepgram).
Create a .env
file with your own Deepgram API Key.
Run the following commands to install the dependencies and run the application
npm i
npm run dev
Once the server is running, open the following url in the browser
http://localhost:3000/
Click on the button when you're ready to transcribe.