streamplace-tts#
Simple stream.place text-to-speech solution using Bun, Vue, Vite, Python, and Piper. As complex as possible for your viewing pleasure.
Requirements#
- Have piper, including the HTTP server, installed and in PATH.
- Have Bun or Node installed and in PATH
Setup#
- Edit
start-piper.shto your needs. - Copy
.env.exampleto.envand configure your settings (see Configuration below). - Run
start-piper.sh - Run
<JS preference> run dev(if you use node idk i can't help you i'm a hobbyist who just enjoys bun okay)
Configuration#
Configuration can be set via environment variables (.env file) or URL query parameters. URL parameters take priority over environment variables.
Environment Variables#
Create a .env file with the following variables:
VITE_STREAMPLACE_DID=yourname.bsky.social
VITE_TTS_TIMEOUT=3000
VITE_REPEAT_USERNAMES=false
VITE_CHAT_LIFE=60
VITE_STREAMPLACE_DID- Your stream.place username (required)VITE_TTS_TIMEOUT- Milliseconds to wait before enabling TTS after connection (default: 3000)VITE_REPEAT_USERNAMES- Whether to repeat usernames for consecutive messages from same user (default: false)VITE_CHAT_LIFE- How long chat messages stay on screen in seconds (default: 60)
URL Parameters#
Override any setting by adding URL parameters:
http://localhost:5173/?username=yourname.bsky.social&ttsTimeout=5000&chatLife=120&repeatUsernames=true
?username=- Override VITE_STREAMPLACE_DID?ttsTimeout=- Override VITE_TTS_TIMEOUT?chatLife=- Override VITE_CHAT_LIFE?repeatUsernames=- Override VITE_REPEAT_USERNAMES (usetrueorfalse)
All parameters are validated - invalid values fall back to environment variables, then defaults.
Needs and wants#
- Volume slider
- Environment variables (Vite can pass them to the client as needed) for settings
- Dedupe repeat usernames for multiple messages in chat from one person
- Alter chatter username to remove common social sites postfix (.bsky.social)
- Make it work as an OBS chat overlay too?
- Implement as a flag feature
- Expose settings on mousemove event
- Detect if mouse on screen, display settings UI
- Fix associated bugs (input just breaks)
- Ensure env vars actually exist and have some sane defaults
- Support URL query parameters for configuration
- Check for errors in connecting to the websocket properly
- Somehow get rid of piper with something better if possible?
- Enable
!voiceto switch voice model - Get message replied to for extra context
- Implement as a flag feature
- Document full aspects of the TTS timeout value and implications caused by making it too short or too long
- Add cool text effects that are user selectable
- Build list of known subdomains for TTS (.bsky.social for example)
- Use actual time split for chat removals
- Prevent audio from playing over top each other
My Code Is Your Code#
If you want a change, make a PR. I made this for free in my spare time, you can make edits and make PRs too.
Credits#
Fonts#
- Comic Helvetic
- Fluent Emoji Webfont
- hot diggity dog! (Not included, paid font, but my preferred)