Skip to content

Commit

Permalink
Added an option to set voice speed
Browse files Browse the repository at this point in the history
  • Loading branch information
fyryNy committed Apr 7, 2024
1 parent a4fa965 commit b06c5b3
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 5 deletions.
25 changes: 25 additions & 0 deletions vdf-include/system/autorun/ZTTSDIALOGUES.D
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,31 @@ instance MenuItem_Opt_zTTSDialogues_Gender_Choice(C_MENU_ITEM_DEF)
);
};

instance MenuItem_Opt_zTTSDialogues_VoiceRate(C_MENU_ITEM)
{
CurrentMenuItem_PY = 4;
C_MENU_ITEM_TEXT_BASE();
fontname = FontSmall;
posy += Menu_DY * CurrentMenuItem_PY + Text_DY;

text[0] = Str_GetLocalizedString(
"Скорость голоса",
"Voice speed",
"Sprechgeschwindigkeit",
"Szybkość głosu"
);
};

instance MenuItem_Opt_zTTSDialogues_VoiceRate_Choice(C_MENU_ITEM_DEF)
{
C_MENUITEM_CHOICE_BASE();
posy += Menu_DY * CurrentMenuItem_PY;

onchgsetoption = "VoiceRate";
onchgsetoptionsection = "zTTSDialogues";
text[0] = "0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20";
};

instance MenuItem_Opt_zTTSDialogues_Open_Link(C_MENU_ITEM)
{
MenuItem_Opt_Open_Link();
Expand Down
1 change: 1 addition & 0 deletions zTTSDialogues/Headers.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Add your headers this

// Automatically generated block
#include <algorithm>
#include <sapi.h>
#pragma warning (disable:4996)
#include <sphelper.h>
Expand Down
4 changes: 4 additions & 0 deletions zTTSDialogues/Plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ namespace GOTHIC_ENGINE {
if (VoiceVolume < 0)
VoiceVolume = static_cast<int>(zoptions->ReadReal("SOUND", "soundVolume", 1.0f) * 200.0f);

VoiceRate = zoptions->ReadInt("zTTSDialogues", "VoiceRate", VoiceRate);
std::clamp(VoiceRate, 0, 20);
VoiceRate -= 10;

ReplaceAllDialogues = zoptions->ReadBool("zTTSDialogues", "ReplaceAllDialogues", ReplaceAllDialogues);

Gender = zoptions->ReadInt("zTTSDialogues", "Gender", 0) == 0 ? L"Male" : L"Female";
Expand Down
8 changes: 4 additions & 4 deletions zTTSDialogues/resource.rc
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ IDR_PATCH1 PATCH "Plugin.patch"
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,0,84
PRODUCTVERSION 1,0,0,84
FILEVERSION 1,0,0,87
PRODUCTVERSION 1,0,0,87
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
Expand All @@ -77,12 +77,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "Sefaris"
VALUE "FileDescription", "Windows TTS for unvoiced dialogues"
VALUE "FileVersion", "1.0.0.84"
VALUE "FileVersion", "1.0.0.87"
VALUE "InternalName", "zTTSDialogues"
VALUE "LegalCopyright", "Copyright (C) 2023"
VALUE "OriginalFilename", "zTTSDialogues"
VALUE "ProductName", "zTTSDialogues"
VALUE "ProductVersion", "1.0.0.84"
VALUE "ProductVersion", "1.0.0.87"
END
END
BLOCK "VarFileInfo"
Expand Down
2 changes: 1 addition & 1 deletion zTTSDialogues/zSAPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Union HEADER file

namespace GOTHIC_ENGINE {
int VoiceRate = 1;
int VoiceRate = 11;
int VoiceVolume = -1;
bool ReplaceAllDialogues = false;
bool ShouldRead = false;
Expand Down

0 comments on commit b06c5b3

Please sign in to comment.