Skip to content

Commit

Permalink
feat(settings): allow to enable azure tts
Browse files Browse the repository at this point in the history
New settings provided in settings dialog to activate Azure TTS in the embedded pipeline 2.

Also :
- Added a global TTS config file setting for pipeline 2
- Add error messages to addin file log
- Removed or set as debug some debugging print from xsl
- improved addin-side xml conversion progress messages
- Generalized the uri escaping fix to all outputed pipeline 2 files
  • Loading branch information
NPavie committed Oct 23, 2023
1 parent 9ecf362 commit b475aa3
Show file tree
Hide file tree
Showing 13 changed files with 600 additions and 464 deletions.
95 changes: 95 additions & 0 deletions Common/DaisyAddinLib/ConverterSettingsForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,90 @@ public ConverterSettingsForm()
{"Brazil Southeast", "brazilsoutheast"},
};

private static readonly Dictionary<string, string> AzureRegionRevertDictionnary = new Dictionary<string, string>() {
{"" , ""},
{"eastus", "East US"},
{"eastus2", "East US 2"},
{"southcentralus", "South Central US"},
{"westus2", "West US 2"},
{"westus3", "West US 3"},
{"australiaeast", "Australia East"},
{"southeastasia", "Southeast Asia"},
{"northeurope", "North Europe"},
{"swedencentral", "Sweden Central"},
{"uksouth", "UK South"},
{"westeurope", "West Europe"},
{"centralus", "Central US"},
{"southafricanorth", "South Africa North"},
{"centralindia", "Central India"},
{"eastasia", "East Asia"},
{"japaneast", "Japan East"},
{"koreacentral", "Korea Central"},
{"canadacentral", "Canada Central"},
{"francecentral", "France Central"},
{"germanywestcentral", "Germany West Central"},
{"norwayeast", "Norway East"},
{"switzerlandnorth", "Switzerland North"},
{"uaenorth", "UAE North"},
{"brazilsouth", "Brazil South"},
{"centraluseuap", "Central US EUAP"},
{"eastus2euap", "East US 2 EUAP"},
{"qatarcentral", "Qatar Central"},
{"centralusstage", "Central US (Stage)"},
{"eastusstage", "East US (Stage)"},
{"eastus2stage", "East US 2 (Stage)"},
{"northcentralusstage", "North Central US (Stage)"},
{"southcentralusstage", "South Central US (Stage)"},
{"westusstage", "West US (Stage)"},
{"westus2stage", "West US 2 (Stage)"},
{"asia", "Asia"},
{"asiapacific", "Asia Pacific"},
{"australia", "Australia"},
{"brazil", "Brazil"},
{"canada", "Canada"},
{"europe", "Europe"},
{"france", "France"},
{"germany", "Germany"},
{"global", "Global"},
{"india", "India"},
{"japan", "Japan"},
{"korea", "Korea"},
{"norway", "Norway"},
{"singapore", "Singapore"},
{"southafrica", "South Africa"},
{"switzerland", "Switzerland"},
{"uae", "United Arab Emirates"},
{"uk", "United Kingdom"},
{"unitedstates", "United States"},
{"unitedstateseuap", "United States EUAP"},
{"eastasiastage", "East Asia (Stage)"},
{"southeastasiastage", "Southeast Asia (Stage)"},
{"brazilus", "Brazil US"},
{"eastusstg", "East US STG"},
{"northcentralus", "North Central US"},
{"westus", "West US"},
{"jioindiawest", "Jio India West"},
{"devfabric", "devfabric"},
{"westcentralus", "West Central US"},
{"southafricawest", "South Africa West"},
{"australiacentral", "Australia Central"},
{"australiacentral2", "Australia Central 2"},
{"australiasoutheast", "Australia Southeast"},
{"japanwest", "Japan West"},
{"jioindiacentral", "Jio India Central"},
{"koreasouth", "Korea South"},
{"southindia", "South India"},
{"westindia", "West India"},
{"canadaeast", "Canada East"},
{"francesouth", "France South"},
{"germanynorth", "Germany North"},
{"norwaywest", "Norway West"},
{"switzerlandwest", "Switzerland West"},
{"ukwest", "UK West"},
{"uaecentral", "UAE Central"},
{"brazilsoutheast", "Brazil Southeast"},
};

private void Daisysettingsfrm_Load(object sender, EventArgs e)
{
notesNumberingStartValue.Mask = "000";
Expand Down Expand Up @@ -177,6 +261,9 @@ private void Daisysettingsfrm_Load(object sender, EventArgs e)
notesNumberingStartValue.Text = GlobaleSettings.FootnotesStartValue.ToString();
notesNumberPrefixValue.Text = GlobaleSettings.FootnotesNumberingPrefix;
notesNumberSuffixValue.Text = GlobaleSettings.FootnotesNumberingSuffix;
TTSConfigFilePath.Text = GlobaleSettings.TTSConfigFile;
AzureKeyValue.Text = GlobaleSettings.AzureSpeechKey;
AzureRegionValue.SelectedItem = AzureRegionRevertDictionnary[GlobaleSettings.AzureSpeechRegion ?? ""];

this.notesNumberingStartValue.Enabled = notesNumberingMap[(string)notesNumberingSelector.SelectedItem] == ConverterSettings.FootnotesNumberingChoice.Enum.Number;

Expand Down Expand Up @@ -323,5 +410,13 @@ private void notesNumberingSelector_SelectedIndexChanged(object sender, EventArg
this.notesNumberingStartValue.Enabled = notesNumberingMap[(string)notesNumberingSelector.SelectedItem] == ConverterSettings.FootnotesNumberingChoice.Enum.Number;
}

private void TTSConfigFileBrowse_Click(object sender, EventArgs e)
{
if (TTSConfigFileSelect.ShowDialog(this) == DialogResult.OK) {
if(TTSConfigFileSelect.FileName.Length > 0) {
GlobaleSettings.TTSConfigFile = TTSConfigFilePath.Text = TTSConfigFileSelect.FileName;
}
};
}
}
}
68 changes: 38 additions & 30 deletions Common/DaisyAddinLib/ConverterSettingsForm.designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b475aa3

Please sign in to comment.