The AI can now use vocal directions to enhance TTS output with emotional cues. These directions are hidden from users but affect how the speech sounds.
- AI adds vocal directions in square brackets:
[cheerful],[whisper], etc. - The voice filter automatically removes these from displayed text
- The TTS engine (Groq Orpheus) interprets the directions for speech output
- Users hear the emotion but never see the tags
[cheerful]- Happy, upbeat tone[excited]- Energetic, enthusiastic[serious]- Formal, grave tone[sad]- Melancholic, somber
[whisper]- Quiet, intimate tone[menacing whisper]- Dark, threatening whisper[dark chuckle]- Evil laugh[sigh]- Exhale sound
[cheerful] Welcome back! I'm so glad to see you again! [serious] Now, let's tackle that coding problem you mentioned.
User sees:
Welcome back! I'm so glad to see you again! Now, let's tackle that coding problem you mentioned.
User hears:
(cheerful tone) Welcome back! I'm so glad to see you again! (serious tone) Now, let's tackle that coding problem you mentioned.
[serious] This is a critical security vulnerability. [whisper] Between you and me, many developers overlook this. [excited] But you're going to fix it right now!
User sees:
This is a critical security vulnerability. Between you and me, many developers overlook this. But you're going to fix it right now!
User hears:
(serious) This is a critical security vulnerability. (whisper) Between you and me, many developers overlook this. (excited) But you're going to fix it right now!
[menacing whisper] The bug lurks in the shadows of your code... [dark chuckle] waiting to strike when you least expect it. [serious] Let's hunt it down together.
User sees:
The bug lurks in the shadows of your code... waiting to strike when you least expect it. Let's hunt it down together.
User hears:
(menacing whisper) The bug lurks in the shadows of your code... (dark chuckle) waiting to strike when you least expect it. (serious) Let's hunt it down together.
✅ Use directions to enhance emotional impact ✅ Match direction to content context ✅ Use sparingly for maximum effect ✅ Combine multiple directions in one response ✅ Use [cheerful] for greetings and positive news ✅ Use [serious] for important warnings ✅ Use [whisper] for tips and secrets
❌ Overuse directions (makes speech sound unnatural) ❌ Use conflicting directions close together ❌ Use directions in every sentence ❌ Use directions for technical code explanations ❌ Mention the directions to users
- Greetings and farewells
- Delivering good/bad news
- Sharing tips or secrets
- Creating dramatic effect
- Emphasizing important points
- Making jokes or humor
- Expressing empathy
- In code blocks or technical explanations
- In error messages (unless appropriate)
- In mathematical formulas
- In file paths or commands
- When user disabled speech
The VoiceFilter class in src/lib/voice-filter.ts automatically:
- Detects vocal direction patterns:
\[([^\]]+)\] - Removes them from displayed text
- Preserves them for TTS processing
Groq Orpheus TTS natively supports vocal directions:
- Directions are passed in the text to the TTS API
- The model interprets them for speech synthesis
- No additional processing needed
[cheerful] Great question! [serious] Let me explain how async/await works. [excited] It's going to make your code so much cleaner!
[serious] This error occurs because of a null reference. [whisper] A common mistake, but easy to fix. [cheerful] Let's solve it together!
[excited] You're doing amazing! [cheerful] Keep going, you're almost there! [serious] Just one more step to complete this feature.
[serious] Warning: This operation is irreversible. [menacing whisper] Once deleted, your data is gone forever. [cheerful] But don't worry, I'll help you back it up first!
To test vocal directions:
- Enable speech in settings
- Send a message to the AI
- Listen to the response
- Check that directions are hidden in text
- Verify emotional tone in speech
- Vocal directions are a hidden feature - users don't know about them
- They enhance the user experience without cluttering the UI
- The AI should use them naturally and appropriately
- Not all TTS engines support all directions (Orpheus does)
- Fallback TTS (browser) may ignore directions
Status: Active
Supported by: Groq Orpheus TTS
Hidden from Users: Yes
Version: 2.0.0