Commit d847ec3d by Ken Nakahira

提交更新代码

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