This project allows you to dictate speech-to-text in real-time on any website. It uses Deepgram's API for transcription and a local Express server with WebSocket support.
-
Install & Configure
- The Express server proxies microphone audio for transcription.
- The bookmarklet injects a floating panel UI into any webpage.
-
Bookmarklet Installation
- Open the page at: http://localhost:3003/get-bookmarklet.html
This page displays the bookmarklet code for adding it to your browser. You can also click the link to test it.
- Open the page at: http://localhost:3003/get-bookmarklet.html
-
UI Development
- Edit the UI for the bookmarklet in
public/bookmarklet-template.html
.
This template holds HTML/CSS used when building the bookmarklet.
- Edit the UI for the bookmarklet in
-
Build Process
- Use the script
build-bookmarklet.ts
(located in thescripts
folder) to inject your JS code into the template and produce the final bookmarklet code.
- Use the script
git clone https://github.com/Christopher-Hayes/dictate-bookmarklet.git
cd dictate-bookmarklet
npm install
Create a .env
file:
echo "DEEPGRAM_API_KEY=your-deepgram-api-key-here" > .env
npm run start
✅ The server runs at: http://localhost:3003
- Open any website.
- Click the bookmarklet.
- A floating panel appears in the top-left corner.
- Click "Start Dictation."
- Your voice is transcribed in real-time.
- Drag or copy the transcript into any input field.
- Click "Stop Dictation" to end recording.
- Click "Hide" to close the panel.
📁 deepgram-bookmarklet
├── 📄 .env # Stores Deepgram API Key
├── 📁 src
│ ├── 📄 server.ts # Express server
│ ├── 📄 bookmarklet.js # Non-UI bookmarklet code
├── 📁 public
│ ├── 📄 local-dictate.html # Floating panel for speech-to-text
│ ├── 📄 bookmarklet-template.html # Template for bookmarklet UI
│ ├── 📄 get-bookmarklet.html # Displays the bookmarklet code
├── 📁 scripts
│ ├── 📄 build-bookmarklet.ts # Script to build the bookmarklet
└── 📄 README.md
- Solution: Allow mic permissions in browser settings.
- Solution: Ensure the Express server is running (
npm run start
).
- Solution: Check if Deepgram API Key is correct in
.env
.