Skip to main content
POST
Convert text to speech with streaming response
このドキュメントは英語の原文から自動翻訳されています。表現に不自然な箇所がある場合があります。正確な内容は英語の原文もあわせてご確認ください。
生成された音声をチャンク単位でストリーミングして返すため、クリップ全体の生成完了を待たずに再生を開始できます。ストリーミングと高速な非ストリーミングモデルの使い分けについては、Docs: 音声ストリーミング および レイテンシ最適化 をご参照ください。
ストリーミングは現在 sona_speech_1 のみでサポートされています。

エンドポイント

パスパラメータ

リクエストボディ

Content-Type: application/json

レスポンス

デフォルト(include_phonemes=false): バイナリオーディオストリームを返します。
  • Content-Type: audio/wav または audio/mpegoutput_format に対応)。
  • 最初のチャンクにはオーディオファイルヘッダーが含まれ、以降のチャンクは生のオーディオデータです。
include_phonemes=true の場合: 改行区切りの JSON(NDJSON)で、1 チャンクにつき 1 オブジェクトを返します。

注意事項

  • 音声ストリーミングは現在 ベータ 版で、sona_speech_1 のみをサポートします。
  • text が 300 文字を超えると 400 を返します。SDK は長い入力を自動でチャンキングし、イテレーターにチャンクを転送します。
  • speedduration の後に適用されます(例: duration=5 + speed=2 で約 10 秒)。
  • style を省略した場合はボイスのデフォルトスタイルが適用されます。デフォルトは ボイス取得 で確認できます。

関連項目

Docs: Stream speech

ストリーミングを使うべき場面と、各 SDK でのチャンク消費方法。

LLM streaming TTS

OpenAI および Anthropic を用いたエンドツーエンドのレシピ。

Authorizations

x-sup-api-key
string
header
required

Path Parameters

voice_id
string
required

Body

application/json
text
string
required

The text to convert to speech

Maximum string length: 300
language
enum<string>
required

The 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
style
string

The style of character to use for the text-to-speech conversion

model
enum<string>
default:sona_speech_1

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
output_format
enum<string>
default:wav

The desired output format of the audio file (wav, mp3). Default is wav.

Available options:
wav,
mp3
voice_settings
object
include_phonemes
boolean
default:false

Return phoneme timing data with the audio

normalized_text
string

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)