---
title: "音声合成用のクエリをプリセットを用いて作成する"
method: POST
path: "/audio_query_from_preset"
tags: ["クエリ作成"]
---

# 音声合成用のクエリをプリセットを用いて作成する

`POST /audio_query_from_preset`

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

## Query parameters

- `text` string, required
- `preset_id` integer, required
- `core_version` string, nullable

## 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
  - `pitchScale` number, required
  - `intonationScale` number, required
  - `volumeScale` number, required
  - `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-03-22** `ef4da11d01e0` — 3 breaking, 4 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`
  - …3 more
- **2024-01-17** `1bed97d41915` — 5 breaking, 8 warning, 2 info
  - the `accent_phrases/items/pause_mora` response's property type changed from `object` to no type for status `200`
  - removed the required property `accent_phrases/items/pause_mora/pitch` from the response with the `200` status
  - removed the required property `accent_phrases/items/pause_mora/text` from the response with the `200` status
  - removed the required property `accent_phrases/items/pause_mora/vowel` from the response with the `200` status
  - …11 more

[Change history](https://skmtc.dev/aivis-project/apis/aivisspeech-engine/changes/audio_query_from_preset/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.dev/aivis-project/apis/aivisspeech-engine/revisions/e2fc361a5b2e?raw)
