Skip to content

Commit

Permalink
v1.6.0: 更新语音库,空选项判断,更新检测功能
Browse files Browse the repository at this point in the history
  • Loading branch information
LokerL committed Aug 8, 2022
1 parent 96343be commit 165fbbb
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 37 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tts-vue",
"version": "1.5.0",
"version": "1.6.0",
"main": "dist/electron/main/index.js",
"description": "🎤 微软语音合成工具,使用 Electron + Vue + ElementPlus + Vite 构建。",
"author": "沫離Loker <[email protected]>",
Expand Down Expand Up @@ -42,4 +42,4 @@
"pinia": "^2.0.17",
"uuid": "^8.3.2"
}
}
}
9 changes: 1 addition & 8 deletions src/components/aside/Version.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ const checkUpdate = async () => {
ElMessageBox.alert(htmlMsg, "版本信息", {
confirmButtonText: "确定",
closeOnClickModal: true,
dangerouslyUseHTMLString: true,
callback: (action: Action) => {
console.log(`action: ${action}`);
Expand Down Expand Up @@ -87,14 +88,6 @@ const checkUpdate = async () => {
</style>
<style>
.version-info {
--el-alert-padding: 8px 16px;
--el-alert-border-radius-base: 4px;
--el-alert-title-font-size: 13px;
--el-alert-description-font-size: 12px;
--el-alert-close-font-size: 12px;
--el-alert-close-customed-font-size: 13px;
--el-alert-icon-size: 16px;
--el-alert-icon-large-size: 28px;
width: 100%;
padding: 8px 16px;
margin: 0;
Expand Down
13 changes: 12 additions & 1 deletion src/components/main/MainOptions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,18 @@ const startBtn = () => {
});
return;
}
for (const key in formConfig.value) {
if (Object.prototype.hasOwnProperty.call(formConfig.value, key)) {
if (!formConfig.value[key]) {
ElMessage({
message: "有空选项。",
type: "warning",
duration: 2000,
});
return;
}
}
}
if (isLoading.value) {
ElMessage({
message: "请稍后。。。",
Expand Down
70 changes: 44 additions & 26 deletions src/components/main/options-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6088,7 +6088,50 @@ const voicesList = [
Gender: "Female",
Locale: "zh-CN",
LocaleName: "Chinese (Mandarin, Simplified)",
StyleList: ["general", "chat"],
StyleList: ["chat"],
SampleRateHertz: "24000",
VoiceType: "Neural",
Status: "Preview",
},
{
Name: "Microsoft Server Speech Text to Speech Voice (zh-CN, XiaoyiNeural)",
DisplayName: "Xiaoyi",
LocalName: "晓伊",
ShortName: "zh-CN-XiaoyiNeural",
Gender: "Female",
Locale: "zh-CN",
LocaleName: "Chinese (Mandarin, Simplified)",
StyleList: [
"angry",
"disgruntled",
"affectionate",
"cheerful",
"fearful",
"sad",
"embarrassed",
"serious",
"gentle",
],
SampleRateHertz: "24000",
VoiceType: "Neural",
Status: "Preview",
},
{
Name: "Microsoft Server Speech Text to Speech Voice (zh-CN, XiaozhenNeural)",
DisplayName: "Xiaozhen",
LocalName: "晓甄",
ShortName: "zh-CN-XiaozhenNeural",
Gender: "Female",
Locale: "zh-CN",
LocaleName: "Chinese (Mandarin, Simplified)",
StyleList: [
"angry",
"disgruntled",
"cheerful",
"fearful",
"sad",
"serious",
],
SampleRateHertz: "24000",
VoiceType: "Neural",
Status: "Preview",
Expand Down Expand Up @@ -6414,31 +6457,6 @@ const voicesList = [
},
];

/**
* {
"Name": "Microsoft Server Speech Text to Speech Voice (af-ZA, AdriNeural)",
"DisplayName": "Adri",
"LocalName": "Adri",
"ShortName": "af-ZA-AdriNeural",
"Gender": "Female",
"Locale": "af-ZA",
"LocaleName": "Afrikaans (South Africa)",
"SampleRateHertz": "24000",
"VoiceType": "Neural",
"Status": "GA",
"WordsPerMinute": "147"
},
*/

// const localeList = voicesList.map(({ Locale, LocaleName }) => {
// return { Locale, LocaleName };
// });
// let obj: any = {};
// const languageSelect = localeList.reduce((cur: any, next: any) => {
// obj[next.LocaleName] ? "" : (obj[next.LocaleName] = true && cur.push(next));
// return cur;
// }, []); //设置cur默认类型为数组,并且初始值为空的数组

const list = voicesList.map(({ LocaleName }) => LocaleName);

const set = new Set(list);
Expand Down

0 comments on commit 165fbbb

Please sign in to comment.