What is TikTok Live TTS?
Text to Speech (TTS) on TikTok Live converts chat messages into spoken audio during a live broadcast. When viewers send messages, TTS reads them aloud so the streamer and audience can hear them. This is especially useful for:
- Streamers who can't constantly read chat
- Accessibility for visually impaired users
- Interactive entertainment experiences
- AI-powered voice assistants on stream
How to Get Text to Speech on TikTok Live
TikTok's built-in TTS is limited — it only works for specific donation/gift messages. For full TTS on all chat messages, developers use TikTool's API to capture chat in real-time and pipe it to a TTS engine:
Step 1: Connect to the Live Stream
import { TikTokLive } from '@tiktool/live'
const client = new TikTokLive('streamer_username', {
apiKey: 'YOUR_API_KEY'
})Step 2: Listen for Chat Messages
client.on('chat', async (event) => {
const message = event.comment
const user = event.user.uniqueId
console.log(`${user}: ${message}`)
// Send to TTS engine
await speakText(`${user} says: ${message}`)
})
client.connect()Step 3: Add a TTS Engine
Choose any TTS engine — browser Web Speech API, Google Cloud TTS, Amazon Polly, ElevenLabs, or OpenAI TTS:
// Browser Web Speech API (free, no API key needed)
function speakText(text) {
const utterance = new SpeechSynthesisUtterance(text)
utterance.rate = 1.2
utterance.pitch = 1
speechSynthesis.speak(utterance)
}
// Or use any cloud TTS API
// Google Cloud TTS, Amazon Polly, ElevenLabs, OpenAI TTS