|
@@ -12,8 +12,8 @@
|
|
|
<template
|
|
|
v-if="
|
|
|
curQue.mp3_list &&
|
|
|
- curQue.mp3_list.length > 0 &&
|
|
|
- curQue.mp3_list[0].source === 'tts'
|
|
|
+ curQue.mp3_list.length > 0 &&
|
|
|
+ curQue.mp3_list[0].source === 'tts'
|
|
|
"
|
|
|
>
|
|
|
<div class="create_mp3_list">
|
|
@@ -23,7 +23,7 @@
|
|
|
src="../../../assets/adult/del-close.png"
|
|
|
class="mp3_del"
|
|
|
@click="delMp3"
|
|
|
- >
|
|
|
+ />
|
|
|
</div>
|
|
|
</template>
|
|
|
<template v-else>
|
|
@@ -33,7 +33,8 @@
|
|
|
type="primary"
|
|
|
:style="{ margin: '12px 0' }"
|
|
|
@click="createdMp3"
|
|
|
- >生成音频</el-button>
|
|
|
+ >生成音频</el-button
|
|
|
+ >
|
|
|
</template>
|
|
|
|
|
|
<upload
|
|
@@ -53,11 +54,9 @@
|
|
|
分配lrc
|
|
|
</el-button>
|
|
|
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- size="small"
|
|
|
- @click="analyzeVoiceFile"
|
|
|
- >根据语音和文本进行打点标记</el-button>
|
|
|
+ <el-button type="primary" size="small" @click="analyzeVoiceFile"
|
|
|
+ >根据语音和文本进行打点标记</el-button
|
|
|
+ >
|
|
|
<span :style="{ margin: '12px' }">匹配模式</span>
|
|
|
<el-select v-model="match_type" size="small">
|
|
|
<el-option
|
|
@@ -201,9 +200,21 @@
|
|
|
maxlength="200"
|
|
|
show-word-limit
|
|
|
/>
|
|
|
- <el-radio v-model="column.text_brackets.brackets_outer_type" label="chs">中文</el-radio>
|
|
|
- <el-radio v-model="column.text_brackets.brackets_outer_type" label="english">英文</el-radio>
|
|
|
- <el-radio v-model="column.text_brackets.brackets_outer_type" label="pinyin">拼音</el-radio>
|
|
|
+ <el-radio
|
|
|
+ v-model="column.text_brackets.brackets_outer_type"
|
|
|
+ label="chs"
|
|
|
+ >中文</el-radio
|
|
|
+ >
|
|
|
+ <el-radio
|
|
|
+ v-model="column.text_brackets.brackets_outer_type"
|
|
|
+ label="english"
|
|
|
+ >英文</el-radio
|
|
|
+ >
|
|
|
+ <el-radio
|
|
|
+ v-model="column.text_brackets.brackets_outer_type"
|
|
|
+ label="pinyin"
|
|
|
+ >拼音</el-radio
|
|
|
+ >
|
|
|
<span> [ </span>
|
|
|
<el-input
|
|
|
v-model="column.text_brackets.brackets_inner"
|
|
@@ -211,9 +222,17 @@
|
|
|
maxlength="200"
|
|
|
show-word-limit
|
|
|
/>
|
|
|
- <span :style="{'margin-right': '12px'}"> ]</span>
|
|
|
- <el-radio v-model="column.text_brackets.brackets_inner_type" label="english">英文</el-radio>
|
|
|
- <el-radio v-model="column.text_brackets.brackets_inner_type" label="pinyin">拼音</el-radio>
|
|
|
+ <span :style="{ 'margin-right': '12px' }"> ]</span>
|
|
|
+ <el-radio
|
|
|
+ v-model="column.text_brackets.brackets_inner_type"
|
|
|
+ label="english"
|
|
|
+ >英文</el-radio
|
|
|
+ >
|
|
|
+ <el-radio
|
|
|
+ v-model="column.text_brackets.brackets_inner_type"
|
|
|
+ label="pinyin"
|
|
|
+ >拼音</el-radio
|
|
|
+ >
|
|
|
</template>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -232,7 +251,7 @@ import { getContentFile, textCreadMp3 } from "@/api/ajax";
|
|
|
export default {
|
|
|
components: {
|
|
|
Upload,
|
|
|
- SentenceSegwordChs
|
|
|
+ SentenceSegwordChs,
|
|
|
},
|
|
|
props: {
|
|
|
curQue: {
|
|
@@ -251,16 +270,16 @@ export default {
|
|
|
rowSelection: false,
|
|
|
columnSelection: false,
|
|
|
firstLineHighlight: false,
|
|
|
- matrix: []
|
|
|
+ matrix: [],
|
|
|
},
|
|
|
- lrc_arr: []
|
|
|
+ lrc_arr: [],
|
|
|
};
|
|
|
- }
|
|
|
+ },
|
|
|
},
|
|
|
changeCurQue: {
|
|
|
type: Function,
|
|
|
- required: true
|
|
|
- }
|
|
|
+ required: true,
|
|
|
+ },
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
@@ -271,31 +290,31 @@ export default {
|
|
|
typeList: [
|
|
|
{
|
|
|
type: "text",
|
|
|
- name: "文本"
|
|
|
+ name: "文本",
|
|
|
},
|
|
|
{
|
|
|
type: "connection",
|
|
|
- name: "连接"
|
|
|
+ name: "连接",
|
|
|
},
|
|
|
{
|
|
|
type: "SentenceSegwordChs",
|
|
|
- name: "句子分词"
|
|
|
+ name: "句子分词",
|
|
|
},
|
|
|
{
|
|
|
type: "PinyinEnglish",
|
|
|
- name: "拼音 + 英文"
|
|
|
+ name: "拼音 + 英文",
|
|
|
},
|
|
|
// 解决拼音中括号的兼容性问题
|
|
|
{
|
|
|
type: "textBrackets",
|
|
|
- name: "文本中有括号"
|
|
|
- }
|
|
|
+ name: "文本中有括号",
|
|
|
+ },
|
|
|
],
|
|
|
matchTypeList: [
|
|
|
{ type: "pinyin", name: "纯拼音(例:yu)" },
|
|
|
{ type: "chinese", name: "中文(例:鱼)" },
|
|
|
- { type: "pinyinWithToneMark", name: "拼音符号音调(例:yú)" }
|
|
|
- ]
|
|
|
+ { type: "pinyinWithToneMark", name: "拼音符号音调(例:yú)" },
|
|
|
+ ],
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
@@ -330,18 +349,18 @@ export default {
|
|
|
sentence: "", // 句子
|
|
|
segList: [], // 分词结果
|
|
|
seg_words: "",
|
|
|
- wordsList: []
|
|
|
+ wordsList: [],
|
|
|
},
|
|
|
pinyin_english_data: {
|
|
|
pinyin: "",
|
|
|
- english: ""
|
|
|
+ english: "",
|
|
|
},
|
|
|
text_brackets: {
|
|
|
brackets_inner: "",
|
|
|
- brackets_inner_type: 'english',
|
|
|
+ brackets_inner_type: "english",
|
|
|
brackets_outer: "",
|
|
|
- brackets_outer_type: 'chs'
|
|
|
- }
|
|
|
+ brackets_outer_type: "chs",
|
|
|
+ },
|
|
|
};
|
|
|
}
|
|
|
}
|
|
@@ -350,7 +369,7 @@ export default {
|
|
|
|
|
|
setIsTitle(index, isTitle, e) {
|
|
|
if (e.target.className !== "el-checkbox__original") return;
|
|
|
- this.curQue.voiceMatrix.matrix[index].forEach(item => {
|
|
|
+ this.curQue.voiceMatrix.matrix[index].forEach((item) => {
|
|
|
item.isTitle = !isTitle;
|
|
|
});
|
|
|
},
|
|
@@ -361,8 +380,8 @@ export default {
|
|
|
return this.$message.warning("请先上传mp3文件");
|
|
|
}
|
|
|
let text_list = [];
|
|
|
- this.curQue.voiceMatrix.matrix.forEach(row => {
|
|
|
- row.forEach(({ type, text, sentence_data }, i) => {
|
|
|
+ this.curQue.voiceMatrix.matrix.forEach((row) => {
|
|
|
+ row.forEach(({ type, text, sentence_data, pinyin_english_data }, i) => {
|
|
|
if (type === "connection" || (type === "text" && text.length === 0)) {
|
|
|
row[i].lrc_data = {};
|
|
|
return;
|
|
@@ -374,6 +393,9 @@ export default {
|
|
|
if (type === "SentenceSegwordChs") {
|
|
|
text_list.push(sentence_data.sentence);
|
|
|
}
|
|
|
+ if (type === "PinyinEnglish") {
|
|
|
+ text_list.push(pinyin_english_data.pinyin);
|
|
|
+ }
|
|
|
});
|
|
|
});
|
|
|
let loading = this.$loading({ text: "正在分析,请等待" });
|
|
@@ -381,7 +403,7 @@ export default {
|
|
|
file_id: mp3_list[0].file_id,
|
|
|
text_list,
|
|
|
language: "ZH",
|
|
|
- match_type: this.match_type
|
|
|
+ match_type: this.match_type,
|
|
|
})
|
|
|
.then(({ lrc_list }) => {
|
|
|
loading.close();
|
|
@@ -400,7 +422,7 @@ export default {
|
|
|
}
|
|
|
getContentFile("tool-ParseLRCFile", {
|
|
|
content_type: "FILE",
|
|
|
- file_id: this.curQue.lrc_list[0].file_id
|
|
|
+ file_id: this.curQue.lrc_list[0].file_id,
|
|
|
}).then(({ lrc_list }) => {
|
|
|
this.curQue.lrc_arr = lrc_list;
|
|
|
this.distribution();
|
|
@@ -413,7 +435,7 @@ export default {
|
|
|
return this.$message.warning("没有标记可分配");
|
|
|
}
|
|
|
let curIndex = 0;
|
|
|
- this.curQue.voiceMatrix.matrix.forEach(row => {
|
|
|
+ this.curQue.voiceMatrix.matrix.forEach((row) => {
|
|
|
row.forEach(({ type, text }, i) => {
|
|
|
if (type === "connection" || (type === "text" && text.length === 0)) {
|
|
|
row[i].lrc_data = {};
|
|
@@ -435,8 +457,8 @@ export default {
|
|
|
return this.$message.warning("已有音频,请勿重复生成");
|
|
|
}
|
|
|
let article = "";
|
|
|
- this.curQue.voiceMatrix.matrix.forEach(item => {
|
|
|
- item.forEach(({ type, text, sentence_data: { sentence }}) => {
|
|
|
+ this.curQue.voiceMatrix.matrix.forEach((item) => {
|
|
|
+ item.forEach(({ type, text, sentence_data: { sentence } }) => {
|
|
|
if (type === "text" && text.length > 0) {
|
|
|
article += "\n" + text;
|
|
|
return;
|
|
@@ -451,7 +473,7 @@ export default {
|
|
|
}
|
|
|
this.createdMp3loading = true;
|
|
|
textCreadMp3({
|
|
|
- text: article
|
|
|
+ text: article,
|
|
|
}).then(({ data }) => {
|
|
|
data.fileInfo.id = "[FID##" + data.fileInfo.file_id + "##FID]";
|
|
|
data.fileInfo.name = data.fileInfo.file_name;
|
|
@@ -470,10 +492,9 @@ export default {
|
|
|
confirmButtonText: "确定",
|
|
|
cancelButtonText: "取消",
|
|
|
type: "warning",
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- this.curQue.mp3_list.splice(0, 1);
|
|
|
- });
|
|
|
+ }).then(() => {
|
|
|
+ this.curQue.mp3_list.splice(0, 1);
|
|
|
+ });
|
|
|
},
|
|
|
|
|
|
changeMp3(fileList) {
|
|
@@ -481,18 +502,15 @@ export default {
|
|
|
let articleImgRes = [];
|
|
|
articleImgList.forEach(({ response, name }) => {
|
|
|
if (response) {
|
|
|
- let {
|
|
|
- file_url,
|
|
|
- file_id,
|
|
|
- media_duration
|
|
|
- } = response.file_info_list[0];
|
|
|
+ let { file_url, file_id, media_duration } =
|
|
|
+ response.file_info_list[0];
|
|
|
|
|
|
articleImgRes.push({
|
|
|
name,
|
|
|
media_duration,
|
|
|
temporary_url: file_url,
|
|
|
url: "[FID##" + file_id + "##FID]",
|
|
|
- file_id
|
|
|
+ file_id,
|
|
|
});
|
|
|
}
|
|
|
});
|
|
@@ -509,7 +527,7 @@ export default {
|
|
|
duration: fileList.media_duration,
|
|
|
url: fileList.file_url,
|
|
|
id: "[FID##" + fileList.file_id + "##FID]",
|
|
|
- file_id: fileList.file_id
|
|
|
+ file_id: fileList.file_id,
|
|
|
});
|
|
|
}
|
|
|
});
|
|
@@ -518,16 +536,16 @@ export default {
|
|
|
|
|
|
number(attr) {
|
|
|
let val = this[attr];
|
|
|
- if (val.length <= 0) return '';
|
|
|
+ if (val.length <= 0) return "";
|
|
|
if (/(^1[012345678]$)|(^\d{1}$)/g.test(val)) {
|
|
|
return (this[attr] = Number(val));
|
|
|
}
|
|
|
if (val.length >= 2 && /^\d*$/g.test(val)) {
|
|
|
return (this[attr] = 18);
|
|
|
}
|
|
|
- this[attr] = '';
|
|
|
- }
|
|
|
- }
|
|
|
+ this[attr] = "";
|
|
|
+ },
|
|
|
+ },
|
|
|
};
|
|
|
</script>
|
|
|
|