A Neovim plugin for voice recording and transcription using Whisper models.
Before installing the plugin, ensure you have the following dependencies:
- Neovim >= 0.8.0
sox(for audio recording)ffmpeg(for audio processing)cmakeandmake(for building whisper.cpp)git(for installation)
brew install sox ffmpeg cmake make gitsudo apt-get update
sudo apt-get install sox ffmpeg cmake make gitUsing lazy.nvim
{
"ronjansen/voice.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
},
config = function()
require("voice").setup({
-- your configuration here
})
end
}Using vim-plug
Plug 'nvim-lua/plenary.nvim'
Plug 'ronjansen/voice.nvim'Then add to your init.lua:
require("voice").setup({
-- your configuration here
})Here's the default configuration:
require('voice').setup({
model = 'small', -- Whisper model size
backend = 'whisper.cpp', -- Backend ('whisper.cpp' or 'openai')
keymaps = {
toggle_recording = '<leader>r', -- Keybinding for recording
},
max_recording_seconds = 60, -- Max recording duration
openai = {
api_key = nil, -- Your OpenAI API key if using OpenAI backend
},
ui = {
show_recording_status = true, -- Show recording status in statusline
floating_window = true, -- Show transcription progress in floating window
}
})- Start recording by pressing
<leader>r(or your configured keybinding) - Speak clearly into your microphone (English is recommended)
- Press
<leader>ragain to stop recording - Wait for transcription to complete
- The transcribed text will appear at your cursor position
MIT License - See LICENSE file for details