Skip to content

NxRoot/whisper-live

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Whisper Live (Offline Speech Recognition)

This project uses speech_recognition and faster_whisper to record live speech and transcribe it into text.

How to Install

Exe Description Releases
Download the latest version Download

Build from Source

git clone https://github.com/NxRoot/whisper-live.git
Create a Virtual Environment
Win32
python -m venv venv
MacOS
python3 -m venv venv
Activate the Virtual Environment
Win32
.\venv\Scripts\activate
MacOS
source venv/lib/activate
Install Required Modules
Win32
pip install -r requirements.txt
MacOS
pip3 install -r requirements.txt
Test the Application
Win32
python main.py
MacOS
python3 main.py
Build into Executable
Make sure you have PyInstaller in your virtual environment.
Win32
pyinstaller --name wl --onedir main.py --icon icon.ico --add-data "model;model"

You can use the --onefile argument instead of --onedir to build a portable version.

MacOS
pyinstaller --name wl --onedir main.py --icon icon.ico --add-data "model:model" --paths=./venv/lib/python3.10/site-packages

Make sure the --paths argument is aligned with your python version.

 

Custom Execution

This can be executed from a terminal or called from another app.

Default

wl.exe

Show Info

wl.exe --verbose

Debug Logs

wl.exe --verbose > logs.txt

Call Examples

Make sure you place wl.exe in the same folder as index.js

NodeJS

const { join } = require("path");
const { spawn } = require("child_process");

const ps = spawn(join(__dirname, "wl.exe"), ["--verbose"]);

ps.stdout.on("data", (data) => {
  console.log(`${data}`.trim());
});

ps.stderr.on("data", (data) => {
  console.error(`${data}`.trim());
});

Important Notes

  • Always clone the repo if you wish to build from source.
  • The model can take some time to load using portable versions.
  • On MacOS the SpeechRecognition module requires PortAudio installed.

 

⭐ If you find this useful!