Skip to content

Fix TTS to use configured model instead of hardcoded tts-1#285

Open
Chapoly1305 wants to merge 3 commits intokrillinai:masterfrom
Chapoly1305:fix/tts-use-configured-model
Open

Fix TTS to use configured model instead of hardcoded tts-1#285
Chapoly1305 wants to merge 3 commits intokrillinai:masterfrom
Chapoly1305:fix/tts-use-configured-model

Conversation

@Chapoly1305
Copy link
Copy Markdown

@Chapoly1305 Chapoly1305 commented Jan 4, 2026

Summary

  • Fixed Text2Speech function to use the model from config.Conf.Tts.Openai.Model instead of hardcoded tts-1
  • Falls back to tts-1 if no model is configured

The Text2Speech function was ignoring the model configured in
config.toml and always using "tts-1". This change reads the model
from config.Conf.Tts.Openai.Model, falling back to "tts-1" if not set.
@Chapoly1305 Chapoly1305 marked this pull request as draft January 4, 2026 00:45
Use json.Marshal instead of fmt.Sprintf to construct the request body,
preventing 400 errors when subtitles contain quotes, newlines, or
other special characters.
Default to 'alloy' voice when TtsVoiceCode is empty, preventing
400 errors from OpenAI API which requires a valid voice parameter.
@Chapoly1305 Chapoly1305 marked this pull request as ready for review January 4, 2026 01:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant