thainph/node-trans

Real-time audio translation app

125

stars

54

commits

JavaScript

primary language

Jul 9, 2026

updated

README

Node Trans

Real-time audio transcription and translation app. Captures audio from microphone, system audio, or both. Supports two transcription modes: Soniox (cloud, built-in translation) and Local Whisper (fully offline).

Runs as a web app (browser) or desktop app (Electron). Supports macOS, Windows, and Linux.


Features

  • Real-time speech-to-text with live partial results
  • Automatic translation (cloud via Soniox, or local via Ollama / LibreTranslate)
  • Speaker diarization — identifies who is speaking (Speaker 1, Speaker 2, ...)
  • Session history with speaker renaming and Markdown export
  • Always-on-top overlay window (Electron)
  • Bilingual UI (English / Vietnamese)

Quick Start

npm install
npm run start      # web app — open http://localhost:3000

For Electron:

npm run electron:dev

See DEV-BUILD.md for build instructions and troubleshooting.


Hardware Requirements

Only relevant for Local Whisper mode. Soniox only needs an internet connection.

macOS

ConfigRAMUsable features
Minimum8 GBWhisper tiny/base + Ollama gemma3:1b, no diarization
RecommendedApple Silicon 16 GBWhisper medium/large-v3-turbo + Ollama gemma3:4b + diarization
OptimalApple Silicon 32 GBAll features with large models, very smooth

Apple Silicon recommended (M1+): unified memory allows CPU and GPU to share RAM — Whisper (Metal), Ollama (Metal), and diarization (MPS) are all hardware-accelerated, 4–6× faster than Intel at the same model size.

Windows

ConfigRAMGPUUsable features
Minimum16 GBNoneWhisper tiny/base + small Ollama (slow), no diarization
Recommended16 GBNVIDIA 8 GB VRAM (RTX 3060+)Whisper medium + Ollama gemma3:4b + diarization
Optimal32 GBNVIDIA 12 GB+ VRAM (RTX 4070 Ti+)All features comfortably

AMD GPUs are not supported. Without an NVIDIA GPU, diarization cannot run in real-time. Install CUDA Toolkit for GPU acceleration.

Linux

ConfigRAMGPUUsable features
Minimum16 GBNoneWhisper tiny/base + small Ollama (slow), no diarization
Recommended16 GBNVIDIA 8 GB VRAM (RTX 3060+)Whisper medium + Ollama gemma3:4b + diarization
Optimal32 GBNVIDIA 12 GB+ VRAM (RTX 4070 Ti+)All features comfortably

Requires PulseAudio or PipeWire (with PulseAudio compatibility) for audio device management. Most modern distros (Ubuntu 22.04+, Fedora, etc.) include one of these by default. Install ffmpeg via your package manager (sudo apt install ffmpeg).

Disk space (Local Whisper)

ComponentSize
Whisper base model~150 MB
Whisper large-v3-turbo model~1.6 GB
Ollama + gemma3:4b model~3.5 GB
Python venv for diarization (torch)~4–6 GB
pyannote diarization model~1 GB
Total (full setup)~10–12 GB

Soniox (Cloud)

Requires a free API key from soniox.com.

Configure in Settings → Engine → Soniox API Key, or via .env:

SONIOX_API_KEY=your_api_key_here

Soniox handles transcription, translation, and speaker diarization out of the box — no additional setup needed.


Local Whisper (Offline)

No API key required. All processing happens on-device.

1. Build whisper.cpp (one-time):

npm run setup:whisper

2. Download a model:

cd node_modules/nodejs-whisper/cpp/whisper.cpp
bash models/download-ggml-model.sh base   # or: tiny, small, medium, large-v3-turbo

3. Select in app: Settings → Engine → Local Whisper → choose your model.

4. Translation (optional): configure Ollama or LibreTranslate in Settings → Engine.

Whisper Models

ModelSizeRAMSpeedQuality
tiny~75 MB~1 GBVery fastLow
base~150 MB~1 GBFastMedium
small~500 MB~2 GBMediumGood
medium~1.5 GB~5 GBSlowHigh
large-v3-turbo~1.6 GB~4 GBMediumVery high
large~3 GB~8 GBSlowestBest

