Skip to main content

Snorbyte TTS client with streaming and playback

Reason this release was yanked:

Instable & Broken Wheels

Project description

snorbyte

Minimal Snorbyte TTS client with streaming, PCM ring-buffer playback, and ffplay/ffmpeg required for compressed live playback/encoding.

DEPENDENCIES (VERY IMPORTANT)

We require both ffplay and ffmpeg to be available on your system PATH. We also use sounddevice for PCM playback, which depends on PortAudio (OS package) on Linux.

Windows

Option A (winget)

winget install -e --id Gyan.FFmpeg

Option B (chocolatey)

choco install ffmpeg

Verify

After install, ensure the ffmpeg/bin folder is on your PATH.

ffmpeg -version
ffplay -version

Linux

Debian/Ubuntu

sudo apt-get update
sudo apt-get install -y ffmpeg libportaudio2

Fedora/RHEL/CentOS (dnf)

sudo dnf install -y ffmpeg portaudio

Arch/Manjaro

sudo pacman -S --needed ffmpeg portaudio

Verify

ffmpeg -version
ffplay -version

INSTALL PACKAGE

pip install snorbyte

EXAMPLE USAGE

from snorbyte import Snorbyte

def consume_stream(b: bytes):
    # b is raw stream bytes (PCM aligned for fmt="pcm", raw MP3/WAV chunks otherwise)
    print(f"chunk {len(b)} bytes")

client = Snorbyte(
    api_key="<YOUR-API-KEY>",
    endpoint="http://api.snorbyte.com/tts",
)

path, data, info = client.tts(
    utterance="दोस्त, दिल टूटा है तो क्या, रात भर प्लेलिस्ट रोएगी पर सुबह धूप आएगी, खुद से वादा कर—जो गया, जाने दे, जो आएगा, मुस्कुराकर अपनाएंगे।",
    speaker_id=233,
    speaker_name="",
    tone="Encouraging",
    speed=1.00,
    chunk_size=8192,
    denoise=True,
    stream=True,
    stream_bytes_callback=consume_stream,
    fmt="pcm",               # "mp3" | "wav" | "pcm"
    save_to="out5.mp3",      # optional; auto-name if omitted
    temperature=0.0,
    top_p=1.0,
    repetition_penalty=1.05,
)

print("Saved to:", path)
print("Bytes in memory:", len(data) if data else None)
print("Info (ms):", info["latency_ms"])

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

snorbyte-0.1.7.tar.gz (56.4 kB view details)

Uploaded Source

Built Distribution

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

snorbyte-0.1.7-py3-none-any.whl (58.2 kB view details)

Uploaded Python 3

File details

Details for the file snorbyte-0.1.7.tar.gz.

File metadata

  • Download URL: snorbyte-0.1.7.tar.gz
  • Upload date:
  • Size: 56.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.0

File hashes

Hashes for snorbyte-0.1.7.tar.gz
Algorithm Hash digest
SHA256 bd41c09cb69f79d547c894eda581faa148ae1aebac4f354dfcd674bd9fca1aa5
MD5 8619e132202b5f3db002742f82c44b92
BLAKE2b-256 5f38ec8e4ad48535d72c2f51658b41726bc36ed0b2c06a6ab5d26a69eeb765ba

See more details on using hashes here.

File details

Details for the file snorbyte-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: snorbyte-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 58.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.0

File hashes

Hashes for snorbyte-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 40a1c21c511a83d959ab61935be67ddb8d9605a87ce687b77b66e46359d4a7c5
MD5 d10e612b3873d85aa067cdec826f5617
BLAKE2b-256 55ec60123cf5ec26283ad22a2a56c9f69c3e3d59743d1d626c6b89d543e07502

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