Commit 6dc9204d by haojie

洗稿提交

parent 65a30295
......@@ -50,12 +50,10 @@ export const processTextCallback = () => {
};
// 生成音频
let res: any = await liveTts(params);
if (res.code == 0) {
}
console.log('等待音频生成完成');
// 开始轮询
openInterval(true);
}
}
openInterval(true, '', true, currentConfuseId.value, false, list.length);
};
// 洗稿列表变化
......@@ -150,6 +148,7 @@ export const processTextCallback = () => {
try {
let res: any = await createLiveTask(filterFiled());
if (res.code == 0) {
console.log('创建成功-', res.data.id);
live_task_id.value = res.data.id;
return true;
}
......@@ -296,6 +295,9 @@ export const processTextCallback = () => {
params.type_content = list;
let res: any = await liveTaskRegenerate(live_task_id.value, params);
if (res.code == 0) {
console.log('提交的参数', params);
console.log(JSON.stringify(params));
console.log('重新生成直播,已经提交-', live_task_id.value);
if (successCallback) {
submitSuccessed();
}
......@@ -326,31 +328,32 @@ export const processTextCallback = () => {
successCallback: boolean,
uuid: string,
customRegenerate: any = false,
confuseLength: number = 0,
) => {
try {
let res: any = await getLiveTtsCallback({
task_id: getTaskId(isConfuse, uuid),
});
if (res.code == 0) {
if (isDev()) {
let params = {
data: {
audio_address:
'http://nls-cloud-cn-shanghai.oss-cn-shanghai.aliyuncs.com/jupiter-flow/tmp/ed71050141c74954ac779cfbb9dd9604.wav?Expires=1691136228&OSSAccessKeyId=LTAIUpwNp2H7pBG5&Signature=jE01uOk8Vfa08ovlPbJYI2Bhwvs%3D',
task_id: 0,
},
};
for (let i = 0; i < 10; i++) {
res.data.push(params);
}
}
// if (isDev()) {
// let params = {
// data: {
// audio_address:
// 'http://nls-cloud-cn-shanghai.oss-cn-shanghai.aliyuncs.com/jupiter-flow/tmp/ed71050141c74954ac779cfbb9dd9604.wav?Expires=1691136228&OSSAccessKeyId=LTAIUpwNp2H7pBG5&Signature=jE01uOk8Vfa08ovlPbJYI2Bhwvs%3D',
// task_id: 0,
// },
// };
// for (let i = 0; i < 10; i++) {
// res.data.push(params);
// }
// }
if (res.data.length) {
console.log('音频任务回调成功');
console.log(res.data);
// 关闭定时器
closeInterval();
if (!isConfuse) {
if (res.data.length >= createLiveInfo.value[createLiveKeys.textScriptList].length) {
// 关闭定时器
closeInterval();
let list = JSON.parse(JSON.stringify(createLiveInfo.value[createLiveKeys.textScriptList]));
let audio_list = [];
// 本次任务不是洗稿任务才修改store
......@@ -397,6 +400,8 @@ export const processTextCallback = () => {
}
}
} else {
if (res.data.length >= confuseLength) {
closeInterval();
let audio_list = [];
// 洗稿任务
res.data.forEach((item: any) => {
......@@ -420,6 +425,7 @@ export const processTextCallback = () => {
}
}
}
}
} catch (e) {
console.log(e);
}
......@@ -430,9 +436,10 @@ export const processTextCallback = () => {
successCallback: boolean = true,
uuid: string = '',
customRegenerate: any = false,
confuseLength: number = 0,
) => {
interval.value = window.setInterval(() => {
getTaskStatus(isConfuse, type, successCallback, uuid, customRegenerate);
getTaskStatus(isConfuse, type, successCallback, uuid, customRegenerate, confuseLength);
}, 3000);
};
......
......@@ -150,12 +150,10 @@ const submitAudioTask = async (list: any[]) => {
};
// 生成音频
let res: any = await liveTts(params);
if (res.code == 0) {
}
console.log('等待音频生成完成');
// 开始轮询
confuseInterval(true, '', false, currentConfuseId.value, regenerate);
}
}
confuseInterval(true, '', false, currentConfuseId.value, regenerate, list.length);
};
// 洗稿列表变化
......
......@@ -72,12 +72,12 @@ import ChoseDigitalPerson from './components/ChoseDigitalPerson.vue';
import HomeSvg from '@/assets/svg/createLive/home.svg';
import InteractSvg from '@/assets/svg/createLive/interact.svg';
import ScriptsSvg from '@/assets/svg/createLive/scripts.svg';
import { computed, onMounted, onBeforeMount, ref, onBeforeUnmount, onActivated, onDeactivated } from 'vue';
import { computed, onBeforeMount, ref, onBeforeUnmount, onActivated } from 'vue';
import { getElBounding, show_message, isDev, DataType, dimensionalConvert } from '@/utils/tool';
import { useStore } from 'vuex';
import { createLiveKeys, scriptTypeText, scriptTypePhonetics } from '@/service/CreateLive';
import { createLiveTask, getLiveTaskInfo, createDrafts, getDraftsDetail, liveTts } from '@/utils/api/userApi';
import { useRoute, useRouter, onBeforeRouteLeave, onBeforeRouteUpdate } from 'vue-router';
import { getLiveTaskInfo, createDrafts, getDraftsDetail, liveTts } from '@/utils/api/userApi';
import { useRoute, onBeforeRouteLeave } from 'vue-router';
import routerConfig from '@/router/tool';
import { onUpdateLiveTask } from '@/service/Common';
import { callPyjsInWindow } from '@/utils/pyqt';
......@@ -93,7 +93,6 @@ const store = useStore();
const route = useRoute();
// 离开页面前的query
const currentQuery = ref({});
const router = useRouter();
const liveImage = computed(() => store.getters['live/getLiveimage']);
// 创建直播的已有的字段
const createLiveInfo = computed(() => store.getters['live/getLiveInfo']);
......@@ -457,9 +456,6 @@ const initPage = () => {
// 获取uuid
const getUuid = () => {
if (isDev()) {
return 'e6e973a5-ccdd-4779-a09a-be1658ecbea2';
}
return v4();
};
......@@ -508,9 +504,6 @@ onBeforeRouteLeave(() => {
currentQuery.value = route.query;
});
// 缓存离开
// onDeactivated(() => {});
onBeforeUnmount(() => {
// 清空选择的数字人
store.commit('live/setLiveImage', '');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment