JLBA202505130001_关于吉林银行新建AI智能培训系统的需求_语音问题
This commit is contained in:
@@ -616,7 +616,8 @@
|
||||
};
|
||||
const downloadFnc = ref(null)
|
||||
const playVoice = (readType = 'pgth') => {
|
||||
console.log('playVoice11111111')
|
||||
|
||||
console.log(unref(dataInfo))
|
||||
if (voiceIsPlaying.value) return
|
||||
let _content = showContent.value;
|
||||
if (!_content) {
|
||||
@@ -758,6 +759,37 @@
|
||||
setTimeout(() => {
|
||||
setVoiceTime(0);
|
||||
}, 100);
|
||||
}else{
|
||||
console.log(type.value)
|
||||
if(type.value === 1){
|
||||
|
||||
downloadFile(unref(dataInfo).bucketKey)
|
||||
.then((res) => {
|
||||
|
||||
if (res?.data) {
|
||||
common.msg(res.data.message);
|
||||
return;
|
||||
}
|
||||
voiceLoading.value = false;
|
||||
itemVoice.value = res.tempFilePath;
|
||||
talkVoiceObj.value.src = res.tempFilePath;
|
||||
console.log('talkVoiceObj.value.src', talkVoiceObj.value.src)
|
||||
if (voiceIsPlaying.value) return
|
||||
if(unref(dataInfo)?.id !== props.activeVoiceId) return
|
||||
talkVoiceObj.value.play();
|
||||
console.log('播放')
|
||||
storageStore.setStorage('audio', unref(dataInfo)?.id, itemVoice.value);
|
||||
setTimeout(()=>{
|
||||
setVoiceTime(0)
|
||||
},100)
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log('err',err)
|
||||
voiceLoading.value = false;
|
||||
emit('changePlay', '');
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
// else{
|
||||
// setTimeout(()=>{
|
||||
@@ -776,33 +808,39 @@
|
||||
}
|
||||
})
|
||||
}
|
||||
// const setVoiceTime = (sum) => {
|
||||
// sum += 1;
|
||||
// if (talkVoiceObj.value.duration) {
|
||||
// voiceTime.value = (Math.ceil(talkVoiceObj.value.duration) || 0) + 's';
|
||||
// } else {
|
||||
// if (sum === 100) {
|
||||
// voiceTime.value = (unref(dataInfo).voiceTime || 0) + 's';
|
||||
// return;
|
||||
// }
|
||||
// setTimeout(() => {
|
||||
// setVoiceTime(sum);
|
||||
// }, 300);
|
||||
// }
|
||||
// };
|
||||
const playQnsVoice = (readType = 'qns', item) => {
|
||||
console.log(type.value)
|
||||
if (type.value === 2) {
|
||||
// 文本转语音
|
||||
playVoice(readType);
|
||||
return;
|
||||
}else{
|
||||
emit('changePlay', unref(dataInfo)?.id)
|
||||
if(talkVoiceObj.value && talkVoiceObj.value.src) {
|
||||
console.log(2)
|
||||
console.log('talkVoiceObj.value.src', talkVoiceObj.value.src)
|
||||
talkVoiceObj.value.play()
|
||||
return
|
||||
}else{
|
||||
console.log(3)
|
||||
talkVoiceObj.value.src = ''
|
||||
if(unref(dataInfo).talkingVoice){
|
||||
setTimeout(()=>{
|
||||
talkVoiceObj.value.src = unref(dataInfo).talkingVoice
|
||||
talkVoiceObj.value.play()
|
||||
isPlaying.value = true
|
||||
},100)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
// readType 阅读内容类型pgrh段落/qns问题
|
||||
emit('changePlay', unref(dataInfo)?.id);
|
||||
setTimeout(() => {
|
||||
itemVoice.value = item.talkingVoice;
|
||||
talkVoiceObj.value.src = item.talkingVoice;
|
||||
talkVoiceObj.value.play();
|
||||
}, 100);
|
||||
// // readType 阅读内容类型pgrh段落/qns问题
|
||||
// emit('changePlay', unref(dataInfo)?.id);
|
||||
// setTimeout(() => {
|
||||
// itemVoice.value = item.talkingVoice;
|
||||
// talkVoiceObj.value.src = item.talkingVoice;
|
||||
// talkVoiceObj.value.play();
|
||||
// }, 100);
|
||||
};
|
||||
const translateLoading = ref(false);
|
||||
// 翻译
|
||||
|
||||
+1811
-1720
File diff suppressed because it is too large
Load Diff
@@ -163,12 +163,12 @@
|
||||
const sendReply = (data) => {
|
||||
console.log(data,'111111111111')
|
||||
commentRef.value?.setReplyData(data, ()=>{
|
||||
commentInputRef.value.hideAll(true)
|
||||
commentInputRef.value?.hideAll(true)
|
||||
});
|
||||
}
|
||||
const hideKeyboradNow = () => {
|
||||
if (isShowing.value) return
|
||||
commentInputRef.value.hideAll()
|
||||
commentInputRef.value?.hideAll()
|
||||
}
|
||||
const getData = async () => {
|
||||
common.loading();
|
||||
|
||||
Reference in New Issue
Block a user