Recommended: large-v3-turbo on Apple Silicon, base on low-end hardware.


Speaker Diarization (Local Whisper)

Identifies individual speakers using pyannote-audio. Requires Python 3.10–3.12 and a free HuggingFace token.

1. Install Python dependencies:

npm run setup:diarize

Or via the UI: Settings → Engine → Setup Diarization.

2. Create a HuggingFace READ token at huggingface.co/settings/tokens, then accept terms for:

3. Enter the token in Settings → Engine → HuggingFace Token.

On first use, the app downloads ~1 GB of models. Subsequent starts are ready in ~10–15 seconds.


System Audio Capture

System audio capture (from Zoom, Meet, YouTube, etc.) works natively — no virtual audio drivers needed. Pre-built binaries are included in the repo.

  • macOS: ScreenCaptureKit (requires Screen Recording permission, macOS 13+)

  • Windows: WASAPI loopback (no special permissions needed)

  • Linux: PulseAudio / PipeWire monitor sources (via ffmpeg)

To rebuild from source: npm run setup:audiocap (requires Swift on macOS, .NET 8 SDK for Windows cross-compile)


Documentation

FileContents
DEV-BUILD.mdDevelopment setup, build commands, troubleshooting
ARCHITECTURE.mdSystem architecture, data flow, component overview

Tech Stack

LayerTechnology
FrontendReact 19, Vite, Tailwind CSS v4, Socket.IO Client
BackendNode.js, Express 5, Socket.IO
DesktopElectron
Audio capture (mic)ffmpeg (avfoundation / dshow / pulse)
Audio capture (sys)audiocap (macOS / Windows), ffmpeg+pulse (Linux)
STT (cloud)Soniox API
STT (local)nodejs-whisper (whisper.cpp)
Speaker diarizationpyannote-audio 3.1 (Python)
Translation (local)Ollama / LibreTranslate
DatabaseSQLite (better-sqlite3)

Contributors

thainph

51 commits

collyn

3 commits

thainph/node-trans

Real-time audio translation app

125

stars

54

commits

JavaScript

primary language

Jul 9, 2026

updated

README

Node Trans

Real-time audio transcription and translation app. Captures audio from microphone, system audio, or both. Supports two transcription modes: Soniox (cloud, built-in translation) and Local Whisper (fully offline).

Runs as a web app (browser) or desktop app (Electron). Supports macOS, Windows, and Linux.


Features

  • Real-time speech-to-text with live partial results
  • Automatic translation (cloud via Soniox, or local via Ollama / LibreTranslate)
  • Speaker diarization — identifies who is speaking (Speaker 1, Speaker 2, ...)
  • Session history with speaker renaming and Markdown export
  • Always-on-top overlay window (Electron)
  • Bilingual UI (English / Vietnamese)

Quick Start

npm install
npm run start      # web app — open http://localhost:3000

For Electron:

npm run electron:dev

See DEV-BUILD.md for build instructions and troubleshooting.


Hardware Requirements

Only relevant for Local Whisper mode. Soniox only needs an internet connection.

macOS

ConfigRAMUsable features
Minimum8 GBWhisper tiny/base + Ollama gemma3:1b, no diarization
RecommendedApple Silicon 16 GBWhisper medium/large-v3-turbo + Ollama gemma3:4b + diarization
OptimalApple Silicon 32 GBAll features with large models, very smooth

Apple Silicon recommended (M1+): unified memory allows CPU and GPU to share RAM — Whisper (Metal), Ollama (Metal), and diarization (MPS) are all hardware-accelerated, 4–6× faster than Intel at the same model size.

Windows

ConfigRAMGPUUsable features
Minimum16 GBNoneWhisper tiny/base + small Ollama (slow), no diarization
Recommended16 GBNVIDIA 8 GB VRAM (RTX 3060+)Whisper medium + Ollama gemma3:4b + diarization
Optimal32 GBNVIDIA 12 GB+ VRAM (RTX 4070 Ti+)All features comfortably

AMD GPUs are not supported. Without an NVIDIA GPU, diarization cannot run in real-time. Install CUDA Toolkit for GPU acceleration.

