Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

マニフェストに能力を追加 #456

Merged
merged 1 commit into from
Sep 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 38 additions & 1 deletion engine_manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,42 @@
"update_infos": "engine_manifest_assets/update_infos.json",
"dependency_licenses": "engine_manifest_assets/dependency_licenses.json",
"downloadable_libraries_path": null,
"downloadable_libraries_url": null
"downloadable_libraries_url": null,
"supported_features": {
"adjust_mora_pitch": {
"type": "bool",
"value": true,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issueでは「default」だったのですが、そもそもここをエディタ側などで変更することがないので、普通にvalueにしました。

"name": "モーラごとの音高の調整"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

別にユーザーに見せる場所ではないので、descriptionはなくても良いかなと思って省いてみました。

},
"adjust_phoneme_length": {
"type": "bool",
"value": true,
"name": "音素ごとの長さの調整"
},
"adjust_speed_scale": {
"type": "bool",
"value": true,
"name": "全体の話速の調整"
},
"adjust_pitch_scale": {
"type": "bool",
"value": true,
"name": "全体の音高の調整"
},
"adjust_intonation_scale": {
"type": "bool",
"value": true,
"name": "全体の抑揚の調整"
},
"adjust_volume_scale": {
"type": "bool",
"value": true,
"name": "全体の音量の調整"
},
"interrogative_upspeak": {
"type": "bool",
"value": true,
"name": "疑問文の自動調整"
}
}
}
15 changes: 15 additions & 0 deletions voicevox_engine/engine_manifest/EngineManifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,20 @@ class LicenseInfo(BaseModel):
text: str = Field(title="依存ライブラリのライセンス本文")


class SupportedFeatures(BaseModel):
"""
エンジンが持つ機能の一覧
"""

adjust_mora_pitch: bool = Field(title="モーラごとの音高の調整")
adjust_phoneme_length: bool = Field(title="音素ごとの長さの調整")
adjust_speed_scale: bool = Field(title="全体の話速の調整")
adjust_pitch_scale: bool = Field(title="全体の音高の調整")
adjust_intonation_scale: bool = Field(title="全体の抑揚の調整")
adjust_volume_scale: bool = Field(title="全体の音量の調整")
interrogative_upspeak: bool = Field(title="疑問文の自動調整")


class EngineManifest(BaseModel):
"""
エンジン自体に関する情報
Expand All @@ -44,3 +58,4 @@ class EngineManifest(BaseModel):
downloadable_libraries_url: Optional[str] = Field(
title="ダウンロード可能な音声ライブラリ情報を取得するためのAPIのURL"
)
supported_features: SupportedFeatures = Field(title="エンジンが持つ機能")
4 changes: 4 additions & 0 deletions voicevox_engine/engine_manifest/EngineManifestLoader.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,9 @@ def load_manifest(self) -> EngineManifest:
],
downloadable_libraries_path=manifest["downloadable_libraries_path"],
downloadable_libraries_url=manifest["downloadable_libraries_url"],
supported_features={
key: item["value"]
for key, item in manifest["supported_features"].items()
},
)
return manifest