Record system audio and transcribe to text using AI
Project description
System audio to text
Record system audio and automatically transcribe to text using ✨AI✨.
Overview
sys2txt is a command-line tool that records your system audio (via PulseAudio/PipeWire monitor sources) with ffmpeg and transcribes it locally using Whisper. It supports both:
- On-demand: Record until you stop, then transcribe once
- Live-ish: Segment the recording every N seconds and transcribe each segment as it’s created (prints continuously)
You can use either the openai-whisper (Python) reference implementation or the faster-whisper engine if installed. The tool auto-selects faster-whisper when available for better speed on CPU and especially GPU.
Installation
Prerequisites
- Ubuntu with PulseAudio or PipeWire (default on modern Ubuntu)
- ffmpeg
- Python 3.9+ (recommended)
Install
- System packages
sudo apt update
sudo apt install -y ffmpeg python3-venv python3-pip
- Create a virtual environment and install sys2txt
cd sys2txt
python3 -m venv .venv
source .venv/bin/activate
pip install -e .
This installs both faster-whisper (for speed) and openai-whisper (reference implementation). The tool auto-selects faster-whisper when available or falls back to openai-whisper.
Quick start
Record and transcribe once (press Ctrl-C to stop recording):
sys2txt once --model small.en
Live segmented transcription (prints ongoing transcript every 8s by default; Ctrl-C to stop):
sys2txt live --model small.en --segment-seconds 8
Useful flags
--source <pulse_source_name>- Explicit PulseAudio/PipeWire source (e.g., alsa_output.pci-0000_00_1f.3.analog-stereo.monitor)--list-sources- List available Pulse sources and exit--model <size>- tiny|base|small|medium|large-v2 (default: small)--engine <auto|faster|whisper>- Force a specific engine (default: auto)--language <code>- Force language code (e.g., en). Omit to auto-detect--output <path>- Write final transcript to a file (in live mode, appends)--duration <seconds>- (once mode) Record fixed duration instead of waiting for Ctrl-C--segment-seconds <n>- (live mode) Segment length in seconds (default: 8)--timestamps- Print timestamps alongside text
Examples
Record 30s of system audio from the default monitor and transcribe:
sys2txt once --duration 30 --model small --output transcript.txt
Use a specific PulseAudio source:
sys2txt once --source alsa_output.usb-Focusrite_Scarlett.monitor --model base
Live mode with shorter latency and timestamps:
sys2txt live --segment-seconds 5 --timestamps
Force the reference openai-whisper engine:
sys2txt once --engine whisper --model base
Transcribe an existing audio file:
sys2txt once --input recording.wav --model small
Just want one-liners (no sys2txt)?
Find the default sink and its monitor source:
pactl get-default-sink
pactl list short sources | grep monitor
Record 30s of system audio from the default monitor to a WAV at 16 kHz mono (good for Whisper):
ffmpeg -hide_banner -loglevel error -f pulse -i "$(pactl get-default-sink).monitor" -ac 1 -ar 16000 -t 30 out.wav
Transcribe with openai-whisper CLI:
whisper out.wav --model small --task transcribe --language en
Tips and troubleshooting
- If you get silence, ensure you are using the monitor source for your output device (the name ends with
.monitor). Use--list-sourcesto view options. - Make sure the application you want to capture is playing through the same output sink as your default sink. You can manage routes with
pavucontrol. - PipeWire systems expose PulseAudio-compatible sources, so
-f pulsein ffmpeg still works. - For better performance on CPU, use faster-whisper with model
baseorsmall. For the best accuracy, usemediumorlarge-v2(these are heavier). - GPU acceleration for faster-whisper requires a compatible ctranslate2 CUDA wheel. Set
SYS2TXT_DEVICE=cudato enable it. If not available, it will run on CPU.
Development
Install with development dependencies:
pip install -e ".[dev]"
Run unit tests:
python -m unittest discover -s tests -p "test_*.py"
Format and lint code:
ruff format src/
ruff check src/
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sys2txt-0.1.1.post1.tar.gz.
File metadata
- Download URL: sys2txt-0.1.1.post1.tar.gz
- Upload date:
- Size: 14.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
964201c2489bf8e9072b3da25f161ebf3511404b3169db314eb96cafef4b4425
|
|
| MD5 |
3ccf8512db13428029fffde3f17431e2
|
|
| BLAKE2b-256 |
b4ff9119a2f6cd788329e844d3d215122cfee84a879df804907597503c6cf55a
|
Provenance
The following attestation bundles were made for sys2txt-0.1.1.post1.tar.gz:
Publisher:
publish-to-pypi.yml on Joe-Heffer/sys2txt
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sys2txt-0.1.1.post1.tar.gz -
Subject digest:
964201c2489bf8e9072b3da25f161ebf3511404b3169db314eb96cafef4b4425 - Sigstore transparency entry: 684901641
- Sigstore integration time:
-
Permalink:
Joe-Heffer/sys2txt@e720c7482d26fa89555a9c668cd95a4927b9f027 -
Branch / Tag:
refs/tags/v0.1.1post1 - Owner: https://github.com/Joe-Heffer
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@e720c7482d26fa89555a9c668cd95a4927b9f027 -
Trigger Event:
release
-
Statement type:
File details
Details for the file sys2txt-0.1.1.post1-py3-none-any.whl.
File metadata
- Download URL: sys2txt-0.1.1.post1-py3-none-any.whl
- Upload date:
- Size: 11.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b9194f1e11d569bfb654a36846af9a8e8a84b9a5b7e179396de241f5c004720d
|
|
| MD5 |
39978cead6134a63427838b613f35c12
|
|
| BLAKE2b-256 |
07c527e5c5e54ee721f312775defb1df4709962c934cb3ac4a72daefd3568d3f
|
Provenance
The following attestation bundles were made for sys2txt-0.1.1.post1-py3-none-any.whl:
Publisher:
publish-to-pypi.yml on Joe-Heffer/sys2txt
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sys2txt-0.1.1.post1-py3-none-any.whl -
Subject digest:
b9194f1e11d569bfb654a36846af9a8e8a84b9a5b7e179396de241f5c004720d - Sigstore transparency entry: 684901642
- Sigstore integration time:
-
Permalink:
Joe-Heffer/sys2txt@e720c7482d26fa89555a9c668cd95a4927b9f027 -
Branch / Tag:
refs/tags/v0.1.1post1 - Owner: https://github.com/Joe-Heffer
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@e720c7482d26fa89555a9c668cd95a4927b9f027 -
Trigger Event:
release
-
Statement type: