Commit d847ec3d by Ken Nakahira

提交更新代码

parent a01172b9
......@@ -512,6 +512,7 @@ export default {
fontSize:0,
boxHeight:210,
debouncedNextTips:null,
processingDialogue:false,
quotedData:[]
}
},
......@@ -684,27 +685,31 @@ export default {
this.loadingBG = true
},
nextTips(){
//结算当前语音的递归 进行下一次语音
// 结算当前语音的递归 进行下一次语音
// this.EPlayer.onEnded()
this.jumping = true
clearInterval(this.Strem)
this.EPlayer.stop()
if(!this.kill){
console.log('NextStr',this.str)
this.yyds_pangbai += this.str
}
this.jumping = false
this.EPlayer.onended()
},
updateDialogueDisplay(dialogue) {
uni.createSelectorQuery().in(this).select('#pangbaiContainer').boundingClientRect((res)=>{
if(res) {
res.innerHTML += dialogue;
this.$nextTick(() => {
this.jumping = true
clearInterval(this.Strem)
if(this.EPlayer) {
this.EPlayer.stop()
}
if(this.glod_dp && this.str != "") {
console.log('Text Appended')
this.realVoice(this.str)
} else {
this.yyds_pangbai += this.str
}
}).exec()
this.str = ''
this.jumping = false
this.EPlayer.onended()
console.log('------------------')
});
},
realVoice(text){
this.yyds_dp = text
this.yyds_pangbai += " “ "+text+ " ” "
},
debounce(fn, interval) {
console.log('Test A');
var timer;
var gapTime = interval;//间隔时间,如果interval不传,则默认1000ms
return function() {
......@@ -712,13 +717,13 @@ export default {
var context = this;
var args = arguments;//保存此处的arguments,因为setTimeout是全局的,arguments不是防抖函数需要的。
timer = setTimeout(function() {
fn.call(context,args);
fn.apply(context,args);
}, gapTime);
};
},
created() {
// Bind the debounced version of nextTips
this.debouncedNextTips = this.debounce(this.nextTips, 300);
this.debouncedNextTips = this.debounce(this.nextTips, 750);
},
handleCloseDialog(){
this.show = false
......@@ -1736,7 +1741,7 @@ export default {
if (Cobj2.content != "") {
setTimeout(() => {
this.FetchAbuffer(Cobj2, voicer, Sarry)
}, 1000)
}, 500)
}
}).catch(err=>{
console.log(1223,err)
......@@ -1765,7 +1770,7 @@ export default {
if (Cobj.content != "") {
setTimeout(() => {
this.FetchAbuffer_real(Cobj, voicer, Sarry)
}, 1000)
}, 500)
}
})
},
......@@ -1780,40 +1785,42 @@ export default {
// const voicer = arrObj[0].quoted ? this.currentPageData.voiceGroups[1] : this.currentPageData.voiceGroups[0];
let arrObj = data;
console.log('arrObj_execFile',arrObj)
const content = arrObj[0].text;
const voicer = arrObj[0].voicer;
this.GoSay(content,voicer,(text, falg)=>{
if(arrObj[0].quoted){
if(text!==""&&!falg){
this.glod_dp = true
// this.glod_user = false
this.yyds_dp = text
this.yyds_pangbai += " “ "+text+ " ” "
}
if (falg) {
console.log('GoSound讲话完毕!')
arrObj.shift()
console.log('arrObj',arrObj)
if(arrObj.length!==0){
this.execFile(arrObj)
}
}
}else{
if(text!==""&&!falg){
this.kill = false
this.delayText(text)
}
if (falg) {
console.log('GoSay讲话完毕!')
this.kill = true
arrObj.shift()
console.log('arrObj',arrObj)
if(arrObj.length!==0){
this.execFile(arrObj)
}
}
}
if(!arrObj || arrObj.length == 0) {return}
if(arrObj[0].quoted){
if(text!==""&&!falg){
console.log('Quote Added')
this.glod_dp = true
// this.glod_user = false
this.yyds_dp = text
this.yyds_pangbai += " “ "+text+ " ” "
}
if (falg) {
console.log('GoSound讲话完毕!')
arrObj.shift()
console.log('arrObj',arrObj)
if(arrObj.length!==0){
this.execFile(arrObj)
}
}
}else {
if (text !== "" && !falg) {
this.kill = false
this.delayText(text)
}
if (falg) {
console.log('GoSay讲话完毕!')
this.kill = true
arrObj.shift()
console.log('arrObj', arrObj)
if (arrObj.length !== 0) {
this.execFile(arrObj)
}
}
}
})
// if(this.soundVoice[voicer]){
......@@ -1873,7 +1880,7 @@ export default {
if(count.length==0){
clearInterval(this.Strem)
}
}, 100);
}, 50);
},
createSSML(text, voiceName) {
......@@ -1889,11 +1896,13 @@ export default {
// GoSound 真人音线
GoSound(content, voicer, CB) {
// 要读的文字 声线 回调
console.log('First')
const that = this
let Sarry = [];
this.Cobj = this.computeLen({ content });
this.str = this.Cobj.Sr
this.glod_dp = true
uni.request({
url: 'https://admin.mindepoch.com:8089/VoiceMode/GetVoiceEcho',
method: 'post',
......@@ -1969,6 +1978,8 @@ export default {
that.jumping = false
Rfunc()
}else{
console.log('Checkpoint')
this.str = Sobj.S
that.tempFilePath2 = wx.env.USER_DATA_PATH + `/tempAudio_${new Date().getTime()}.mp3`;
FileSystemManager.writeFile({
filePath: that.tempFilePath2,
......@@ -1995,7 +2006,7 @@ export default {
if (that.Cobj.content != "") {
setTimeout(() => {
that.FetchAbuffer_real(that.Cobj, voicer, Sarry, CB)
}, 5000)
}, 2000)
}
},
fail:(err)=>{
......@@ -2051,6 +2062,7 @@ export default {
console.log('oooGoSayooo')
this.EPlayer.cb = CB
var Rfunc = () => {
console.log('Sarry',Sarry)
if(this.jumping){
return
}
......@@ -2088,6 +2100,8 @@ export default {
this.jumping = false
Rfunc()
}else{
console.log('Checkpoint')
this.str = Sobj.S
this.tempFilePath2 = wx.env.USER_DATA_PATH + `/tempAudio_${new Date().getTime()}.mp3`;
// const mark = that.Cobj2.Sr
FileSystemManager.writeFile({
......@@ -2113,7 +2127,7 @@ export default {
if (this.Cobj2.content != "") {
setTimeout(() => {
this.FetchAbuffer(this.Cobj2, voicer, Sarry, CB)
}, 5000)
}, 2000)
}
},
......
This source diff could not be displayed because it is too large. You can view the blob instead.
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