Skip to content

REST APIの GET /speakers と GET /speaker_info で取得されるスタイルが一致しない #1021

@hmoriz

Description

@hmoriz

不具合の内容

表題に記載させていただいた通りの現象が発生しております

現象・ログ

一部の話者の情報で、 speakersによるスタイル一覧にあるものが、speaker_infoで出てこないパターンが発生している。
自分が観測した範囲では「玄野武宏」と「九州そら」で発生している。
「玄野武宏」の場合、speakersではstyle_id = 39, 40, 41, 11 の4つが返ってきているが、speaker_info側では39, 40, 41のものしか返ってこない

GET /speakers (「玄野武宏」のみ記載)

{
    "supported_features": {"permitted_synthesis_morphing": "ALL"},
    "name": "玄野武宏",
    "speaker_uuid": "c30dc15a-0992-4f8d-8bb8-ad3b314e6a6f",
    "styles": [
        {"name": "喜び","id": 39},
        {"name": "ツンギレ","id": 40},
        {"name": "悲しみ","id": 41 }
    ],
    "version": "0.14.4"
},
...
{
    "supported_features": {"permitted_synthesis_morphing": "ALL"},
    "name": "玄野武宏",
    "speaker_uuid": "c30dc15a-0992-4f8d-8bb8-ad3b314e6a6f",
    "styles": [
        {"name": "ノーマル","id": 11}
    ],
    "version": "0.14.4"
}

GET /speaker_info?speaker_uuid=c30dc15a-0992-4f8d-8bb8-ad3b314e6a6f (「玄野武宏」、画像と音声部分は省略)

{
  "policy": "玄野武宏の音声ライブラリを用いて生成した音声は、\n「VOICEVOX:玄野武宏」とクレジットを記載すれば、商用・非商用で利用可能です。\n\n利用規約の詳細は以下をご確認ください。  \nhttps://virvoxproject.wixsite.com/official/voicevoxの利用規約\n",
  "portrait": "...",
  "style_infos": [
    {"id": 39,"icon": "...","portrait": null,"voice_samples": ["...","...","..."]},
    {"id": 40,"icon": "...","portrait": null,"voice_samples": ["...","...","..."]},
    {"id": 41,"icon": "...","portrait": null,"voice_samples": ["...","...","..."]
    },
  ]
}

また、↓ログは、本voicevox_engine mainブランチからpyinstallerでビルドしたrun.exeを使用してVOICEVOXエディタを起動させた際に発生したエラー (名前の文字化けは「玄野武宏」)

[23:45:10.407] [error] Error: Not found the style id "11" of "邇・㍽豁ヲ螳・.
    at http://localhost:5173/store/audio.ts:2351:19
    at Array.forEach (<anonymous>)
    at getStyles (http://localhost:5173/store/audio.ts:2346:24)
    at getSpeakerInfo (http://localhost:5173/store/audio.ts:2379:24)
    at async http://localhost:5173/store/audio.ts:2393:18
    at async Promise.all (index 24)
    at async http://localhost:5173/store/audio.ts:2391:30

再現手順

現象に記載している通り「玄野武宏(uuid: c30dc15a-0992-4f8d-8bb8-ad3b314e6a6f)」で当該APIを実行すれば確認できる想定

期待動作

「玄野武宏」でspeaker_infoを取得した際に id = 11(ノーマル)のスタイル情報も返ってくる

VOICEVOXのバージョン

  • VOICEVOX_engineは現状のmainブランチ 2024/1/21現在の最新コミットから直接起動
  • VOICEVOX_coreは「v0.15.0-preview.16」の「Windows x64 CPU版」のdllをダウンロードしてengineに分かるように起動時パラメータ設定
  • v0.15規格の製品版音声を使うため、speaker_info情報は voicevox_resourceから拝借・model情報はvoicevox_fat_resourceから拝借してます

OSの種類/ディストリ/バージョン

  • Windows
  • macOS
  • Linux

その他

こちらなりにしらべてみたところ、 https://github.com/VOICEVOX/voicevox_fat_resource/blob/main/core/model/README.md に記載されている「vvm ファイル名」と「スタイル ID」で複数のvvmファイルにまたがってスタイルが存在している場合に1つのVVMファイルからしか取得していないように見受けられました。
speaker_infoの処理

voicevox_engine/run.py

Lines 827 to 833 in 9e1b0f0

speakers = json.loads(get_core(core_version).speakers)
for i in range(len(speakers)):
if speakers[i]["speaker_uuid"] == speaker_uuid:
speaker = speakers[i]
break
else:
raise HTTPException(status_code=404, detail="該当する話者が見つかりません")

部分にて、speakers[i]が「VVMファイル単位」となり、speakerが単一VVMファイルのデータとなっているからではないかと推測してます

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions