Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.supertoneapi.com/llms.txt

Use this file to discover all available pages before exploring further.

このドキュメントは英語の原文から自動翻訳されています。表現に不自然な箇所がある場合があります。正確な内容は英語の原文もあわせてご確認ください。
漢字、数字、単位、記号を含む入力では、書かれた形と話される形がしばしば異なります。normalized_text フィールドを使うと、元のテキストと並べて 発音指向のバージョン を渡すことができ、エンジンは両方を利用してより正確な音声を生成します。 元の text は意味と文脈を保持します。normalized_text はその文がどのように 発話されるべきか を記述します。
normalized_text は現時点で sona_speech_2 および sona_speech_2_flash が利用しており、主に日本語向けに設計されています

正規化テキストが役立つ場面

入力に次のような要素が含まれる場合は、text と一緒に normalized_text を指定してください。
  • 暗黙的な発音を持つ 数字(年号、価格、電話番号)
  • 単位と記号10%170cm$50
  • 混在スクリプト(英語の略語を含む日本語、韓国語の中のラテン文字単語)
  • 読みが曖昧な漢字
  • 特殊記号
オーディオブック、ナレーション、アナウンス、キャラクターボイスのように発音の正確さが重要な場面では 強く推奨されます。カジュアルで短い会話文では、通常は不要です。

基本的な使い方

VOICE_ID = "20160a4c5ba38967330c84"  # replace with your voice ID

response = client.text_to_speech.create_speech(
    voice_id=VOICE_ID,
    text="今日は10%オフだよ。身長は170cm、体重は60kg。",
    normalized_text="きょうはじゅっパーセントオフだよ。しんちょうはひゃくななじゅっセンチメートル、たいじゅうはろくじゅっキログラム。",
    language="ja",
    model="sona_speech_2",
)

LLM を使って正規化日本語テキストを生成する

最も一般的なパターンは、LLM を 1 回呼び出して正規化済みのバージョンを生成し、textnormalized_text の両方を TTS API に渡す方法です。以下のプロンプトは、リクエストにそのままマッピングできるクリーンな JSON 出力を生成します。
You will receive a Japanese sentence that may contain kanji, numbers, symbols, and units.
For the given input, provide:
- the original text (natural Japanese using standard kanji–kana mixed notation, without furigana)
- the normalized text, converted according to the rules below.

Important:
- You must respond only with pure JSON format.
- Do not include any explanations or additional text.
- In original_text, do not include furigana (ruby annotations).

Response Format

{
  "original_text": "[natural Japanese Text]",
  "normalized_text": "[converted Text]"
}

Transcription Conversion Rules
1. Convert all kanji into hiragana using context-appropriate readings.
2. Keep katakana as is.
3. Preserve punctuation exactly as written.
4. Convert Arabic numerals into hiragana.
5. Expand units and English abbreviations into full katakana forms.
6. Apply natural phonological changes such as gemination and sound alternations.

Conversion Examples

{
  "original_text": "今日はどんな一日だったの?",
  "normalized_text": "きょうはどんないちにちだったの?"
}

{
  "original_text": "今日は10%オフだよ。身長は170cm、体重は60kgだって!",
  "normalized_text": "きょうはじゅっパーセントオフだよ。しんちょうはひゃくななじゅっセンチメートル、たいじゅうはろくじゅっキログラムだって!"
}

ヒント

  • text は自然なまま保ちましょう。 text にはふりがなや注釈を含めないでください。発音ヒントはすべて normalized_text に入れます。
  • 意味は一語一語そろえましょう。 normalized_texttext の意味と正確に対応している必要があります — 言い換えや書き換えではなく、表記のみを変換してください。
  • LLM 出力をキャッシュしましょう。 UI 文言や繰り返し使うアナウンスなど決定的な入力では、normalized_text を一度生成して元のテキストと一緒に保存しておきましょう。
  • 不要なら省略しましょう。 数字、単位、曖昧な漢字を含まないカジュアルな会話文では、normalized_text を指定するメリットは通常ありません。

関連項目

モデル

どのモデルが normalized_text に対応しているか。

Create speech

TTS リクエストの完全なリファレンス。