Skip to main content

Convert articles to audio you can stream, using local TTS models

Project description

Vocast

Convert articles to audio using local TTS models.

Why

I wanted a way to convert articles into audio that I could stream to my mobile device while on the go. This seemed straightforward enough to build myself and I didn't want to pay for an app.

How

Vocast uses Kokoro for TTS. It can fetch articles from a given URL or local text file. Audio files are saved to ~/.vocast/library. It provides an HTTP server that exposes an RSS feed allowing for podcast apps to discover the converted audio files. You can use Tailscale to allow connections between the server and client devices like your mobile phone. You will need to use a podcast app that does not proxy requests through their own servers as that will prevent the app from connecting to your Vocast server.

Requirements

  • Python 3.10–3.12 (Kokoro does not yet support 3.13). Installing with uv provisions a compatible Python for you.
  • espeak-ng on PATH (used by Kokoro as a fallback phonemizer)

ffmpeg is bundled (via imageio-ffmpeg), so the only system dependency is espeak-ng:

sudo dnf install espeak-ng     # Fedora
sudo apt install espeak-ng     # Debian/Ubuntu
brew install espeak-ng         # macOS

Install

The recommended way is an isolated tool install, which also provisions a compatible Python for you and puts a vocast command on your PATH:

uv tool install git+https://github.com/cnrmurphy/vocast
# or, with pipx:
pipx install git+https://github.com/cnrmurphy/vocast

(Once published to PyPI this becomes simply uv tool install vocast.)

The first run downloads the Kokoro weights (~300 MB) and a small spaCy model into the cache. Subsequent runs are immediate.

From source (development)

uv venv && source .venv/bin/activate
uv pip install -e .

Usage

Vocast has subcommands; run vocast --help to see them all.

Add an article to the library

vocast add https://example.com/article    # fetch and synthesize a URL
vocast add notes.txt                      # synthesize a local text file
vocast add ... --title "Custom title"     # override the title
vocast add ... --voice af_bella           # use a different Kokoro voice
vocast add ... --quiet                    # suppress per-chunk progress

URLs are fetched and cleaned with trafilatura. Code blocks (<pre> elements) are stripped before synthesis since they don't translate well to audio. Each entry is stored under ~/.vocast/library/<id>/ as audio.mp3 plus meta.json with title, source URL, duration, and voice.

List the library

vocast list

Serve the library as a podcast feed

vocast serve                                # 127.0.0.1:8080 by default
vocast serve --host 0.0.0.0 --port 8000     # custom host/port

Exposes GET /feed.xml (podcast RSS) and GET /audio/<id>.mp3 (audio enclosures). Long articles are split on sentence boundaries during synthesis and concatenated with short silence between chunks.

Expose the feed to your phone over Tailscale

vocast init

A guided checklist that walks you through installing Tailscale, signing into your tailnet, and proxying vocast serve over HTTPS via tailscale serve. Re-run after each step until it prints your feed URL, then add that URL to a direct-download podcast app (Downcast is confirmed working).

Synthesize directly to a file (skip the library)

vocast synth article.txt              # writes article.mp3
vocast synth article.txt -o out.wav   # WAV output

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vocast-0.1.0.tar.gz (123.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vocast-0.1.0-py3-none-any.whl (14.1 kB view details)

Uploaded Python 3

File details

Details for the file vocast-0.1.0.tar.gz.

File metadata

  • Download URL: vocast-0.1.0.tar.gz
  • Upload date:
  • Size: 123.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.9 {"installer":{"name":"uv","version":"0.11.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Fedora Linux","version":"42","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for vocast-0.1.0.tar.gz
Algorithm Hash digest
SHA256 32ff450e4e69837f75b3be1c39a3d31b0a77cb38e8049ae85b703bda092d117f
MD5 754bcb64b200ffacc646f2c7402ffb5e
BLAKE2b-256 3accf54b0878403166ed1b7710a3ddd46078ac3e60c9c2522f27bd9e7d6f6451

See more details on using hashes here.

File details

Details for the file vocast-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: vocast-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 14.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.9 {"installer":{"name":"uv","version":"0.11.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Fedora Linux","version":"42","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for vocast-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3c709b2e71c7d163e57f1b909f9af844f7e851d9aeceb1c52320256e8d1521ee
MD5 62b2a8db09b1a5922219a6f0ef204158
BLAKE2b-256 e8b18515296c4704791505a27e936cf95d8fea1e1f49800f8a8ae0446a6bc397

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page