Skip to content

Commit b147692

Browse files
committed
デフォルトの声タイプ選択処理を変更
1 parent 6b037ae commit b147692

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

core/src/main/java/dev/felnull/itts/core/voice/VoiceManager.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,14 @@ public Optional<VoiceType> getVoiceType(String id) {
128128
public VoiceType getDefaultVoiceType() {
129129
return getAvailableVoiceTypes().values().stream()
130130
.flatMap(Collection::stream)
131-
.min(Comparator.comparingInt(vt -> voiceTextManager.getCategory() == vt.getCategory() ? 1 : 0))
131+
.max(Comparator.comparingInt(vt -> {
132+
if (voiceTextManager.getCategory() == vt.getCategory()) {
133+
return -1;
134+
} else if (voicevoxManager.getCategory() == vt.getCategory()) {
135+
return 1;
136+
}
137+
return 0;
138+
}))
132139
.orElse(null);
133140
}
134141

0 commit comments

Comments
 (0)