Convert text to speech with streaming response
Text to speech
Stream speech
텍스트를 음성으로 변환하여 청크 단위 오디오 스트림으로 반환합니다.
POST
Convert text to speech with streaming response
이 문서는 영어 원문을 기반으로 자동 번역되었습니다. 표현이 어색하거나 모호한 부분이 있을 수 있으니, 정확한 내용은 영어 원문을 함께 확인해 주세요.
스트리밍은 현재 **
sona_speech_1**에서만 지원됩니다.엔드포인트
경로 파라미터
| Name | Required | Description |
|---|---|---|
voice_id | ✅ | 대상 보이스의 ID입니다. |
요청 본문
Content-Type: application/json
| Name | Required | Description |
|---|---|---|
text | ✅ | 변환할 텍스트입니다. 최대 300자. |
language | ✅ | 언어 코드입니다. 지원: en, ko, ja. |
style | — | 감정 스타일입니다(예: neutral, happy). 생략하면 보이스의 기본 스타일이 적용됩니다. |
model | — | 반드시 sona_speech_1이어야 합니다(스트리밍을 지원하는 유일한 모델입니다). |
output_format | — | wav(기본값) 또는 mp3. |
voice_settings | — | 고급 보이스 파라미터입니다 — 필드와 범위는 Create speech와 동일합니다. |
include_phonemes | — | true이면 청크별 음소 데이터를 포함한 NDJSON으로 응답됩니다. 기본값은 false. |
응답
기본값 (include_phonemes=false): 바이너리 오디오 스트림입니다.
Content-Type: audio/wav또는audio/mpeg(output_format에 따름).- 첫 번째 청크에는 오디오 파일 헤더가 포함되며, 이후 청크는 원시 오디오 데이터입니다.
include_phonemes=true일 때: 줄바꿈으로 구분된 JSON(NDJSON), 청크당 하나의 객체:
참고사항
- Stream speech는 현재 베타이며
sona_speech_1만 지원합니다. text가 300자를 초과하면400을 반환합니다. SDK는 더 긴 입력을 자동으로 청크 분할하여 이터레이터로 전달합니다.speed는duration이후에 적용됩니다(예:duration=5+speed=2≈ 10초).style을 생략하면 보이스의 기본 스타일이 사용됩니다. 기본값은 Get voice로 확인해 주십시오.
함께 보기
Docs: Stream speech
스트리밍을 사용할 시점과 SDK별 청크 소비 방법입니다.
LLM streaming TTS
OpenAI 및 Anthropic과의 엔드 투 엔드 레시피입니다.
Authorizations
Path Parameters
Body
application/json
The text to convert to speech
Maximum string length:
300The language code of the text
Available options:
en, ko, ja, bg, cs, da, el, es, et, fi, hu, it, nl, pl, pt, ro, ar, de, fr, hi, id, ru, vi, hr, lt, lv, sk, sl, sv, tr, uk The style of character to use for the text-to-speech conversion
The model type to use for the text-to-speech conversion
Available options:
sona_speech_1, sona_speech_2, sona_speech_2_flash, supertonic_api_1, supertonic_api_3 The desired output format of the audio file (wav, mp3). Default is wav.
Available options:
wav, mp3 Return phoneme timing data with the audio
Pre-normalized text for TTS. Only used with sona_speech_2 and sona_speech_2_flash models.
Response
Streaming audio data in binary format or NDJSON format with phoneme data based on includePhonemes parameter
Binary audio stream (when includePhonemes=false or omitted)