---
title: "音声合成用のクエリを作成する"
method: POST
path: "/audio_query"
tags: ["クエリ作成"]
---

# 音声合成用のクエリを作成する

`POST /audio_query`

音声合成用のクエリの初期値を得ます。ここで得られたクエリはそのまま音声合成に利用できます。各値の意味は`Schemas`を参照してください。

## Query parameters

- `text` string, required
- `speaker` integer, required
- `core_version` string, nullable — AivisSpeech Engine ではサポートされていないパラメータです (常に無視されます) 。

## Response `200`

Successful Response

- AudioQuery — 音声合成用のクエリ
  - `accent_phrases` AccentPhrase[], required
    - `moras` Mora[], required
      - `text` string, required
      - `consonant` string, nullable
      - `consonant_length` number, nullable
      - `vowel` string, required
      - `vowel_length` number, required
      - `pitch` number, required
    - `accent` integer, required
    - `pause_mora` Mora — モーラ（子音＋母音）ごとの情報
      - `text` string, required
      - `consonant` string, nullable
      - `consonant_length` number, nullable
      - `vowel` string, required
      - `vowel_length` number, required
      - `pitch` number, required
    - `is_interrogative` boolean
  - `speedScale` number, required — 全体の話速を 0.5 ~ 2.0 の範囲で指定する (デフォルト: 1.0) 。 2.0 で 2 倍速、0.5 で 0.5 倍速になる。
  - `intonationScale` number, required — 話者スタイルの声色の強弱を 0.0 ~ 2.0 の範囲で指定する (デフォルト: 1.0) 。 値が大きいほどそのスタイルに近い抑揚がついた声になる。 例えば話者スタイルが「うれしい」なら、値が大きいほどより嬉しそうな明るい話し方になる。 一方スタイルによっては値を大きくしすぎると不自然な棒読みボイスになりがちなので、適宜調整が必要。 全スタイルの平均であるノーマルスタイルには指定できない (値にかかわらず無視される) 。
  - `tempoDynamicsScale` number — 話す速さの緩急の強弱を 0.0 ~ 2.0 の範囲で指定する (デフォルト: 1.0) 。 値が大きいほどより早口で生っぽい抑揚がついた声になる。 VOICEVOX ENGINE との互換性のため、未指定時はデフォルト値が適用される。
  - `pitchScale` number, required — 全体の音高を -0.15 ~ 0.15 の範囲で指定する (デフォルト: 0.0) 。 値が大きいほど高い声になる。 VOICEVOX ENGINE と異なり、この値を 0.0 から変更すると音質が劣化するため注意が必要。
  - `volumeScale` number, required — 全体の音量を 0.0 ~ 2.0 の範囲で指定する (デフォルト: 1.0) 。 値が大きいほど大きな声になる。
  - `prePhonemeLength` number, required
  - `postPhonemeLength` number, required
  - `outputSamplingRate` integer, required
  - `outputStereo` boolean, required
  - `kana` string, nullable — 読み上げるテキストを指定する。 VOICEVOX ENGINE では AquesTalk 風記法テキストが入る読み取り専用フィールドだが (音声合成時には無視される) 、AivisSpeech Engine では音声合成時に漢字や記号が含まれた通常の読み上げテキストも必要なため、苦肉の策で読み上げテキスト指定用のフィールドとして転用した。 VOICEVOX ENGINE との互換性のため None や空文字列が指定された場合も動作するが、その場合はアクセント句から自動生成されたひらがな文字列が読み上げテキストになるため、不自然なイントネーションになってしまう。 可能な限り kana に通常の読み上げテキストを指定した上で音声合成 API に渡すことを推奨する。

## Other responses

- `422` — Validation Error

## Changes

- **2024-05-09** `fd13ee3ebb92` — 1 warning, 1 info
  - removed the optional property `styleStrengthScale` from the response with the `200` status
  - added the optional property `tempoDynamicsScale` to the response with the `200` status
- **2024-05-02** `7d46d11815c2` — 3 breaking, 5 info
  - response property `accent_phrases/items/moras/items/consonant` list-of-types was widened by adding types `null` to media type `application/json` of response `200`
  - response property `accent_phrases/items/moras/items/consonant_length` list-of-types was widened by adding types `null` to media type `application/json` of response `200`
  - response property `kana` list-of-types was widened by adding types `null` to media type `application/json` of response `200`
  - `query` request parameter `core_version` list-of-types was widened by adding types `null`
  - …4 more
- **2024-04-26** `907e5011a1aa` — 1 breaking, 1 warning, 6 info
  - `query` request parameter `core_version` list-of-types was narrowed by removing types `null`
  - removed the optional property `styleStrengthScale` from the response with the `200` status
  - for the `query` request parameter `core_version`, the type was generalized from no type to `string`
  - added `#/components/schemas/Mora` to the `accent_phrases/items/pause_mora` response property `allOf` list for the response status `200`
  - …4 more
- …earlier changes not shown

[Full history](https://skmtc.dev/aivis-project/apis/aivisspeech-engine/changes/audio_query/post.md)

---

[API](https://skmtc.dev/aivis-project/apis/aivisspeech-engine.md) · [All operations](https://skmtc.dev/aivis-project/apis/aivisspeech-engine/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/aivis-project/aivisspeech-engine/revisions/fd13ee3ebb92/schema)
