Voice Prompt
VS Code extension for voice-to-text transcription using Whisper STT.
Features
- Voice recording with real-time timer
- Speech-to-text using local Whisper model
- Auto-download Whisper models from Hugging Face
- Insert transcribed text at cursor position
- Copy to clipboard
- Transcription history (last 10 items)
- Keyboard shortcut support
Development Setup
Prerequisites
- Node.js 18+
- VS Code 1.85+
Installation
npm install
npm run compile
Testing the Extension
Method 1: Using F5 (Recommended)
- Open this project in VS Code
- Press
F5 to launch Extension Development Host
- A new VS Code window will open with the extension loaded
Method 2: Using Debug Panel
- Open this project in VS Code
- Go to Run and Debug panel (
Cmd+Shift+D)
- Select "Run Extension" from the dropdown
- Click the green play button
Method 3: Watch Mode
npm run watch
Then press F5 to launch. Changes will auto-compile.
Using the Extension
Start Recording
- Click the microphone icon in the status bar (bottom right)
- Or press
Cmd+Shift+V (Mac) / Ctrl+Shift+V (Windows/Linux)
- Or open Command Palette (
Cmd+Shift+P) and search "Voice Prompt: Start Recording"
In the Voice Prompt Panel
- Click the microphone button to start recording
- Speak into your microphone
- Click again to stop recording
- Wait for transcription to complete
- Use the buttons:
- Copy to Clipboard: Copy the transcribed text
- Insert at Cursor: Insert text at current editor cursor
- Clear: Clear the text area
Microphone Permission (macOS)
If you see a microphone permission error:
- Open System Settings
- Go to Privacy & Security > Microphone
- Enable Visual Studio Code
- Restart VS Code
Or click the "Open System Settings" button in the error message.
Configuration
Open VS Code Settings and search for "Voice Prompt":
| Setting |
Default |
Description |
voiceprompt.whisperModel |
tiny |
Whisper model size (tiny/base/small) |
Model Sizes
| Model |
Size |
Speed |
Accuracy |
| tiny |
75 MB |
Fastest |
Good |
| base |
142 MB |
Fast |
Better |
| small |
466 MB |
Moderate |
Best |
Project Structure
voiceprompt/
├── src/
│ ├── extension.ts # Extension entry point
│ ├── whisperService.ts # Whisper STT integration
│ ├── modelDownloader.ts # Model auto-download
│ ├── historyService.ts # Transcription history
│ └── webview/
│ └── webviewProvider.ts # Recording UI panel
├── .vscode/
│ ├── launch.json # Debug configuration
│ └── tasks.json # Build tasks
├── package.json
└── tsconfig.json
Scripts
npm run compile # Build the extension
npm run watch # Build and watch for changes
npm run lint # Run ESLint
| |