TikTok LIVE TTS란?
TikTok Live의 TTS(텍스트 음성 변환)는 라이브 방송 중에 채팅 메시지를 음성으로 바꿔 줘요. 시청자가 메시지를 보내면 TTS가 소리 내어 읽어 줘서 스트리머와 시청자 모두 들을 수 있어요. 특히 이런 경우에 유용해요:
- 채팅을 계속 읽기 어려운 스트리머
- 시각 장애인 사용자를 위한 접근성
- 인터랙티브 엔터테인먼트
- 방송용 AI 음성 어시스턴트
TikTok Live에서 TTS 쓰는 방법
TikTok 기본 TTS는 제한적이라 특정 후원/선물 메시지에서만 작동해요. 모든 채팅 메시지 TTS까지 하려면 개발자들은 TikTool API로 채팅을 실시간으로 받아 TTS 엔진에 넘겨요:
1단계: 라이브 방송에 연결
import { TikTokLive } from '@tiktool/live'
const client = new TikTokLive({
uniqueId: 'streamer_username',
apiKey: 'YOUR_API_KEY'
})2단계: 채팅 메시지 수신
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()3단계: TTS 엔진 추가
브라우저 Web Speech API, Google Cloud TTS, Amazon Polly, ElevenLabs, OpenAI TTS 등 원하는 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