Repository navigation
fix(chat): azure tts and gifs - #17
Merged
Merged
Conversation
Collaborator
|
@Addefan Thanks 🤙 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Azure TTS
The
https://chatsemban.justdavi.dev/api/ttsAPI endpoint stopped working (returning HTTP 500), which broke theDmitryandSvetlanavoices in the!ttscommand.I deployed a compatible API endpoint with Azure voices on my own server and updated the endpoint URL in the code. I don't plan on taking it down in the foreseeable future, but in case it ever needs to be self-hosted elsewhere, here is the script to deploy the exact same endpoint:
Required dependencies:
edge-tts,fastapi, anduvicorn(pip install edge-tts fastapi uvicorn).Running
python server.pystarts the server athttp://0.0.0.0:8000. HTTPS and a custom domain can be configured using NGINX + Let's Encrypt.GIFs
All Twitch GIF messages have a multi-word fallback text format like
[<title> GIF by <author>]. GIF rendering was already implemented in the project, but the unit tests only checked a single-word[GIF]string. Because the message text is tokenized by whitespace before rendering (createMessageTokenSnapshot), the full multi-word GIF substring stored inreplacementsnever matched the individual word tokens during lookup and ended up being rendered as plain text.Before tokenizing the message, I now replace the GIF substring with a whitespace-free placeholder so it stays a single token and properly matches the entry in
replacements.VoiceCatalog.tsx
Prior to any of these changes,
tests/voiceCatalog.test.tswas failing in the original repository because it imported a.tsxfile directly (outside Vite, Bun's built-in JSX transpiler attempts to importjsxDEVfromsolid-js, which does not exist at runtime).I extracted the pure parsing logic from
src/components/setup/VoiceCatalog.tsxintosrc/components/setup/voiceCatalogData.tsso the test imports a plain.tsmodule without JSX.