đŸ’Ŧ Chat with Text-to-Speech

Interactive demo showing TTS integration in a chat interface

Voice DemoAll Demos
Hello! I can speak any message. Click the speaker button next to any message to hear it!
You can also select a different voice from the dropdown above.
Try it out with different voices and see how they sound!
âš ī¸ Text-to-speech is not supported in this browser

đŸŽ¯ How to Use

  • 🔊 Speak Button: Click the speaker icon next to any message to hear it
  • 🎤 Voice Selection: Choose from 40+ voices in the dropdown above
  • âšī¸ Stop: Click the red stop button to interrupt speech
  • đŸ’Ŧ Try It: Type your own messages and hear them spoken!

💡 Integration Code

import { useTextToSpeech } from '@/hooks/useTextToSpeech';

function ChatMessage({ message }) {
  const { speak, stop, isSpeaking } = useTextToSpeech();

  return (
    <div>
      <p>{message.text}</p>
      <button onClick={() => speak(message.text)}>
        {isSpeaking ? 'âšī¸ Stop' : '🔊 Speak'}
      </button>
    </div>
  );
}
📚 Full Integration Guide:

See TTS-INTEGRATION-GUIDE.md for complete examples and patterns