Snorbyte TTS client with streaming and playback
Project description
snorbyte
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
Verify
ffmpeg -version
ffplay -version
INSTALL PACKAGE
pip install snorbyte
API CALL 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>",
)
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"
play=True,
save_to="out.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"])
WEBSOCKET CALL USAGE
from temp.snorbyte import Snorbyte # e.g., "from snorbyte import Snorbyte"
import time
API_KEY = "<YOUR-API-KEY>"
def consume_stream(b: bytes):
print(f"chunk {len(b)} bytes")
def main():
client = Snorbyte(
api_key=API_KEY,
ipv4_only=True,
)
client.ws_connect()
try:
path1, info1 = client.ws_send(
utterance="ग्रुप प्रोजेक्ट में हर कोई अपना हिस्सा टाइम पर दे दे तो प्रेज़ेंटेशन शाइन करेगी, वरना आख़िरी रात को हड़बड़ी में स्लाइड्स बिगड़ जाती हैं, तो चलो एक शेड्यूल फिक्स करते हैं और डेडलाइन से पहले एक ड्राई-रन करके फीडबैक फ्रीज़ कर देते हैं।",
speaker_id=228,
tone="Encouraging",
speed=1.00,
denoise=False,
fmt="pcm",
save_to="demo_out_1.wav",
stream_bytes_callback=consume_stream,
play=True,
)
print("[WS] saved:", path1)
print("[WS] metrics:", info1.get("latency_ms", {}))
path1, info1 = client.ws_send(
utterance="ठीक है, फिर शाम को रिपोर्ट भेज दूँगा; आप बस मेट्रिक्स देख लेना और अपना फीडबैक बता देना।",
speaker_id=49,
tone="", # or "Encouraging"/"Consoling" for Charan/Shreeja only
speed=1.00,
denoise=True,
fmt="pcm",
save_to="demo_out_1.mp3",
stream_bytes_callback=consume_stream,
play=True,
timeout=30,
)
print("[WS] saved:", path1)
print("[WS] metrics:", info1.get("latency_ms", {}))
path1, info1 = client.ws_send(
utterance="देख भाई, धीरे-धीरे कर ना, फालतू टेंशन मत ले, जो काम समय से हो सकता है, उसे जबरदस्ती धक्का देकर बिगाड़ने से अच्छा है, आराम से कर, रोज़ थोड़ा-थोड़ा बढ़ेगा।",
speaker_id=67,
tone="", # or "Encouraging"/"Consoling" for Charan/Shreeja only
speed=1.00,
denoise=False,
fmt="pcm",
save_to="demo_out_1.wav",
stream_bytes_callback=consume_stream,
play=False,
timeout=30,
)
print("[WS] saved:", path1)
print("[WS] metrics:", info1.get("latency_ms", {}))
finally:
time.sleep(2)
client.ws_close()
client.close()
print("[WS] closed")
if __name__ == "__main__":
main()
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 Distributions
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 snorbyte-0.1.12.tar.gz.
File metadata
- Download URL: snorbyte-0.1.12.tar.gz
- Upload date:
- Size: 262.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d2dafec38af28b455313ab6047e45dcdc4ab43d6ed5844349e0be57d2553594d
|
|
| MD5 |
16c149fbfd53c46fe56d531185c2e19c
|
|
| BLAKE2b-256 |
e8e40b8e234d752940bb2b67a0651a59f1406a7c9df1ce945642aceaf1ef27ad
|
File details
Details for the file snorbyte-0.1.12-cp313-cp313-win_amd64.whl.
File metadata
- Download URL: snorbyte-0.1.12-cp313-cp313-win_amd64.whl
- Upload date:
- Size: 426.4 kB
- Tags: CPython 3.13, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
09ce473e55cbbf0e055c9428caff0653712927acbeea608c9fcb829a851d90bd
|
|
| MD5 |
4f1bcefa9216cad4f70166e6913e3b57
|
|
| BLAKE2b-256 |
9a32128d5bb2c12a7681dd08448524d1eb4ba0b33e2e06e0951c1e89b29927cb
|
File details
Details for the file snorbyte-0.1.12-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: snorbyte-0.1.12-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 1.6 MB
- Tags: CPython 3.13, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
040d90b8b9c4dd4f2f6428e1b033896cf09b2913fa07ce199219332ce46090e1
|
|
| MD5 |
e1a302012abbf9e98631932f1de1a11e
|
|
| BLAKE2b-256 |
9dbaedaf15907d6e71230215b774e17a0c4043611e12f0fd57015d960e494830
|
File details
Details for the file snorbyte-0.1.12-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl.
File metadata
- Download URL: snorbyte-0.1.12-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
- Upload date:
- Size: 1.5 MB
- Tags: CPython 3.13, manylinux: glibc 2.17+ i686, manylinux: glibc 2.5+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dcf81d21913b933349f3cbb7f8f6488a3f575874159e65a8098562ba4f314e2a
|
|
| MD5 |
89b4143469ac51d4c6aca532abe8a0e2
|
|
| BLAKE2b-256 |
91d7befa12043aa2cb398c5cf02dba3ef46cb40928a0a50eb6baf5383130a5fb
|
File details
Details for the file snorbyte-0.1.12-cp313-cp313-macosx_10_13_universal2.whl.
File metadata
- Download URL: snorbyte-0.1.12-cp313-cp313-macosx_10_13_universal2.whl
- Upload date:
- Size: 644.1 kB
- Tags: CPython 3.13, macOS 10.13+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
834e0867a185bbc0a1bc625009e7c1fb15e5b2e943aac5cea4327054309c823c
|
|
| MD5 |
0e6161933a20d6e5f0907e054093b330
|
|
| BLAKE2b-256 |
382fa6499eca6a2ff5e714e3382ba89d681fe3f2eb83f52358b18b3578754e87
|
File details
Details for the file snorbyte-0.1.12-cp312-cp312-win_amd64.whl.
File metadata
- Download URL: snorbyte-0.1.12-cp312-cp312-win_amd64.whl
- Upload date:
- Size: 425.9 kB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0befbf0268db2c18ea7c6a13df531bdd82e05c2eba9af7fa9de4dbb99ce998ef
|
|
| MD5 |
2f1e4ffc5fe9796c43e0065beecb9ba9
|
|
| BLAKE2b-256 |
d00de3b2dff196d742073851a5d4b7cd593f98ee538e256844081a19910cdc78
|
File details
Details for the file snorbyte-0.1.12-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: snorbyte-0.1.12-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 1.6 MB
- Tags: CPython 3.12, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d427978340072ba6b31522d47b54127167a390208dd830ee87450ba855dbed94
|
|
| MD5 |
17b00ed1c7f69ff1b4a663e7edaa2d7c
|
|
| BLAKE2b-256 |
65816b7f182b6f60c84aec6b7daa0667723f421343bdd1f04ae4767446cbe50e
|
File details
Details for the file snorbyte-0.1.12-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl.
File metadata
- Download URL: snorbyte-0.1.12-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
- Upload date:
- Size: 1.5 MB
- Tags: CPython 3.12, manylinux: glibc 2.17+ i686, manylinux: glibc 2.5+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e851d53cb3bf7ede51bbca7624f11dc165d61d945e9a11af47d410d828cbcd0e
|
|
| MD5 |
7c33941e22c5a8bcb0d8e5ea833f859a
|
|
| BLAKE2b-256 |
da2755a7ad9dcd11382d39ac5e782bec5b7fd5a96a92c6d11c4bb2fc0eb1d23d
|
File details
Details for the file snorbyte-0.1.12-cp312-cp312-macosx_10_13_universal2.whl.
File metadata
- Download URL: snorbyte-0.1.12-cp312-cp312-macosx_10_13_universal2.whl
- Upload date:
- Size: 646.2 kB
- Tags: CPython 3.12, macOS 10.13+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d07a91e34fcd875570391b73a584a337ff6e2a60e10e4837cff34c9c54e85e9a
|
|
| MD5 |
7a912b72a91eba314a12cb36c1e85eee
|
|
| BLAKE2b-256 |
7528d639a4745eba35a8cc25299dfce963798fa263d91b830db9932f9e443f2e
|
File details
Details for the file snorbyte-0.1.12-cp311-cp311-win_amd64.whl.
File metadata
- Download URL: snorbyte-0.1.12-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 431.0 kB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
42deb24c085795f3cbdeec71bc7b80307505cce54e3aebf7cde0ada1e6e87668
|
|
| MD5 |
f22af21fbf27f9360e5163dba0be8311
|
|
| BLAKE2b-256 |
eb87be11707202e76d667199fa7c8e52514b1e1443432955731514b7831917bf
|
File details
Details for the file snorbyte-0.1.12-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: snorbyte-0.1.12-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 1.7 MB
- Tags: CPython 3.11, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
30afe4f1e3922fa5e5d997446d50f04c4af40c8015e7eaeff7521c19c6845e4b
|
|
| MD5 |
92260a5fd106572d0a05b5df9b855cdd
|
|
| BLAKE2b-256 |
2fb2fb3b154a07d75e413471fec46a6ad5c1b6dcf034a47e129f019cab0e542d
|
File details
Details for the file snorbyte-0.1.12-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl.
File metadata
- Download URL: snorbyte-0.1.12-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
- Upload date:
- Size: 1.6 MB
- Tags: CPython 3.11, manylinux: glibc 2.17+ i686, manylinux: glibc 2.5+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
29f204df8db107c6584de8df3e976193b44a4987974c3c747c0ac1ab7e3995a6
|
|
| MD5 |
8dbe10b560ea2bc4f96dfc2ffdffebbd
|
|
| BLAKE2b-256 |
8ee100937e06d743a052bb4c8135462c95af795a31210df0bc0f3a214e17582c
|
File details
Details for the file snorbyte-0.1.12-cp311-cp311-macosx_10_9_universal2.whl.
File metadata
- Download URL: snorbyte-0.1.12-cp311-cp311-macosx_10_9_universal2.whl
- Upload date:
- Size: 652.1 kB
- Tags: CPython 3.11, macOS 10.9+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5aabc4cb82cd3360cfa3c82a839a52cd190067f4248e9adc01dc3d81ba7ccdd1
|
|
| MD5 |
5ae5772e9201a14f2ad42ac82e95ae95
|
|
| BLAKE2b-256 |
41bfb9fb8626f0b5a31b58b2b1ded917af30da55eb5b754c5fbb32d9026e229e
|
File details
Details for the file snorbyte-0.1.12-cp310-cp310-win_amd64.whl.
File metadata
- Download URL: snorbyte-0.1.12-cp310-cp310-win_amd64.whl
- Upload date:
- Size: 429.5 kB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9fd081ffd7b627e4aa43c5273d0646e1ff934eb3dbc838a24222b84df901fb7c
|
|
| MD5 |
22df8dce96eaaa84198f4229e13b74c9
|
|
| BLAKE2b-256 |
f11e1524d8db67afc974f684d9a608188c4d579b9ff5939a74c13a80617ea3f6
|
File details
Details for the file snorbyte-0.1.12-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: snorbyte-0.1.12-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 1.6 MB
- Tags: CPython 3.10, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c4d60b45a7ec9119f4cf0dcc18b11e5ec631a20068565a8086d179b2be49dbe4
|
|
| MD5 |
7725de6f6b2980bdef32465453fe4195
|
|
| BLAKE2b-256 |
a30f70ac71db40deceab2c00fcef9cb39c879372696157e06fba861e98772241
|
File details
Details for the file snorbyte-0.1.12-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl.
File metadata
- Download URL: snorbyte-0.1.12-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
- Upload date:
- Size: 1.5 MB
- Tags: CPython 3.10, manylinux: glibc 2.17+ i686, manylinux: glibc 2.5+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0baf2708c19622932c4a94fc07a33dc6f9c8f86c9fc2bf6cb405a33d9e791ecb
|
|
| MD5 |
a5ad44414646ea5347132851864b664f
|
|
| BLAKE2b-256 |
5f3d055e39c649cd8d416fc99cf4286d359e65816310cc84cbedcb196375c055
|
File details
Details for the file snorbyte-0.1.12-cp310-cp310-macosx_10_9_universal2.whl.
File metadata
- Download URL: snorbyte-0.1.12-cp310-cp310-macosx_10_9_universal2.whl
- Upload date:
- Size: 655.6 kB
- Tags: CPython 3.10, macOS 10.9+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0b5c53297fa291184245ce0b2dfdc5b73aabe49833c2b81b3baed64aa762d63e
|
|
| MD5 |
82e17f904f34b57cc384bdc1a59e5527
|
|
| BLAKE2b-256 |
df6e159a41bf7b168669f56040293c204e9a4740b3d510fd44db06bcdcb8637e
|
File details
Details for the file snorbyte-0.1.12-cp39-cp39-win_amd64.whl.
File metadata
- Download URL: snorbyte-0.1.12-cp39-cp39-win_amd64.whl
- Upload date:
- Size: 430.0 kB
- Tags: CPython 3.9, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f23b9445cbb393279b80438c3aea27b41d5ad842a2662fd781cc9effff05c6ff
|
|
| MD5 |
125655ddf2cd88057510313cc213c49a
|
|
| BLAKE2b-256 |
fda2ef7c95ef28331e76b96632adb5807e1b8ab830091ba81837acf17cead6f1
|
File details
Details for the file snorbyte-0.1.12-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: snorbyte-0.1.12-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 1.6 MB
- Tags: CPython 3.9, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cd0059db3bb0bb8b1f9eb1a016155555286f57b3ed679097ab0fb8b98cd5477e
|
|
| MD5 |
4bc7029f2c6c69b6bc311ee9aab2e449
|
|
| BLAKE2b-256 |
944eef58c0407c3a5d8bfc1a5f8a8c4300a41c6bc262b7c4251b07e3c774a884
|
File details
Details for the file snorbyte-0.1.12-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl.
File metadata
- Download URL: snorbyte-0.1.12-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
- Upload date:
- Size: 1.6 MB
- Tags: CPython 3.9, manylinux: glibc 2.17+ i686, manylinux: glibc 2.5+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a815524458c41ad23a60b68d36af32bac06d493b76e23e5505a515148edfa01c
|
|
| MD5 |
2ce963cc8e2b4bff7b63108caf7eb94e
|
|
| BLAKE2b-256 |
b5e0075ab8c53ea074a1f56e83c4f8ac73a4f4b0dc8012d6efae1bdbe4bf8703
|
File details
Details for the file snorbyte-0.1.12-cp39-cp39-macosx_10_9_universal2.whl.
File metadata
- Download URL: snorbyte-0.1.12-cp39-cp39-macosx_10_9_universal2.whl
- Upload date:
- Size: 657.2 kB
- Tags: CPython 3.9, macOS 10.9+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5b18506aefa7fdfaa7c3ad2725976cbb1e6a25bea3f1d538384087ff90bb88f3
|
|
| MD5 |
d7299cc5dbeaeb74d03fb4715d83d1d7
|
|
| BLAKE2b-256 |
6d10fe1ea47f351339d65a563012110c7e234b08710d91e9cfbd2aa871bfe525
|