tts-emotion-router

TTS Emotion Router

kellz-dev / tts-emotion-router
Plugin193 downloadsEvent Listener1entertainment

Detect emotion in bot replies and route TTS to matching voice/speed. Supports OpenAI-compatible TTS APIs.

TTS Emotion Router

Detect emotion in bot replies and automatically route TTS synthesis to matching voices and speeds. Supports any OpenAI-compatible TTS API.

Features

  • Emotion Detection: Analyze bot replies using LLM or keyword-based fallback
  • Voice Routing: Map emotions (happy, sad, angry, excited, neutral) to different TTS voices
  • Speed Control: Automatically adjust speech speed based on emotion
  • Flexible TTS Backend: Works with any OpenAI-compatible TTS API (SiliconFlow, Azure, etc.)

Configuration

SettingDescriptionRequired
TTS API Base URLOpenAI-compatible TTS endpoint
TTS API KeyAPI authentication key
Default VoiceVoice ID for neutral emotion
Happy/Sad/Angry/Excited VoiceVoice IDs for each emotion
TTS ModelModel name (default: tts-1)
Emotion Detection ModelLLM for emotion classification
Speed Multiplier (Excited)Speech speed for excited emotion

How It Works

  1. Bot sends a text reply
  2. Plugin detects the emotion of the reply text
  3. Selects the matching voice and speed
  4. Synthesizes speech via TTS API
  5. Sends the audio as a voice message

Supported Emotions

EmotionDefault SpeedExample Triggers
😊 Happy1.0x哈哈, 太好了, awesome
😢 Sad0.9x难过, 遗憾, unfortunately
😡 Angry1.0x生气, 烦, damn
🔥 Excited1.15x太棒了, amazing, wow
😐 Neutral1.0x(default)

Use TTS Emotion Router in Feishu/Lark bots, DingTalk bots, WeCom bots, WeChat bots, QQ bots, Slack bots, Discord bots, Telegram bots, LINE Bots, and Matrix Bots.

Host your bot on LangBot Cloud and connect this extension to the collaboration platforms your team already uses.

Open LangBot Cloud

Comments