Linux

ConfigRAMGPUUsable features
Minimum16 GBNoneWhisper tiny/base + small Ollama (slow), no diarization
Recommended16 GBNVIDIA 8 GB VRAM (RTX 3060+)Whisper medium + Ollama gemma3:4b + diarization
Optimal32 GBNVIDIA 12 GB+ VRAM (RTX 4070 Ti+)All features comfortably

Requires PulseAudio or PipeWire (with PulseAudio compatibility) for audio device management. Most modern distros (Ubuntu 22.04+, Fedora, etc.) include one of these by default. Install ffmpeg via your package manager (sudo apt install ffmpeg).

Disk space (Local Whisper)

ComponentSize
Whisper base model~150 MB
Whisper large-v3-turbo model~1.6 GB
Ollama + gemma3:4b model~3.5 GB
Python venv for diarization (torch)~4–6 GB
pyannote diarization model~1 GB
Total (full setup)~10–12 GB

Soniox (Cloud)

Requires a free API key from soniox.com.

Configure in Settings → Engine → Soniox API Key, or via .env:

SONIOX_API_KEY=your_api_key_here

Soniox handles transcription, translation, and speaker diarization out of the box — no additional setup needed.


Local Whisper (Offline)

No API key required. All processing happens on-device.

1. Build whisper.cpp (one-time):

npm run setup:whisper

2. Download a model:

cd node_modules/nodejs-whisper/cpp/whisper.cpp
bash models/download-ggml-model.sh base   # or: tiny, small, medium, large-v3-turbo

3. Select in app: Settings → Engine → Local Whisper → choose your model.

4. Translation (optional): configure Ollama or LibreTranslate in Settings → Engine.

Whisper Models

ModelSizeRAMSpeedQuality
tiny~75 MB~1 GBVery fastLow
base~150 MB~1 GBFastMedium
small~500 MB~2 GBMediumGood
medium~1.5 GB~5 GBSlowHigh
large-v3-turbo~1.6 GB~4 GBMediumVery high
large~3 GB~8 GBSlowestBest

Recommended: large-v3-turbo on Apple Silicon, base on low-end hardware.


Speaker Diarization (Local Whisper)

Identifies individual speakers using pyannote-audio. Requires Python 3.10–3.12 and a free HuggingFace token.

1. Install Python dependencies:

npm run setup:diarize

Or via the UI: Settings → Engine → Setup Diarization.

2. Create a HuggingFace READ token at huggingface.co/settings/tokens, then accept terms for:

3. Enter the token in Settings → Engine → HuggingFace Token.

On first use, the app downloads ~1 GB of models. Subsequent starts are ready in ~10–15 seconds.


System Audio Capture

System audio capture (from Zoom, Meet, YouTube, etc.) works natively — no virtual audio drivers needed. Pre-built binaries are included in the repo.

  • macOS: ScreenCaptureKit (requires Screen Recording permission, macOS 13+)

  • Windows: WASAPI loopback (no special permissions needed)

  • Linux: PulseAudio / PipeWire monitor sources (via ffmpeg)

To rebuild from source: npm run setup:audiocap (requires Swift on macOS, .NET 8 SDK for Windows cross-compile)


Documentation

FileContents
DEV-BUILD.mdDevelopment setup, build commands, troubleshooting
ARCHITECTURE.mdSystem architecture, data flow, component overview

Tech Stack

LayerTechnology
FrontendReact 19, Vite, Tailwind CSS v4, Socket.IO Client
BackendNode.js, Express 5, Socket.IO
DesktopElectron
Audio capture (mic)ffmpeg (avfoundation / dshow / pulse)
Audio capture (sys)audiocap (macOS / Windows), ffmpeg+pulse (Linux)
STT (cloud)Soniox API
STT (local)nodejs-whisper (whisper.cpp)
Speaker diarizationpyannote-audio 3.1 (Python)
Translation (local)Ollama / LibreTranslate
DatabaseSQLite (better-sqlite3)

Contributors

thainph

51 commits

collyn

3 commits

Languages

JavaScript

82.5%

Python

6.8%

CSS

4.4%

Swift

3.5%

C#

1.5%

HTML

1.3%