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

Python APIにNewTypeを導入 #678

Merged
merged 1 commit into from
Nov 15, 2023

Conversation

qryxip
Copy link
Member

@qryxip qryxip commented Nov 15, 2023

内容

Python APIに以下のNewTypeを追加します。

StyleId = NewType("StyleId", int)
StyleVersion = NewType("StyleVersion", str)
VoiceModelId = NewType("VoiceModelId", str)

Synthesizerのメソッドの引数ではstyle_id: StyleId | intのようにし、intも型チェックが通るようにします。

関連 Issue

#545

その他

Javaには手を付けていません。
(GSONがこの手のものを扱えるか未検証)

Copy link
Member

@Hiroshiba Hiroshiba left a comment

Choose a reason for hiding this comment

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

LGTM!!

Synthesizerのメソッドの引数ではstyle_id: StyleId | intのようにし、intも型チェックが通るようにします。

良いと思いました!
VoiceModelIdとかはブランド型以外使えなくてもまあまあ問題なさそうですが、StyleIdなんかは普通に整数値を指定できた方が良さそうかなと思いました。

@Hiroshiba
Copy link
Member

問題ないと思うのでマージします!

@Hiroshiba Hiroshiba merged commit 302437f into VOICEVOX:main Nov 15, 2023
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants