Skip to content

Commit d41ef3c

Browse files
committed
feat: initial commit - gives us browser 'only' transcription
0 parents  commit d41ef3c

9 files changed

+1447
-0
lines changed

.env.example

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
DEEPGRAM_API_KEY=your-deepgram-api-key

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
.env

README.md

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Deepgram Live Transcriptions Example
2+
3+
This is a basic express server that shows the basic setup for live audio transcriptions using Deepgram.
4+
5+
The code can be found in the following places:
6+
7+
- Client side code: [/public/client.js](/public/client.js)
8+
- HTML: [/public/index.html](/index.html)
9+
- Server side code: [/server.js](/server.js)
10+
11+
## Client code
12+
13+
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.
14+
15+
When data comes back from the server on the `print-transcript` event, it takes the text and adds it to the body.
16+
17+
## Server code
18+
19+
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).
20+
21+
## Running the application locally
22+
23+
Create a `.env` file with your own Deepgram API Key.
24+
25+
Run the following commands to install the dependencies and run the application
26+
27+
```
28+
npm i
29+
npm run start
30+
```
31+
32+
## Accessing the running application in your browser
33+
34+
Once the server is running, open the following url in the browser
35+
36+
```
37+
http://localhost:3000/
38+
```
39+
40+
Click on the button when you're ready to transcribe.

0 commit comments

Comments
 (0)